Changeset 49 for trunk/src/IDocument.h
- Timestamp:
- 04/13/06 05:47:01 (3 years ago)
- Files:
-
- 1 modified
-
trunk/src/IDocument.h (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/IDocument.h
r22 r49 35 35 /// Couldn't open the PDF file. 36 36 DocumentErrorOpenFile = 1, 37 /// Cou dln't read the page catalog.37 /// Couldn't read the page catalog. 38 38 DocumentErrorBadCatalog = 2, 39 39 /// PDF file is damaged and couldn't be repaired. … … 66 66 PageModeOC, 67 67 PageModeAttach, 68 // Not yet defined.68 /// Not set yet. 69 69 PageModeUnset 70 70 } PageMode; … … 81 81 PageLayoutTwoPageLeft, 82 82 PageLayoutTwoPageRight, 83 // Not yet defined.83 // Not set yet. 84 84 PageLayoutUnset 85 85 } PageLayout; 86 86 87 87 /// 88 /// @class Document 89 /// @brief Has information about a single document. 90 /// 91 /// Every PDF handled by the application is represented as a Document 92 /// class. All information about the document, number of pages, current 93 /// page, etc. is inside this class. 88 /// @class IDocument 89 /// @brief Interface for documents. 90 /// 91 /// Every document type that the application can handle must be 92 /// created from this base class. 93 /// Besides the abstracts methods for open a document, this class also 94 /// handles the rotation and zoom levels for any IDocument's child class. 94 95 /// 95 96 class IDocument … … 98 99 virtual ~IDocument (void); 99 100 101 /// 102 /// @brief Checks if the document has been loaded. 103 /// 104 /// @return TRUE if the document has been loaded or FALSE otherwise. 105 /// 100 106 virtual gboolean isLoaded (void) = 0; 107 108 /// 109 /// @brief Load a document file. 110 /// 111 /// Tries to open the document file @a filename using @a password 112 /// as a password to decrypt the document. 113 /// 114 /// The rotation degree is reset to 0 and the scale level to 1.0f 115 /// 116 /// @param filename The path, absolute or relative, to the flame 117 /// to open. 118 /// @param password The password to use to decrypt @a filename. If 119 /// the file is not encrypted, you can set it to 120 /// NULL. 121 /// @param error Location to store any error that could happen or 122 /// set to NULL to ignore errors. 123 /// 124 /// @return TRUE if the file could be opened. FALSE otherwise. 125 /// 101 126 virtual gboolean loadFile (const gchar *filename, 102 127 const gchar *password, 103 128 GError **error) = 0; 129 /// 130 /// @brief Gets the current page's unscaled size. 131 /// 132 /// Retrieves the width and height of the current page before 133 /// scaling, but after rotate it. 134 /// 135 /// @param width The location to save the page's width. 136 /// @param height The location to save the page's height. 137 /// 138 virtual void getPageSize (gdouble *width, gdouble *height) = 0; 139 140 /// 141 /// @brief Renders the current page. 142 /// 143 /// Rendering the current page means to get the pixels for the 144 /// current page image given the current rotation and scale level. 145 /// 146 /// @return A DocumentPage with the image. The returned page must 147 /// be freed by calling delete when done with it. 148 /// 149 virtual DocumentPage *renderPage (void) = 0; 150 151 104 152 const gchar *getTitle (void); 105 153 void setTitle (const gchar *title); … … 121 169 void setLinearized (gboolean linearized); 122 170 const gchar *getCreationDate (void); 123 void setCreationDate (const char *date);171 void setCreationDate (const gchar *date); 124 172 const gchar *getModifiedDate (void); 125 173 void setModifiedDate (const gchar *date); … … 133 181 DocumentIndex &getDocumentIndex (void); 134 182 135 void goToFirstPage ( );136 void goToLastPage ( );137 void goToNextPage ( );183 void goToFirstPage (void); 184 void goToLastPage (void); 185 void goToNextPage (void); 138 186 void goToPage (gint pageNum); 139 void goToPreviousPage ( );187 void goToPreviousPage (void); 140 188 141 189 gint getRotation (void); … … 150 198 void zoomToFit (gint width, gint height); 151 199 void zoomToWidth (gint width); 152 153 virtual void getPageSize (gdouble *width, gdouble *height) = 0;154 virtual DocumentPage *renderPage (void) = 0;155 200 156 201 static GQuark getErrorQuark (void);
