Changeset 158
- Timestamp:
- 05/09/06 13:46:38 (2 years ago)
- Location:
- trunk
- Files:
-
- 9 modified
-
src/DocumentRectangle.cxx (modified) (5 diffs)
-
src/DocumentRectangle.h (modified) (1 diff)
-
src/FindPter.cxx (modified) (3 diffs)
-
src/FindPter.h (modified) (1 diff)
-
src/JobFind.cxx (modified) (20 diffs)
-
src/JobFind.h (modified) (3 diffs)
-
tests/DumbDocument.cxx (modified) (1 diff)
-
tests/DumbDocument.h (modified) (1 diff)
-
tests/Makefile.am (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/DocumentRectangle.cxx
r155 r158 20 20 using namespace ePDFView; 21 21 22 /// 23 /// @brief Constructs a new rectangle. 24 /// 25 /// @param x1 The X coordinate of the rectangle's top-left corner. 26 /// @param y1 The Y coordinate of the rectangle's top-left corner. 27 /// @param x2 The X coordinate of the rectangle's bottom-right corner. 28 /// @param y2 The Y coordinate of the rectangle's bottom-right corner. 29 /// 22 30 DocumentRectangle::DocumentRectangle (gdouble x1, gdouble y1, 23 31 gdouble x2, gdouble y2) … … 29 37 } 30 38 39 /// 40 /// @brief Destroys all dynamically allocated memory for DocumentRectangle. 41 /// 31 42 DocumentRectangle::~DocumentRectangle () 32 43 { 33 44 } 34 45 46 /// 47 /// @brief Gets the top-left corner X coordinates. 48 /// 49 /// @return The X coordinates of the rectangle's top-left corner. 50 /// 35 51 gdouble 36 52 DocumentRectangle::getX1 () … … 39 55 } 40 56 57 /// 58 /// @brief Gets the bottom-right corner X coordinates. 59 /// 60 /// @return The X coordinates of the rectangle's bottom-right corner. 61 /// 41 62 gdouble 42 63 DocumentRectangle::getX2 () … … 45 66 } 46 67 68 /// 69 /// @brief Gets the top-left corner Y coordinates. 70 /// 71 /// @return The Y coordinates of the rectangle's top-left corner. 72 /// 47 73 gdouble 48 74 DocumentRectangle::getY1 () … … 51 77 } 52 78 79 /// 80 /// @brief Gets the right-bottom corner Y coordinates. 81 /// 82 /// @return The Y coordinates of the rectangle's bottom-right corner. 83 /// 53 84 gdouble 54 85 DocumentRectangle::getY2 () -
trunk/src/DocumentRectangle.h
r155 r158 21 21 namespace ePDFView 22 22 { 23 /// 24 /// @class DocumentRectangle. 25 /// @brief A rectangle on a page. 26 /// 27 /// This class is just to hold the coordinates of a rectangle on a document. 28 /// It is used as a way to know where are the document's link or the 29 /// text that has been searched. 30 /// 23 31 class DocumentRectangle 24 32 { -
trunk/src/FindPter.cxx
r157 r158 98 98 } 99 99 100 /// 101 /// @brief Deletes all saved results. 102 /// 100 103 void 101 104 FindPter::freeFindResults () … … 124 127 } 125 128 129 /// 130 /// @brief The find has searched on all pages. 131 /// 126 132 void 127 133 FindPter::notifyFindFinished (void) … … 144 150 } 145 151 152 /// 153 /// @brief The find found results. 154 /// 155 /// @param pageNum The number of the page that found results. 156 /// @oaram results The results that found. 157 /// @param direction The direction it was searching pages when found results. 158 /// 146 159 void 147 160 FindPter::notifyFindResults (gint pageNum, GList *results, -
trunk/src/FindPter.h
r157 r158 26 26 /// 27 27 /// @class FindPter 28 /// @brief Find dialogspresenter.28 /// @brief Find bar presenter. 29 29 /// 30 /// This presenter is the controlling class of the find dialogand30 /// This presenter is the controlling class of the find bar and 31 31 /// the find next / previous functionality. 32 32 /// -
trunk/src/JobFind.cxx
r157 r158 26 26 static gboolean job_find_results (gpointer data); 27 27 28 /// 29 /// @brief Constructs a new JobFind object. 30 /// 28 31 JobFind::JobFind () 29 32 { … … 39 42 } 40 43 44 /// 45 /// @brief Deletes all dynamically allocated memory for JobFind. 46 /// 41 47 JobFind::~JobFind () 42 48 { … … 44 50 } 45 51 52 /// 53 /// @brief Cancels the job. 54 /// 55 /// The next time the job enters the queue, it won't do anything and 56 /// will be deleted. 57 /// 46 58 void 47 59 JobFind::cancel () … … 52 64 } 53 65 66 /// 67 /// @brief Gets the page to look the text at. 68 /// 69 /// @return The page to search for the text. 70 /// 54 71 gint 55 72 JobFind::getCurrentPage (void) … … 58 75 } 59 76 77 /// 78 /// @brief Gets the direction to continue searching. 79 /// 80 /// This function will tell if check for the next or the previous page the 81 /// next time the job is added in the queue. 82 /// 83 /// @return FIND_DIRECTION_FORWARD to look at the next page or 84 /// FIND_DIRECTION_BACKWARDS to look at the previous page. 85 /// 60 86 FindDirection 61 87 JobFind::getDirection () … … 64 90 } 65 91 92 /// 93 /// @brief Gets the document to look for the text at. 94 /// 95 /// @return The document to search the text on. 96 /// 66 97 IDocument * 67 98 JobFind::getDocument () … … 70 101 } 71 102 103 /// 104 /// @brief Gets the presenter to notify when the find changes. 105 /// 106 /// @return The FindPter to notify about find state's changes. 107 /// 72 108 FindPter * 73 109 JobFind::getFindPter () … … 76 112 } 77 113 114 /// 115 /// @brief The search's last results. 116 /// 117 /// @return The list of results from a page. 118 /// 78 119 GList * 79 120 JobFind::getResults () … … 82 123 } 83 124 125 /// 126 /// @brief Gets the page number the results belongs to. 127 /// 128 /// @return The number of the page the list of resutls returned by 129 /// getResults() belongs to. 130 /// 84 131 gint 85 132 JobFind::getResultsPage () … … 88 135 } 89 136 137 /// 138 /// @brief Gets the first page that has been checked. 139 /// 140 /// @return The number of the first page where the find started. 141 /// 90 142 gint 91 143 JobFind::getStartingPage () … … 94 146 } 95 147 148 /// 149 /// @brief Gets the text to find in the document. 150 /// 151 /// @return The text to find. 152 /// 96 153 const gchar * 97 154 JobFind::getTextToFind () … … 100 157 } 101 158 159 /// 160 /// @brief Checks if the job is canceled. 161 /// 162 /// @return TRUE if the job is canceled, FALSE otherwise. 163 /// 102 164 gboolean 103 165 JobFind::isCanceled () … … 147 209 } 148 210 149 211 /// 212 /// @brief Sets the current page to find the text to. 213 /// 214 /// @param pageNum The number of the page to set as the current page. 215 /// 150 216 void 151 217 JobFind::setCurrentPage (gint pageNum) … … 164 230 } 165 231 232 /// 233 /// @brief Sets the direction to continue the find. 234 /// 235 /// @param direction The direction to continue the find. 236 /// 166 237 void 167 238 JobFind::setDirection (FindDirection direction) … … 170 241 } 171 242 243 /// 244 /// @brief Sets the document to find the text to. 245 /// 246 /// @param document The document to search for the text to. 247 /// 172 248 void 173 249 JobFind::setDocument (IDocument *document) … … 178 254 } 179 255 256 /// 257 /// @brief Sets the presenter that will receive the notifications. 258 /// 259 /// @param pter The presenter that will receive the notifications of changes. 260 /// 180 261 void 181 262 JobFind::setFindPter (FindPter *pter) … … 186 267 } 187 268 269 /// 270 /// @brief Sets the find's results. 271 /// 272 /// @param pageNum The number of the page the results belongs to. 273 /// @param results The results of the search of the text in @a pageNum. 274 /// 188 275 void 189 276 JobFind::setResults (gint pageNum, GList *results) … … 195 282 } 196 283 284 /// 285 /// @brief Sets the find's starting page. 286 /// 287 /// @param pageNum The number of the page where the find starts. 288 /// 197 289 void 198 290 JobFind::setStartingPage (gint pageNum) … … 202 294 } 203 295 296 /// 297 /// @brief Sets the text to find. 298 /// 299 /// @param textToFind The text to find in the document. 300 /// 204 301 void 205 302 JobFind::setTextToFind (const gchar *textToFind) … … 225 322 } 226 323 324 /// 325 /// @brief The last checked page had results. 326 /// 327 /// This is called when the recently checked page had results. 328 /// 329 /// @param data A pointer to the job that called this callback. 330 /// 227 331 gboolean 228 332 job_find_results (gpointer data) -
trunk/src/JobFind.h
r157 r158 27 27 /// @brief The search direction. 28 28 /// 29 typedef enum 29 typedef enum _FindDirection 30 30 { 31 31 /// Search forwards. … … 34 34 FIND_DIRECTION_BACKWARDS 35 35 } FindDirection; 36 36 37 /// 38 /// @class JobFind 39 /// @brief A background job that finds text on the document. 40 /// 37 41 class JobFind: public IJob 38 42 { … … 61 65 62 66 protected: 67 /// Tells if the job has been canceled. 63 68 gboolean m_Canceled; 69 /// The current page to search the text. 64 70 gint m_CurrentPage; 71 /// The next page to look for the text: the next or the previous. 65 72 FindDirection m_Direction; 73 /// The document to seach the text from. 66 74 IDocument *m_Document; 75 /// The presenter to tell when a change happens. 67 76 FindPter *m_FindPter; 77 /// The search results of a page. 68 78 GList *m_Results; 79 /// The page number where m_Results belongs to. 69 80 gint m_ResultsPage; 81 /// The starting page of the search. 70 82 gint m_StartingPage; 83 /// The search to find on the document. 71 84 gchar *m_TextToFind; 72 85 }; -
trunk/tests/DumbDocument.cxx
r128 r158 38 38 clearCache (); 39 39 g_free (m_TestPassword); 40 } 41 42 GList * 43 DumbDocument::findTextInPage (gint pageNum, const gchar *textToFind) 44 { 45 return NULL; 40 46 } 41 47 -
trunk/tests/DumbDocument.h
r120 r158 28 28 29 29 // Interface methods. 30 GList *findTextInPage (gint pageNum, const gchar *text); 30 31 gboolean isLoaded (void); 31 32 gboolean loadFile (const gchar *filename, const gchar *password, -
trunk/tests/Makefile.am
r156 r158 7 7 test_encrypted.pdf 8 8 9 test_epdfview_SOURCES = \10 ConfigTest.cxx \11 ConfigTest.h \9 test_epdfview_SOURCES = \ 10 ConfigTest.cxx \ 11 ConfigTest.h \ 12 12 DocumentOutlineTest.cxx \ 13 13 DocumentOutlineTest.h \ 14 DumbDocument.cxx \15 DumbDocument.h \14 DumbDocument.cxx \ 15 DumbDocument.h \ 16 16 DumbDocumentObserver.cxx \ 17 17 DumbDocumentObserver.h \ 18 18 DumbFindView.cxx \ 19 19 DumbFindView.h \ 20 DumbMainView.cxx \21 DumbMainView.h \20 DumbMainView.cxx \ 21 DumbMainView.h \ 22 22 DumbPageView.cxx \ 23 23 DumbPageView.h \ 24 24 FindPterTest.cxx \ 25 25 FindPterTest.h \ 26 main.cxx \ 27 Utils.cxx \ 26 main.cxx \ 27 MainPterTest.cxx \ 28 MainPterTest.h \ 29 PagePterTest.cxx \ 30 PagePterTest.h \ 31 PDFDocumentTest.cxx \ 32 PDFDocumentTest.h \ 33 Utils.cxx \ 28 34 Utils.h 29 35 30 # MainPterTest.cxx31 # MainPterTest.h32 # PagePterTest.cxx33 # PagePterTest.h34 # PDFDocumentTest.cxx35 # PDFDocumentTest.h36 36 37 37 test_epdfview_CXXFLAGS = \
