Changeset 158

Show
Ignore:
Timestamp:
05/09/06 13:46:38 (2 years ago)
Author:
jordi
Message:

Added the missing comments for the new functionality.

Location:
trunk
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/DocumentRectangle.cxx

    r155 r158  
    2020using namespace ePDFView; 
    2121 
     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/// 
    2230DocumentRectangle::DocumentRectangle (gdouble x1, gdouble y1, 
    2331                                      gdouble x2, gdouble y2) 
     
    2937} 
    3038 
     39/// 
     40/// @brief Destroys all dynamically allocated memory for DocumentRectangle. 
     41/// 
    3142DocumentRectangle::~DocumentRectangle () 
    3243{ 
    3344} 
    3445 
     46/// 
     47/// @brief Gets the top-left corner X coordinates. 
     48/// 
     49/// @return The X coordinates of the rectangle's top-left corner. 
     50/// 
    3551gdouble 
    3652DocumentRectangle::getX1 () 
     
    3955} 
    4056 
     57/// 
     58/// @brief Gets the bottom-right corner X coordinates. 
     59/// 
     60/// @return The X coordinates of the rectangle's bottom-right corner. 
     61/// 
    4162gdouble 
    4263DocumentRectangle::getX2 () 
     
    4566} 
    4667 
     68/// 
     69/// @brief Gets the top-left corner Y coordinates. 
     70/// 
     71/// @return The Y coordinates of the rectangle's top-left corner. 
     72/// 
    4773gdouble 
    4874DocumentRectangle::getY1 () 
     
    5177} 
    5278 
     79/// 
     80/// @brief Gets the right-bottom corner Y coordinates. 
     81/// 
     82/// @return The Y coordinates of the rectangle's bottom-right corner. 
     83/// 
    5384gdouble 
    5485DocumentRectangle::getY2 () 
  • trunk/src/DocumentRectangle.h

    r155 r158  
    2121namespace ePDFView 
    2222{ 
     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    /// 
    2331    class DocumentRectangle 
    2432    { 
  • trunk/src/FindPter.cxx

    r157 r158  
    9898} 
    9999 
     100/// 
     101/// @brief Deletes all saved results. 
     102/// 
    100103void 
    101104FindPter::freeFindResults () 
     
    124127} 
    125128 
     129/// 
     130/// @brief The find has searched on all pages. 
     131/// 
    126132void 
    127133FindPter::notifyFindFinished (void) 
     
    144150} 
    145151 
     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/// 
    146159void 
    147160FindPter::notifyFindResults (gint pageNum, GList *results,  
  • trunk/src/FindPter.h

    r157 r158  
    2626    /// 
    2727    /// @class FindPter 
    28     /// @brief Find dialogs presenter. 
     28    /// @brief Find bar presenter. 
    2929    /// 
    30     /// This presenter is the controlling class of the find dialog and 
     30    /// This presenter is the controlling class of the find bar and 
    3131    /// the find next / previous functionality. 
    3232    /// 
  • trunk/src/JobFind.cxx

    r157 r158  
    2626static gboolean job_find_results (gpointer data); 
    2727 
     28/// 
     29/// @brief Constructs a new JobFind object. 
     30/// 
    2831JobFind::JobFind () 
    2932{ 
     
    3942} 
    4043 
     44/// 
     45/// @brief Deletes all dynamically allocated memory for JobFind. 
     46/// 
    4147JobFind::~JobFind () 
    4248{ 
     
    4450} 
    4551 
     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/// 
    4658void 
    4759JobFind::cancel () 
     
    5264} 
    5365 
     66/// 
     67/// @brief Gets the page to look the text at. 
     68/// 
     69/// @return The page to search for the text. 
     70/// 
    5471gint 
    5572JobFind::getCurrentPage (void) 
     
    5875} 
    5976 
     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/// 
    6086FindDirection 
    6187JobFind::getDirection () 
     
    6490} 
    6591 
     92/// 
     93/// @brief Gets the document to look for the text at. 
     94/// 
     95/// @return The document to search the text on. 
     96/// 
    6697IDocument * 
    6798JobFind::getDocument () 
     
    70101} 
    71102 
     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/// 
    72108FindPter * 
    73109JobFind::getFindPter () 
     
    76112} 
    77113 
     114/// 
     115/// @brief The search's last results. 
     116/// 
     117/// @return The list of results from a page. 
     118/// 
    78119GList * 
    79120JobFind::getResults () 
     
    82123} 
    83124 
     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/// 
    84131gint 
    85132JobFind::getResultsPage () 
     
    88135} 
    89136 
     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/// 
    90142gint 
    91143JobFind::getStartingPage () 
     
    94146} 
    95147 
     148/// 
     149/// @brief Gets the text to find in the document. 
     150/// 
     151/// @return The text to find. 
     152/// 
    96153const gchar * 
    97154JobFind::getTextToFind () 
     
    100157} 
    101158 
     159/// 
     160/// @brief Checks if the job is canceled. 
     161/// 
     162/// @return TRUE if the job is canceled, FALSE otherwise. 
     163/// 
    102164gboolean 
    103165JobFind::isCanceled () 
     
    147209} 
    148210 
    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/// 
    150216void 
    151217JobFind::setCurrentPage (gint pageNum) 
     
    164230} 
    165231 
     232/// 
     233/// @brief Sets the direction to continue the find. 
     234/// 
     235/// @param direction The direction to continue the find. 
     236/// 
    166237void 
    167238JobFind::setDirection (FindDirection direction) 
     
    170241} 
    171242 
     243/// 
     244/// @brief Sets the document to find the text to. 
     245/// 
     246/// @param document The document to search for the text to. 
     247/// 
    172248void 
    173249JobFind::setDocument (IDocument *document) 
     
    178254} 
    179255 
     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/// 
    180261void 
    181262JobFind::setFindPter (FindPter *pter) 
     
    186267} 
    187268 
     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/// 
    188275void 
    189276JobFind::setResults (gint pageNum, GList *results) 
     
    195282} 
    196283 
     284/// 
     285/// @brief Sets the find's starting page. 
     286/// 
     287/// @param pageNum The number of the page where the find starts. 
     288/// 
    197289void 
    198290JobFind::setStartingPage (gint pageNum) 
     
    202294} 
    203295 
     296/// 
     297/// @brief Sets the text to find. 
     298/// 
     299/// @param textToFind The text to find in the document. 
     300/// 
    204301void 
    205302JobFind::setTextToFind (const gchar *textToFind) 
     
    225322} 
    226323 
     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/// 
    227331gboolean 
    228332job_find_results (gpointer data) 
  • trunk/src/JobFind.h

    r157 r158  
    2727    /// @brief The search direction. 
    2828    /// 
    29     typedef enum 
     29    typedef enum _FindDirection 
    3030    { 
    3131        /// Search forwards. 
     
    3434        FIND_DIRECTION_BACKWARDS 
    3535    } FindDirection; 
    36      
     36    
     37    /// 
     38    /// @class JobFind 
     39    /// @brief A background job that finds text on the document. 
     40    /// 
    3741    class JobFind: public IJob 
    3842    { 
     
    6165 
    6266        protected: 
     67            /// Tells if the job has been canceled. 
    6368            gboolean m_Canceled; 
     69            /// The current page to search the text. 
    6470            gint m_CurrentPage; 
     71            /// The next page to look for the text: the next or the previous. 
    6572            FindDirection m_Direction; 
     73            /// The document to seach the text from. 
    6674            IDocument *m_Document; 
     75            /// The presenter to tell when a change happens. 
    6776            FindPter *m_FindPter; 
     77            /// The search results of a page. 
    6878            GList *m_Results; 
     79            /// The page number where m_Results belongs to. 
    6980            gint m_ResultsPage; 
     81            /// The starting page of the search. 
    7082            gint m_StartingPage; 
     83            /// The search to find on the document. 
    7184            gchar *m_TextToFind; 
    7285    }; 
  • trunk/tests/DumbDocument.cxx

    r128 r158  
    3838    clearCache (); 
    3939    g_free (m_TestPassword); 
     40} 
     41 
     42GList * 
     43DumbDocument::findTextInPage (gint pageNum, const gchar *textToFind) 
     44{ 
     45    return NULL; 
    4046} 
    4147 
  • trunk/tests/DumbDocument.h

    r120 r158  
    2828 
    2929            // Interface methods. 
     30            GList *findTextInPage (gint pageNum, const gchar *text); 
    3031            gboolean isLoaded (void); 
    3132            gboolean loadFile (const gchar *filename, const gchar *password, 
  • trunk/tests/Makefile.am

    r156 r158  
    77    test_encrypted.pdf 
    88 
    9 test_epdfview_SOURCES =     \ 
    10     ConfigTest.cxx          \ 
    11     ConfigTest.h            \ 
     9test_epdfview_SOURCES = \ 
     10    ConfigTest.cxx  \ 
     11    ConfigTest.h    \ 
    1212    DocumentOutlineTest.cxx \ 
    1313    DocumentOutlineTest.h   \ 
    14     DumbDocument.cxx        \ 
    15     DumbDocument.h          \ 
     14    DumbDocument.cxx    \ 
     15    DumbDocument.h  \ 
    1616    DumbDocumentObserver.cxx    \ 
    1717    DumbDocumentObserver.h  \ 
    1818    DumbFindView.cxx    \ 
    1919    DumbFindView.h  \ 
    20     DumbMainView.cxx        \ 
    21     DumbMainView.h          \ 
     20    DumbMainView.cxx    \ 
     21    DumbMainView.h  \ 
    2222    DumbPageView.cxx    \ 
    2323    DumbPageView.h  \ 
    2424    FindPterTest.cxx    \ 
    2525    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   \ 
    2834    Utils.h 
    2935 
    30 #   MainPterTest.cxx 
    31 #   MainPterTest.h 
    32 #   PagePterTest.cxx 
    33 #   PagePterTest.h 
    34 #   PDFDocumentTest.cxx 
    35 #   PDFDocumentTest.h 
    3636 
    3737test_epdfview_CXXFLAGS =                        \