zathura/page.h

207 lines
5.0 KiB
C
Raw Permalink Normal View History

2012-03-26 14:44:56 +02:00
/* See LICENSE file for license and copyright information */
#ifndef PAGE_H
#define PAGE_H
#include <girara/datastructures.h>
#include <cairo.h>
2012-03-26 14:44:56 +02:00
#include "types.h"
2012-03-26 14:44:56 +02:00
/**
* Get the page object
*
* @param document The document
2012-03-26 15:30:58 +02:00
* @param index Page number
2012-03-26 15:17:01 +02:00
* @param error Optional error
2012-03-26 14:44:56 +02:00
* @return Page object or NULL if an error occured
*/
2012-03-26 15:30:58 +02:00
zathura_page_t* zathura_page_new(zathura_document_t* document, unsigned int
2012-03-27 13:30:04 +02:00
index, zathura_error_t* error);
2012-03-26 14:44:56 +02:00
/**
* Frees the page object
*
* @param page The page object
2012-03-27 13:30:04 +02:00
* @return ZATHURA_ERROR_OK when no error occured, otherwise see
* zathura_error_t
2012-03-26 14:44:56 +02:00
*/
2012-03-27 13:30:04 +02:00
zathura_error_t zathura_page_free(zathura_page_t* page);
2012-03-26 14:44:56 +02:00
/**
* Returns the associated document
*
* @param page The page object
* @return The associated document
* @return NULL if an error occured
*/
zathura_document_t* zathura_page_get_document(zathura_page_t* page);
/**
* Returns the set id of the page
*
* @param page The page object
* @return The id of the page
*/
2012-03-26 15:30:58 +02:00
unsigned int zathura_page_get_index(zathura_page_t* page);
2012-03-26 14:44:56 +02:00
/**
* Returns the width of the page
*
* @param page The page object
* @return Width of the page
* @return -1 If an error occured
*/
double zathura_page_get_width(zathura_page_t* page);
/**
* Sets the new width of the page
*
* @param page The page object
* @param width The new width of the page
*/
void zathura_page_set_width(zathura_page_t* page, double width);
/**
* Returns the height of the page
*
* @param page The page object
* @return Height of the page
* @return -1 If an error occured
*/
double zathura_page_get_height(zathura_page_t* page);
/**
* Sets the new height of the page
*
* @param page The page object
* @param height The new height of the page
*/
void zathura_page_set_height(zathura_page_t* page, double height);
/**
* Returns the visibility of the page
*
* @param page The page object
* @return true if the page is visible
* @return false if the page is hidden
*/
bool zathura_page_get_visibility(zathura_page_t* page);
/**
* Sets the visibility of the page
*
* @param page The page object
* @param visibility The new visibility value
*/
void zathura_page_set_visibility(zathura_page_t* page, bool visibility);
/**
* Returns the custom data
*
* @param page The page object
* @return The custom data or NULL
*/
void* zathura_page_get_data(zathura_page_t* page);
/**
* Sets the custom data
*
* @param page The page object
* @param data The custom data
*/
void zathura_page_set_data(zathura_page_t* page, void* data);
/**
* Search page
*
* @param page The page object
* @param text Search item
2012-03-27 13:30:04 +02:00
* @param error Set to an error value (see \ref zathura_error_t) if an
2012-03-26 14:44:56 +02:00
* error occured
* @return List of results
*/
2012-03-27 13:30:04 +02:00
girara_list_t* zathura_page_search_text(zathura_page_t* page, const char* text, zathura_error_t* error);
2012-03-26 14:44:56 +02:00
/**
* Get page links
*
* @param page The page object
2012-03-27 13:30:04 +02:00
* @param error Set to an error value (see \ref zathura_error_t) if an
2012-03-26 14:44:56 +02:00
* error occured
* @return List of links
*/
2012-03-27 13:30:04 +02:00
girara_list_t* zathura_page_links_get(zathura_page_t* page, zathura_error_t* error);
2012-03-26 14:44:56 +02:00
/**
* Free page links
*
* @param list List of links
2012-03-27 13:30:04 +02:00
* @return ZATHURA_ERROR_OK when no error occured, otherwise see
* zathura_error_t
2012-03-26 14:44:56 +02:00
*/
2012-03-27 13:30:04 +02:00
zathura_error_t zathura_page_links_free(girara_list_t* list);
2012-03-26 14:44:56 +02:00
/**
* Get list of form fields
*
* @param page The page object
2012-03-27 13:30:04 +02:00
* @param error Set to an error value (see \ref zathura_error_t) if an
2012-03-26 14:44:56 +02:00
* error occured
* @return List of form fields
*/
2012-03-27 13:30:04 +02:00
girara_list_t* zathura_page_form_fields_get(zathura_page_t* page, zathura_error_t* error);
2012-03-26 14:44:56 +02:00
/**
* Free list of form fields
*
* @param list List of form fields
2012-03-27 13:30:04 +02:00
* @return ZATHURA_ERROR_OK when no error occured, otherwise see
* zathura_error_t
2012-03-26 14:44:56 +02:00
*/
2012-03-27 13:30:04 +02:00
zathura_error_t zathura_page_form_fields_free(girara_list_t* list);
2012-03-26 14:44:56 +02:00
/**
* Get list of images
*
* @param page Page
2012-03-27 13:30:04 +02:00
* @param error Set to an error value (see \ref zathura_error_t) if an
2012-03-26 14:44:56 +02:00
* error occured
* @return List of images or NULL if an error occured
*/
2012-03-27 13:30:04 +02:00
girara_list_t* zathura_page_images_get(zathura_page_t* page, zathura_error_t* error);
2012-03-26 14:44:56 +02:00
/**
* Get image
*
* @param page Page
* @param image Image identifier
2012-03-27 13:30:04 +02:00
* @param error Set to an error value (see \ref zathura_error_t) if an
2012-03-26 14:44:56 +02:00
* error occured
* @return The cairo image surface or NULL if an error occured
*/
2012-03-27 13:30:04 +02:00
cairo_surface_t* zathura_page_image_get_cairo(zathura_page_t* page, zathura_image_t* image, zathura_error_t* error);
2012-03-26 14:44:56 +02:00
/**
* Get text for selection
* @param page Page
* @param rectangle Selection
2012-03-27 13:30:04 +02:00
* @param error Set to an error value (see \ref zathura_error_t) if an error
2012-03-26 14:44:56 +02:00
* occured
* @return The selected text (needs to be deallocated with g_free)
*/
2012-03-27 13:30:04 +02:00
char* zathura_page_get_text(zathura_page_t* page, zathura_rectangle_t rectangle, zathura_error_t* error);
2012-03-26 14:44:56 +02:00
/**
* Render page
*
* @param page The page object
* @param cairo Cairo object
* @param printing render for printing
2012-03-27 13:30:04 +02:00
* @return ZATHURA_ERROR_OK when no error occured, otherwise see
* zathura_error_t
2012-03-26 14:44:56 +02:00
*/
2012-03-27 13:30:04 +02:00
zathura_error_t zathura_page_render(zathura_page_t* page, cairo_t* cairo, bool printing);
2012-03-26 14:44:56 +02:00
#endif // PAGE_H