root/trunk/src/FindPter.h

Revision 167, 2.3 kB (checked in by jordi, 2 years ago)

Fixed a problem when typing too fast the text to find in the find bar that crashed the application.

Renamed the IJob::queue() function to IJob::enqueue().

Line 
1 // ePDFView - A lightweight PDF Viewer.
2 // Copyright (C) 2006 Emma's Software.
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18 #if !defined (__FIND_PTER_H__)
19 #define __FIND_PTER_H__
20
21 namespace ePDFView
22 {
23     // Forward declarations.
24     class JobFind;
25
26     ///
27     /// @class FindPter
28     /// @brief Find bar presenter.
29     ///
30     /// This presenter is the controlling class of the find bar and
31     /// the find next / previous functionality.
32     ///
33     class FindPter
34     {
35         public:
36             FindPter (IDocument *document);
37             ~FindPter (void);
38
39             void closeActivated (void);
40             void findNextActivated (void);
41             void findPreviousActivated (void);
42             IFindView &getView (void);
43             void notifyFindFinished (gboolean endOfSearch);
44             void notifyFindResults (gint pageNum, GList *results,
45                                     FindDirection direction);
46             void setView (IFindView *view);
47             void textToFindChanged (void);
48
49         protected:
50             /// The current selected match from m_FindResults.
51             GList *m_CurrentMatch;
52             /// The document to search to.
53             IDocument *m_Document;
54             /// The current page that we found something.
55             gint m_FindPage;
56             /// The results on m_FindPage.
57             GList *m_FindResults;
58             /// The current find job.
59             JobFind *m_Job;
60             /// The view that the presenter is controlling.
61             IFindView *m_View;
62
63             void cancelJob (void);
64             void freeFindResults (void);
65     };
66 }
67
68 #endif // !__FIND_PTER_H__
Note: See TracBrowser for help on using the browser.