author | sandman <sandman> | 2002-10-06 03:10:40 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-06 03:10:40 (UTC) |
commit | b9cbdf51e961eb51ea60fc81de7dc9bb1023545e (patch) (unidiff) | |
tree | ecfe3f7bae3d05169ab48ed6a88f2b1caae093d1 | |
parent | 56276f60d5dd404c3cd8a65003faf75b289f1131 (diff) | |
download | opie-b9cbdf51e961eb51ea60fc81de7dc9bb1023545e.zip opie-b9cbdf51e961eb51ea60fc81de7dc9bb1023545e.tar.gz opie-b9cbdf51e961eb51ea60fc81de7dc9bb1023545e.tar.bz2 |
- uses OFileSelector now
- menu/toolbars are now QPE variants
-rw-r--r-- | noncore/unsupported/qpdf/qpdf.cpp | 10 | ||||
-rw-r--r-- | noncore/unsupported/qpdf/qpdf.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/noncore/unsupported/qpdf/qpdf.cpp b/noncore/unsupported/qpdf/qpdf.cpp index f338509..e78f081 100644 --- a/noncore/unsupported/qpdf/qpdf.cpp +++ b/noncore/unsupported/qpdf/qpdf.cpp | |||
@@ -1,540 +1,540 @@ | |||
1 | //======================================================================== | 1 | //======================================================================== |
2 | // | 2 | // |
3 | // qpdf.cc | 3 | // qpdf.cc |
4 | // | 4 | // |
5 | // Copyright 2001 Robert Griebl | 5 | // Copyright 2001 Robert Griebl |
6 | // | 6 | // |
7 | //======================================================================== | 7 | //======================================================================== |
8 | 8 | ||
9 | #include "aconf.h" | 9 | #include "aconf.h" |
10 | #include "GString.h" | 10 | #include "GString.h" |
11 | #include "PDFDoc.h" | 11 | #include "PDFDoc.h" |
12 | #include "TextOutputDev.h" | 12 | #include "TextOutputDev.h" |
13 | 13 | ||
14 | #include "QPEOutputDev.h" | 14 | #include "QPEOutputDev.h" |
15 | 15 | ||
16 | #include <qpe/qpeapplication.h> | 16 | #include <qpe/qpeapplication.h> |
17 | #include <qpe/resource.h> | 17 | #include <qpe/resource.h> |
18 | #include <qpe/applnk.h> | 18 | #include <qpe/applnk.h> |
19 | #include <qpe/qcopenvelope_qws.h> | 19 | #include <qpe/qcopenvelope_qws.h> |
20 | 20 | ||
21 | 21 | ||
22 | #include <qclipboard.h> | 22 | #include <qclipboard.h> |
23 | #include <qtoolbar.h> | 23 | #include <qpe/qpetoolbar.h> |
24 | #include <qtoolbutton.h> | 24 | #include <qtoolbutton.h> |
25 | #include <qmenubar.h> | 25 | #include <qpe/qpemenubar.h> |
26 | #include <qpopupmenu.h> | 26 | #include <qpopupmenu.h> |
27 | #include <qwidgetstack.h> | 27 | #include <qwidgetstack.h> |
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <qfileinfo.h> | 29 | #include <qfileinfo.h> |
30 | #include <qstring.h> | 30 | #include <qstring.h> |
31 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
32 | #include <qspinbox.h> | 32 | #include <qspinbox.h> |
33 | #include <qlayout.h> | 33 | #include <qlayout.h> |
34 | #include <qdialog.h> | 34 | #include <qdialog.h> |
35 | #include <qlabel.h> | 35 | #include <qlabel.h> |
36 | #include <qmessagebox.h> | 36 | #include <qmessagebox.h> |
37 | 37 | ||
38 | #include "qpdf.h" | 38 | #include "qpdf.h" |
39 | 39 | ||
40 | #ifdef QPDF_QPE_ONLY | 40 | #ifdef QPDF_QPE_ONLY |
41 | #include <qpe/fileselector.h> | 41 | #include <qpe/fileselector.h> |
42 | #else | 42 | #else |
43 | #include <opie/ofileselector.h> | 43 | #include <opie/ofileselector.h> |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | 46 | ||
47 | int main ( int argc, char **argv ) | 47 | int main ( int argc, char **argv ) |
48 | { | 48 | { |
49 | QPEApplication app ( argc, argv ); | 49 | QPEApplication app ( argc, argv ); |
50 | 50 | ||
51 | // read config file | 51 | // read config file |
52 | globalParams = new GlobalParams ( "" ); | 52 | globalParams = new GlobalParams ( "" ); |
53 | globalParams-> setErrQuiet ( true ); | 53 | globalParams-> setErrQuiet ( true ); |
54 | 54 | ||
55 | QPdfDlg *dlg = new QPdfDlg ( ); | 55 | QPdfDlg *dlg = new QPdfDlg ( ); |
56 | app. showMainDocumentWidget ( dlg ); | 56 | app. showMainDocumentWidget ( dlg ); |
57 | 57 | ||
58 | if (( app. argc ( ) == 3 ) && ( app. argv ( ) [1] == QCString ( "-f" ))) | 58 | if (( app. argc ( ) == 3 ) && ( app. argv ( ) [1] == QCString ( "-f" ))) |
59 | dlg-> openFile ( app. argv ( ) [2] ); | 59 | dlg-> openFile ( app. argv ( ) [2] ); |
60 | 60 | ||
61 | return app. exec ( ); | 61 | return app. exec ( ); |
62 | } | 62 | } |
63 | 63 | ||
64 | 64 | ||
65 | QPdfDlg::QPdfDlg ( ) : QMainWindow ( ) | 65 | QPdfDlg::QPdfDlg ( ) : QMainWindow ( ) |
66 | { | 66 | { |
67 | setCaption ( tr( "QPdf" )); | 67 | setCaption ( tr( "QPdf" )); |
68 | setIcon ( Resource::loadPixmap ( "qpdf_icon" )); | 68 | setIcon ( Resource::loadPixmap ( "qpdf_icon" )); |
69 | 69 | ||
70 | m_busy = false; | 70 | m_busy = false; |
71 | 71 | ||
72 | m_doc = 0; | 72 | m_doc = 0; |
73 | m_pages = 0; | 73 | m_pages = 0; |
74 | m_zoom = 72; | 74 | m_zoom = 72; |
75 | m_currentpage = 0; | 75 | m_currentpage = 0; |
76 | 76 | ||
77 | m_fullscreen = false; | 77 | m_fullscreen = false; |
78 | m_renderok = false; | 78 | m_renderok = false; |
79 | 79 | ||
80 | 80 | ||
81 | setToolBarsMovable ( false ); | 81 | setToolBarsMovable ( false ); |
82 | 82 | ||
83 | m_stack = new QWidgetStack ( this ); | 83 | m_stack = new QWidgetStack ( this ); |
84 | m_stack-> setSizePolicy ( QSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding )); | 84 | m_stack-> setSizePolicy ( QSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding )); |
85 | setCentralWidget ( m_stack ); | 85 | setCentralWidget ( m_stack ); |
86 | 86 | ||
87 | m_outdev = new QPEOutputDev ( m_stack ); | 87 | m_outdev = new QPEOutputDev ( m_stack ); |
88 | connect ( m_outdev, SIGNAL( selectionChanged ( const QRect & )), this, SLOT( copyToClipboard ( const QRect & ))); | 88 | connect ( m_outdev, SIGNAL( selectionChanged ( const QRect & )), this, SLOT( copyToClipboard ( const QRect & ))); |
89 | 89 | ||
90 | #ifdef QPDF_QPE_ONLY | 90 | #ifdef QPDF_QPE_ONLY |
91 | m_filesel = new FileSelector ( "application/pdf", m_stack, "fs", false, true ); | 91 | m_filesel = new FileSelector ( "application/pdf", m_stack, "fs", false, true ); |
92 | #else | 92 | #else |
93 | m_filesel = new OFileSelector ( "application/pdf", m_stack, "fs", false, true ); | 93 | m_filesel = new OFileSelector ( "application/pdf", m_stack, "fs", false, true ); |
94 | #endif | 94 | #endif |
95 | 95 | ||
96 | connect ( m_filesel, SIGNAL( closeMe ( )), this, SLOT( closeFileSelector ( ))); | 96 | connect ( m_filesel, SIGNAL( closeMe ( )), this, SLOT( closeFileSelector ( ))); |
97 | connect ( m_filesel, SIGNAL( fileSelected ( const DocLnk & )), this, SLOT( openFile ( const DocLnk & ))); | 97 | connect ( m_filesel, SIGNAL( fileSelected ( const DocLnk & )), this, SLOT( openFile ( const DocLnk & ))); |
98 | 98 | ||
99 | m_tb_menu = new QToolBar ( this ); | 99 | m_tb_menu = new QToolBar ( this ); |
100 | m_tb_menu-> setHorizontalStretchable ( true ); | 100 | m_tb_menu-> setHorizontalStretchable ( true ); |
101 | 101 | ||
102 | QMenuBar *mb = new QMenuBar ( m_tb_menu ); | 102 | QMenuBar *mb = new QPEMenuBar ( m_tb_menu ); |
103 | 103 | ||
104 | m_pm_zoom = new QPopupMenu ( mb ); | 104 | m_pm_zoom = new QPopupMenu ( mb ); |
105 | m_pm_zoom-> setCheckable ( true ); | 105 | m_pm_zoom-> setCheckable ( true ); |
106 | 106 | ||
107 | mb-> insertItem ( tr( "Zoom" ), m_pm_zoom ); | 107 | mb-> insertItem ( tr( "Zoom" ), m_pm_zoom ); |
108 | 108 | ||
109 | m_pm_zoom-> insertItem ( tr( "Fit to width" ), 1 ); | 109 | m_pm_zoom-> insertItem ( tr( "Fit to width" ), 1 ); |
110 | m_pm_zoom-> insertItem ( tr( "Fit to page" ), 2 ); | 110 | m_pm_zoom-> insertItem ( tr( "Fit to page" ), 2 ); |
111 | m_pm_zoom-> insertSeparator ( ); | 111 | m_pm_zoom-> insertSeparator ( ); |
112 | m_pm_zoom-> insertItem ( tr( "50%" ), 50 ); | 112 | m_pm_zoom-> insertItem ( tr( "50%" ), 50 ); |
113 | m_pm_zoom-> insertItem ( tr( "75%" ), 75 ); | 113 | m_pm_zoom-> insertItem ( tr( "75%" ), 75 ); |
114 | m_pm_zoom-> insertItem ( tr( "100%" ), 100 ); | 114 | m_pm_zoom-> insertItem ( tr( "100%" ), 100 ); |
115 | m_pm_zoom-> insertItem ( tr( "125%" ), 125 ); | 115 | m_pm_zoom-> insertItem ( tr( "125%" ), 125 ); |
116 | m_pm_zoom-> insertItem ( tr( "150%" ), 150 ); | 116 | m_pm_zoom-> insertItem ( tr( "150%" ), 150 ); |
117 | m_pm_zoom-> insertItem ( tr( "200%" ), 200 ); | 117 | m_pm_zoom-> insertItem ( tr( "200%" ), 200 ); |
118 | 118 | ||
119 | connect ( m_pm_zoom, SIGNAL( activated ( int )), this, SLOT( setZoom ( int ))); | 119 | connect ( m_pm_zoom, SIGNAL( activated ( int )), this, SLOT( setZoom ( int ))); |
120 | 120 | ||
121 | m_tb_tool = new QToolBar ( this ); | 121 | m_tb_tool = new QPEToolBar ( this ); |
122 | 122 | ||
123 | new QToolButton ( Resource::loadIconSet ( "fileopen" ), tr( "Open..." ), QString::null, this, SLOT( openFile ( )), m_tb_tool, "open" ); | 123 | new QToolButton ( Resource::loadIconSet ( "fileopen" ), tr( "Open..." ), QString::null, this, SLOT( openFile ( )), m_tb_tool, "open" ); |
124 | m_tb_tool-> addSeparator ( ); | 124 | m_tb_tool-> addSeparator ( ); |
125 | m_to_find = new QToolButton ( Resource::loadIconSet ( "find" ), tr( "Find..." ), QString::null, this, SLOT( toggleFindBar ( )), m_tb_tool, "find" ); | 125 | m_to_find = new QToolButton ( Resource::loadIconSet ( "find" ), tr( "Find..." ), QString::null, this, SLOT( toggleFindBar ( )), m_tb_tool, "find" ); |
126 | m_to_find-> setToggleButton ( true ); | 126 | m_to_find-> setToggleButton ( true ); |
127 | m_tb_tool-> addSeparator ( ); | 127 | m_tb_tool-> addSeparator ( ); |
128 | m_to_full = new QToolButton ( Resource::loadIconSet ( "fullscreen" ), tr( "Fullscreen" ), QString::null, this, SLOT( toggleFullscreen ( )), m_tb_tool, "fullscreen" ); | 128 | m_to_full = new QToolButton ( Resource::loadIconSet ( "fullscreen" ), tr( "Fullscreen" ), QString::null, this, SLOT( toggleFullscreen ( )), m_tb_tool, "fullscreen" ); |
129 | m_to_full-> setToggleButton ( true ); | 129 | m_to_full-> setToggleButton ( true ); |
130 | m_tb_tool-> addSeparator ( ); | 130 | m_tb_tool-> addSeparator ( ); |
131 | new QToolButton ( Resource::loadIconSet ( "fastback" ), tr( "First page" ), QString::null, this, SLOT( firstPage ( )), m_tb_tool, "first" ); | 131 | new QToolButton ( Resource::loadIconSet ( "fastback" ), tr( "First page" ), QString::null, this, SLOT( firstPage ( )), m_tb_tool, "first" ); |
132 | new QToolButton ( Resource::loadIconSet ( "back" ), tr( "Previous page" ), QString::null, this, SLOT( prevPage ( )), m_tb_tool, "prev" ); | 132 | new QToolButton ( Resource::loadIconSet ( "back" ), tr( "Previous page" ), QString::null, this, SLOT( prevPage ( )), m_tb_tool, "prev" ); |
133 | new QToolButton ( Resource::loadIconSet ( "down" ), tr( "Goto page..." ), QString::null, this, SLOT( gotoPageDialog ( )), m_tb_tool, "goto" ); | 133 | new QToolButton ( Resource::loadIconSet ( "down" ), tr( "Goto page..." ), QString::null, this, SLOT( gotoPageDialog ( )), m_tb_tool, "goto" ); |
134 | new QToolButton ( Resource::loadIconSet ( "forward" ), tr( "Next page" ), QString::null, this, SLOT( nextPage ( )), m_tb_tool, "next" ); | 134 | new QToolButton ( Resource::loadIconSet ( "forward" ), tr( "Next page" ), QString::null, this, SLOT( nextPage ( )), m_tb_tool, "next" ); |
135 | new QToolButton ( Resource::loadIconSet ( "fastforward" ), tr( "Last page" ), QString::null, this, SLOT( lastPage ( )), m_tb_tool, "last" ); | 135 | new QToolButton ( Resource::loadIconSet ( "fastforward" ), tr( "Last page" ), QString::null, this, SLOT( lastPage ( )), m_tb_tool, "last" ); |
136 | 136 | ||
137 | m_tb_find = new QToolBar ( this ); | 137 | m_tb_find = new QPEToolBar ( this ); |
138 | addToolBar ( m_tb_find, "Search", QMainWindow::Top, true ); | 138 | addToolBar ( m_tb_find, "Search", QMainWindow::Top, true ); |
139 | m_tb_find-> setHorizontalStretchable ( true ); | 139 | m_tb_find-> setHorizontalStretchable ( true ); |
140 | m_tb_find-> hide ( ); | 140 | m_tb_find-> hide ( ); |
141 | 141 | ||
142 | m_findedit = new QLineEdit ( m_tb_find, "findedit" ); | 142 | m_findedit = new QLineEdit ( m_tb_find, "findedit" ); |
143 | m_tb_find-> setStretchableWidget ( m_findedit ); | 143 | m_tb_find-> setStretchableWidget ( m_findedit ); |
144 | connect ( m_findedit, SIGNAL( textChanged ( const QString & )), this, SLOT( findText ( const QString & ))); | 144 | connect ( m_findedit, SIGNAL( textChanged ( const QString & )), this, SLOT( findText ( const QString & ))); |
145 | 145 | ||
146 | new QToolButton ( Resource::loadIconSet ( "next" ), tr( "Next" ), QString::null, this, SLOT( findText ( )), m_tb_find, "findnext" ); | 146 | new QToolButton ( Resource::loadIconSet ( "next" ), tr( "Next" ), QString::null, this, SLOT( findText ( )), m_tb_find, "findnext" ); |
147 | 147 | ||
148 | openFile ( ); | 148 | openFile ( ); |
149 | } | 149 | } |
150 | 150 | ||
151 | QPdfDlg::~QPdfDlg ( ) | 151 | QPdfDlg::~QPdfDlg ( ) |
152 | { | 152 | { |
153 | delete m_doc; | 153 | delete m_doc; |
154 | } | 154 | } |
155 | 155 | ||
156 | // vv Fullscreen handling (for broken QT-lib) [David Hedbor, www.eongames.com] | 156 | // vv Fullscreen handling (for broken QT-lib) [David Hedbor, www.eongames.com] |
157 | 157 | ||
158 | void QPdfDlg::resizeEvent ( QResizeEvent * ) | 158 | void QPdfDlg::resizeEvent ( QResizeEvent * ) |
159 | { | 159 | { |
160 | if ( m_fullscreen && ( size ( ) != qApp-> desktop ( )-> size ( ))) | 160 | if ( m_fullscreen && ( size ( ) != qApp-> desktop ( )-> size ( ))) |
161 | setFullscreen ( true ); | 161 | setFullscreen ( true ); |
162 | } | 162 | } |
163 | 163 | ||
164 | void QPdfDlg::focusInEvent ( QFocusEvent * ) | 164 | void QPdfDlg::focusInEvent ( QFocusEvent * ) |
165 | { | 165 | { |
166 | if ( m_fullscreen ) | 166 | if ( m_fullscreen ) |
167 | setFullscreen ( true ); | 167 | setFullscreen ( true ); |
168 | } | 168 | } |
169 | 169 | ||
170 | void QPdfDlg::toggleFullscreen ( ) | 170 | void QPdfDlg::toggleFullscreen ( ) |
171 | { | 171 | { |
172 | if ( m_to_full-> isOn ( ) == m_fullscreen ) | 172 | if ( m_to_full-> isOn ( ) == m_fullscreen ) |
173 | m_to_full-> setOn ( !m_fullscreen ); | 173 | m_to_full-> setOn ( !m_fullscreen ); |
174 | 174 | ||
175 | m_fullscreen = !m_fullscreen; | 175 | m_fullscreen = !m_fullscreen; |
176 | setFullscreen ( m_fullscreen ); | 176 | setFullscreen ( m_fullscreen ); |
177 | } | 177 | } |
178 | 178 | ||
179 | void QPdfDlg::setFullscreen ( bool b ) | 179 | void QPdfDlg::setFullscreen ( bool b ) |
180 | { | 180 | { |
181 | static QSize normalsize; | 181 | static QSize normalsize; |
182 | 182 | ||
183 | if ( b ) { | 183 | if ( b ) { |
184 | if ( !normalsize. isValid ( )) | 184 | if ( !normalsize. isValid ( )) |
185 | normalsize = size ( ); | 185 | normalsize = size ( ); |
186 | 186 | ||
187 | setFixedSize ( qApp-> desktop ( )-> size ( )); | 187 | setFixedSize ( qApp-> desktop ( )-> size ( )); |
188 | showNormal ( ); | 188 | showNormal ( ); |
189 | reparent ( 0, WStyle_Customize | WStyle_NoBorder, QPoint ( 0, 0 )); | 189 | reparent ( 0, WStyle_Customize | WStyle_NoBorder, QPoint ( 0, 0 )); |
190 | showFullScreen ( ); | 190 | showFullScreen ( ); |
191 | } | 191 | } |
192 | else { | 192 | else { |
193 | showNormal ( ); | 193 | showNormal ( ); |
194 | reparent ( 0, 0, QPoint ( 0, 0 )); | 194 | reparent ( 0, 0, QPoint ( 0, 0 )); |
195 | resize ( normalsize ); | 195 | resize ( normalsize ); |
196 | showMaximized ( ); | 196 | showMaximized ( ); |
197 | normalsize = QSize ( ); | 197 | normalsize = QSize ( ); |
198 | } | 198 | } |
199 | } | 199 | } |
200 | 200 | ||
201 | // ^^ Fullscreen handling (for broken QT-lib) | 201 | // ^^ Fullscreen handling (for broken QT-lib) |
202 | 202 | ||
203 | void QPdfDlg::setBusy ( bool b ) | 203 | void QPdfDlg::setBusy ( bool b ) |
204 | { | 204 | { |
205 | if ( b != m_busy ) { | 205 | if ( b != m_busy ) { |
206 | m_busy = b; | 206 | m_busy = b; |
207 | 207 | ||
208 | m_outdev-> setBusy ( m_busy ); | 208 | m_outdev-> setBusy ( m_busy ); |
209 | setEnabled ( !m_busy ); | 209 | setEnabled ( !m_busy ); |
210 | } | 210 | } |
211 | } | 211 | } |
212 | 212 | ||
213 | bool QPdfDlg::busy ( ) const | 213 | bool QPdfDlg::busy ( ) const |
214 | { | 214 | { |
215 | return m_busy; | 215 | return m_busy; |
216 | } | 216 | } |
217 | 217 | ||
218 | 218 | ||
219 | void QPdfDlg::updateCaption ( ) | 219 | void QPdfDlg::updateCaption ( ) |
220 | { | 220 | { |
221 | QString cap = ""; | 221 | QString cap = ""; |
222 | 222 | ||
223 | if ( !m_currentdoc. isEmpty ( )) | 223 | if ( !m_currentdoc. isEmpty ( )) |
224 | cap = QString ( "%1 - " ). arg ( m_currentdoc ); | 224 | cap = QString ( "%1 - " ). arg ( m_currentdoc ); |
225 | cap += "QPdf"; | 225 | cap += "QPdf"; |
226 | 226 | ||
227 | setCaption ( cap ); | 227 | setCaption ( cap ); |
228 | } | 228 | } |
229 | 229 | ||
230 | 230 | ||
231 | void QPdfDlg::setZoom ( int id ) | 231 | void QPdfDlg::setZoom ( int id ) |
232 | { | 232 | { |
233 | int dpi = 0; | 233 | int dpi = 0; |
234 | 234 | ||
235 | switch ( id ) { | 235 | switch ( id ) { |
236 | case 1: | 236 | case 1: |
237 | if ( m_doc && m_doc-> isOk ( )) | 237 | if ( m_doc && m_doc-> isOk ( )) |
238 | dpi = m_outdev-> visibleWidth ( ) * 72 / m_doc-> getPageWidth ( m_currentpage ); | 238 | dpi = m_outdev-> visibleWidth ( ) * 72 / m_doc-> getPageWidth ( m_currentpage ); |
239 | break; | 239 | break; |
240 | 240 | ||
241 | case 2: | 241 | case 2: |
242 | if ( m_doc && m_doc-> isOk ( )) | 242 | if ( m_doc && m_doc-> isOk ( )) |
243 | dpi = QMIN( m_outdev-> visibleWidth ( ) * 72 / m_doc-> getPageWidth ( m_currentpage ), \ | 243 | dpi = QMIN( m_outdev-> visibleWidth ( ) * 72 / m_doc-> getPageWidth ( m_currentpage ), \ |
244 | m_outdev-> visibleHeight ( ) * 72 / m_doc-> getPageHeight ( m_currentpage )); | 244 | m_outdev-> visibleHeight ( ) * 72 / m_doc-> getPageHeight ( m_currentpage )); |
245 | break; | 245 | break; |
246 | 246 | ||
247 | default: | 247 | default: |
248 | dpi = id * 72 / 100; | 248 | dpi = id * 72 / 100; |
249 | break; | 249 | break; |
250 | } | 250 | } |
251 | 251 | ||
252 | if ( dpi < 18 ) | 252 | if ( dpi < 18 ) |
253 | dpi = 18; | 253 | dpi = 18; |
254 | if ( dpi > 216 ) | 254 | if ( dpi > 216 ) |
255 | dpi = 216; | 255 | dpi = 216; |
256 | 256 | ||
257 | for ( uint i = 0; i < m_pm_zoom-> count ( ); i++ ) { | 257 | for ( uint i = 0; i < m_pm_zoom-> count ( ); i++ ) { |
258 | int xid = m_pm_zoom-> idAt ( i ); | 258 | int xid = m_pm_zoom-> idAt ( i ); |
259 | m_pm_zoom-> setItemChecked ( xid, xid == id ); | 259 | m_pm_zoom-> setItemChecked ( xid, xid == id ); |
260 | } | 260 | } |
261 | 261 | ||
262 | if ( dpi != m_zoom ) { | 262 | if ( dpi != m_zoom ) { |
263 | m_zoom = dpi; | 263 | m_zoom = dpi; |
264 | 264 | ||
265 | renderPage ( ); | 265 | renderPage ( ); |
266 | } | 266 | } |
267 | } | 267 | } |
268 | 268 | ||
269 | 269 | ||
270 | void QPdfDlg::gotoPageDialog ( ) | 270 | void QPdfDlg::gotoPageDialog ( ) |
271 | { | 271 | { |
272 | QDialog *d = new QDialog ( this, "gotodlg", true ); | 272 | QDialog *d = new QDialog ( this, "gotodlg", true ); |
273 | d-> setCaption ( tr( "Goto page" )); | 273 | d-> setCaption ( tr( "Goto page" )); |
274 | 274 | ||
275 | QBoxLayout *lay = new QVBoxLayout ( d, 4, 4 ); | 275 | QBoxLayout *lay = new QVBoxLayout ( d, 4, 4 ); |
276 | 276 | ||
277 | QLabel *l = new QLabel ( tr( "Select from 1 .. %1:" ). arg ( m_pages ), d ); | 277 | QLabel *l = new QLabel ( tr( "Select from 1 .. %1:" ). arg ( m_pages ), d ); |
278 | lay-> addWidget ( l ); | 278 | lay-> addWidget ( l ); |
279 | 279 | ||
280 | QSpinBox *spin = new QSpinBox ( 1, m_pages, 1, d ); | 280 | QSpinBox *spin = new QSpinBox ( 1, m_pages, 1, d ); |
281 | spin-> setValue ( m_currentpage ); | 281 | spin-> setValue ( m_currentpage ); |
282 | spin-> setWrapping ( true ); | 282 | spin-> setWrapping ( true ); |
283 | spin-> setButtonSymbols ( QSpinBox::PlusMinus ); | 283 | spin-> setButtonSymbols ( QSpinBox::PlusMinus ); |
284 | lay-> addWidget ( spin ); | 284 | lay-> addWidget ( spin ); |
285 | 285 | ||
286 | if ( d-> exec ( ) == QDialog::Accepted ) { | 286 | if ( d-> exec ( ) == QDialog::Accepted ) { |
287 | gotoPage ( spin-> value ( )); | 287 | gotoPage ( spin-> value ( )); |
288 | } | 288 | } |
289 | 289 | ||
290 | delete d; | 290 | delete d; |
291 | } | 291 | } |
292 | 292 | ||
293 | void QPdfDlg::toggleFindBar ( ) | 293 | void QPdfDlg::toggleFindBar ( ) |
294 | { | 294 | { |
295 | if ( m_to_find-> isOn ( ) == m_tb_find-> isVisible ( )) | 295 | if ( m_to_find-> isOn ( ) == m_tb_find-> isVisible ( )) |
296 | m_to_find-> setOn ( !m_tb_find-> isVisible ( )); | 296 | m_to_find-> setOn ( !m_tb_find-> isVisible ( )); |
297 | 297 | ||
298 | if ( m_tb_find-> isVisible ( )) { | 298 | if ( m_tb_find-> isVisible ( )) { |
299 | m_tb_find-> hide ( ); | 299 | m_tb_find-> hide ( ); |
300 | m_outdev-> setFocus ( ); | 300 | m_outdev-> setFocus ( ); |
301 | } | 301 | } |
302 | else { | 302 | else { |
303 | m_tb_find-> show ( ); | 303 | m_tb_find-> show ( ); |
304 | m_findedit-> setFocus ( ); | 304 | m_findedit-> setFocus ( ); |
305 | } | 305 | } |
306 | } | 306 | } |
307 | 307 | ||
308 | void QPdfDlg::findText ( const QString &str ) | 308 | void QPdfDlg::findText ( const QString &str ) |
309 | { | 309 | { |
310 | if ( !m_doc || !m_doc-> isOk ( ) || str. isEmpty ( )) | 310 | if ( !m_doc || !m_doc-> isOk ( ) || str. isEmpty ( )) |
311 | return; | 311 | return; |
312 | 312 | ||
313 | TextOutputDev *textOut = 0; | 313 | TextOutputDev *textOut = 0; |
314 | int pg = 0; | 314 | int pg = 0; |
315 | 315 | ||
316 | setBusy ( true ); | 316 | setBusy ( true ); |
317 | 317 | ||
318 | int len = str. length ( ); | 318 | int len = str. length ( ); |
319 | Unicode *u = new Unicode [len]; | 319 | Unicode *u = new Unicode [len]; |
320 | for ( int i = 0; i < len; i++ ) | 320 | for ( int i = 0; i < len; i++ ) |
321 | u [i] = str [i]. unicode ( ); | 321 | u [i] = str [i]. unicode ( ); |
322 | 322 | ||
323 | int xMin = 0, yMin = 0, xMax = 0, yMax = 0; | 323 | int xMin = 0, yMin = 0, xMax = 0, yMax = 0; |
324 | QRect selr = m_outdev-> selection ( ); | 324 | QRect selr = m_outdev-> selection ( ); |
325 | bool fromtop = true; | 325 | bool fromtop = true; |
326 | 326 | ||
327 | if ( selr. isValid ( )) { | 327 | if ( selr. isValid ( )) { |
328 | xMin = selr. right ( ); | 328 | xMin = selr. right ( ); |
329 | yMin = selr. top ( ) + selr. height ( ) / 2; | 329 | yMin = selr. top ( ) + selr. height ( ) / 2; |
330 | fromtop = false; | 330 | fromtop = false; |
331 | } | 331 | } |
332 | 332 | ||
333 | if ( m_outdev-> findText ( u, len, fromtop, true, &xMin, &yMin, &xMax, &yMax )) | 333 | if ( m_outdev-> findText ( u, len, fromtop, true, &xMin, &yMin, &xMax, &yMax )) |
334 | goto found; | 334 | goto found; |
335 | 335 | ||
336 | qApp-> processEvents ( ); | 336 | qApp-> processEvents ( ); |
337 | 337 | ||
338 | // search following pages | 338 | // search following pages |
339 | textOut = new TextOutputDev ( 0, gFalse, gFalse ); | 339 | textOut = new TextOutputDev ( 0, gFalse, gFalse ); |
340 | if ( !textOut-> isOk ( )) | 340 | if ( !textOut-> isOk ( )) |
341 | goto done; | 341 | goto done; |
342 | 342 | ||
343 | qApp-> processEvents ( ); | 343 | qApp-> processEvents ( ); |
344 | 344 | ||
345 | for ( pg = ( m_currentpage % m_pages ) + 1; pg != m_currentpage; pg = ( pg % m_pages ) + 1 ) { | 345 | for ( pg = ( m_currentpage % m_pages ) + 1; pg != m_currentpage; pg = ( pg % m_pages ) + 1 ) { |
346 | m_doc-> displayPage ( textOut, pg, 72, 0, gFalse ); | 346 | m_doc-> displayPage ( textOut, pg, 72, 0, gFalse ); |
347 | 347 | ||
348 | fp_t xMin1, yMin1, xMax1, yMax1; | 348 | fp_t xMin1, yMin1, xMax1, yMax1; |
349 | 349 | ||
350 | qApp-> processEvents ( ); | 350 | qApp-> processEvents ( ); |
351 | 351 | ||
352 | if ( textOut-> findText ( u, len, gTrue, gTrue, &xMin1, &yMin1, &xMax1, &yMax1 )) | 352 | if ( textOut-> findText ( u, len, gTrue, gTrue, &xMin1, &yMin1, &xMax1, &yMax1 )) |
353 | goto foundPage; | 353 | goto foundPage; |
354 | 354 | ||
355 | qApp-> processEvents ( ); | 355 | qApp-> processEvents ( ); |
356 | } | 356 | } |
357 | 357 | ||
358 | // search current page ending at current selection | 358 | // search current page ending at current selection |
359 | if ( selr. isValid ( )) { | 359 | if ( selr. isValid ( )) { |
360 | xMax = selr. left ( ); | 360 | xMax = selr. left ( ); |
361 | yMax = selr. top ( ) + selr. height ( ) / 2; | 361 | yMax = selr. top ( ) + selr. height ( ) / 2; |
362 | 362 | ||
363 | if ( m_outdev-> findText ( u, len, gTrue, gFalse, &xMin, &yMin, &xMax, &yMax )) | 363 | if ( m_outdev-> findText ( u, len, gTrue, gFalse, &xMin, &yMin, &xMax, &yMax )) |
364 | goto found; | 364 | goto found; |
365 | } | 365 | } |
366 | 366 | ||
367 | // not found | 367 | // not found |
368 | QMessageBox::information ( this, tr( "Find..." ), tr( "'%1' could not be found." ). arg ( str )); | 368 | QMessageBox::information ( this, tr( "Find..." ), tr( "'%1' could not be found." ). arg ( str )); |
369 | goto done; | 369 | goto done; |
370 | 370 | ||
371 | foundPage: | 371 | foundPage: |
372 | qApp-> processEvents ( ); | 372 | qApp-> processEvents ( ); |
373 | 373 | ||
374 | gotoPage ( pg ); | 374 | gotoPage ( pg ); |
375 | 375 | ||
376 | if ( !m_outdev-> findText ( u, len, gTrue, gTrue, &xMin, &yMin, &xMax, &yMax )) { | 376 | if ( !m_outdev-> findText ( u, len, gTrue, gTrue, &xMin, &yMin, &xMax, &yMax )) { |
377 | // this can happen if coalescing is bad | 377 | // this can happen if coalescing is bad |
378 | goto done; | 378 | goto done; |
379 | } | 379 | } |
380 | 380 | ||
381 | found: | 381 | found: |
382 | selr. setCoords ( xMin, yMin, xMax, yMax ); | 382 | selr. setCoords ( xMin, yMin, xMax, yMax ); |
383 | m_outdev-> setSelection ( selr, true ); // this will emit QPEOutputDev::selectionChanged ( ) -> copyToClipboard ( ) | 383 | m_outdev-> setSelection ( selr, true ); // this will emit QPEOutputDev::selectionChanged ( ) -> copyToClipboard ( ) |
384 | 384 | ||
385 | done: | 385 | done: |
386 | 386 | ||
387 | delete [] u; | 387 | delete [] u; |
388 | delete textOut; | 388 | delete textOut; |
389 | 389 | ||
390 | setBusy ( false ); | 390 | setBusy ( false ); |
391 | } | 391 | } |
392 | 392 | ||
393 | 393 | ||
394 | void QPdfDlg::findText ( ) | 394 | void QPdfDlg::findText ( ) |
395 | { | 395 | { |
396 | findText ( m_findedit-> text ( )); | 396 | findText ( m_findedit-> text ( )); |
397 | } | 397 | } |
398 | 398 | ||
399 | void QPdfDlg::copyToClipboard ( const QRect &r ) | 399 | void QPdfDlg::copyToClipboard ( const QRect &r ) |
400 | { | 400 | { |
401 | if ( m_doc && m_doc-> isOk ( ) && m_doc-> okToCopy ( )) | 401 | if ( m_doc && m_doc-> isOk ( ) && m_doc-> okToCopy ( )) |
402 | qApp-> clipboard ( )-> setText ( m_outdev-> getText ( r )); | 402 | qApp-> clipboard ( )-> setText ( m_outdev-> getText ( r )); |
403 | } | 403 | } |
404 | 404 | ||
405 | void QPdfDlg::firstPage ( ) | 405 | void QPdfDlg::firstPage ( ) |
406 | { | 406 | { |
407 | gotoPage ( 1 ); | 407 | gotoPage ( 1 ); |
408 | } | 408 | } |
409 | 409 | ||
410 | void QPdfDlg::prevPage ( ) | 410 | void QPdfDlg::prevPage ( ) |
411 | { | 411 | { |
412 | gotoPage ( m_currentpage - 1 ); | 412 | gotoPage ( m_currentpage - 1 ); |
413 | } | 413 | } |
414 | 414 | ||
415 | void QPdfDlg::nextPage ( ) | 415 | void QPdfDlg::nextPage ( ) |
416 | { | 416 | { |
417 | gotoPage ( m_currentpage + 1 ); | 417 | gotoPage ( m_currentpage + 1 ); |
418 | } | 418 | } |
419 | 419 | ||
420 | void QPdfDlg::lastPage ( ) | 420 | void QPdfDlg::lastPage ( ) |
421 | { | 421 | { |
422 | gotoPage ( m_pages ); | 422 | gotoPage ( m_pages ); |
423 | } | 423 | } |
424 | 424 | ||
425 | void QPdfDlg::gotoPage ( int n ) | 425 | void QPdfDlg::gotoPage ( int n ) |
426 | { | 426 | { |
427 | if ( n < 1 ) | 427 | if ( n < 1 ) |
428 | n = 1; | 428 | n = 1; |
429 | if ( n > m_pages ) | 429 | if ( n > m_pages ) |
430 | n = m_pages; | 430 | n = m_pages; |
431 | 431 | ||
432 | if ( n != m_currentpage ) { | 432 | if ( n != m_currentpage ) { |
433 | m_currentpage = n; | 433 | m_currentpage = n; |
434 | 434 | ||
435 | renderPage ( ); | 435 | renderPage ( ); |
436 | } | 436 | } |
437 | } | 437 | } |
438 | 438 | ||
439 | void QPdfDlg::renderPage ( ) | 439 | void QPdfDlg::renderPage ( ) |
440 | { | 440 | { |
441 | if ( m_renderok && m_doc && m_doc-> isOk ( )) { | 441 | if ( m_renderok && m_doc && m_doc-> isOk ( )) { |
442 | m_renderok = false; | 442 | m_renderok = false; |
443 | 443 | ||
444 | setBusy ( true ); | 444 | setBusy ( true ); |
445 | m_doc-> displayPage ( m_outdev, m_currentpage, m_zoom, 0, true ); | 445 | m_doc-> displayPage ( m_outdev, m_currentpage, m_zoom, 0, true ); |
446 | setBusy ( false ); | 446 | setBusy ( false ); |
447 | 447 | ||
448 | m_outdev-> setPageCount ( m_currentpage, m_pages ); | 448 | m_outdev-> setPageCount ( m_currentpage, m_pages ); |
449 | 449 | ||
450 | m_renderok = true; | 450 | m_renderok = true; |
451 | } | 451 | } |
452 | } | 452 | } |
453 | 453 | ||
454 | void QPdfDlg::closeFileSelector ( ) | 454 | void QPdfDlg::closeFileSelector ( ) |
455 | { | 455 | { |
456 | m_tb_menu-> show ( ); | 456 | m_tb_menu-> show ( ); |
457 | m_tb_tool-> show ( ); | 457 | m_tb_tool-> show ( ); |
458 | m_stack-> raiseWidget ( m_outdev ); | 458 | m_stack-> raiseWidget ( m_outdev ); |
459 | } | 459 | } |
460 | 460 | ||
461 | void QPdfDlg::openFile ( ) | 461 | void QPdfDlg::openFile ( ) |
462 | { | 462 | { |
463 | m_tb_menu-> hide ( ); | 463 | m_tb_menu-> hide ( ); |
464 | m_tb_tool-> hide ( ); | 464 | m_tb_tool-> hide ( ); |
465 | m_tb_find-> hide ( ); | 465 | m_tb_find-> hide ( ); |
466 | m_stack-> raiseWidget ( m_filesel ); | 466 | m_stack-> raiseWidget ( m_filesel ); |
467 | } | 467 | } |
468 | 468 | ||
469 | void QPdfDlg::openFile ( const QString &f ) | 469 | void QPdfDlg::openFile ( const QString &f ) |
470 | { | 470 | { |
471 | DocLnk nf; | 471 | DocLnk nf; |
472 | nf. setType ( "application/pdf" ); | 472 | nf. setType ( "application/pdf" ); |
473 | nf. setFile ( f ); | 473 | nf. setFile ( f ); |
474 | QFileInfo fi ( f ); | 474 | QFileInfo fi ( f ); |
475 | nf. setName ( fi. baseName ( )); | 475 | nf. setName ( fi. baseName ( )); |
476 | openFile ( nf ); | 476 | openFile ( nf ); |
477 | } | 477 | } |
478 | 478 | ||
479 | void QPdfDlg::openFile ( const DocLnk &f ) | 479 | void QPdfDlg::openFile ( const DocLnk &f ) |
480 | { | 480 | { |
481 | QString fn = f. file ( ); | 481 | QString fn = f. file ( ); |
482 | QFileInfo fi ( fn ); | 482 | QFileInfo fi ( fn ); |
483 | 483 | ||
484 | if ( fi. exists ( )) { | 484 | if ( fi. exists ( )) { |
485 | delete m_doc; | 485 | delete m_doc; |
486 | 486 | ||
487 | m_doc = new PDFDoc ( new GString ( fn. local8Bit ( )), 0, 0 ); | 487 | m_doc = new PDFDoc ( new GString ( fn. local8Bit ( )), 0, 0 ); |
488 | 488 | ||
489 | if ( m_doc-> isOk ( )) { | 489 | if ( m_doc-> isOk ( )) { |
490 | m_currentdoc = f. name ( ); | 490 | m_currentdoc = f. name ( ); |
491 | int sep = m_currentdoc. findRev ( '/' ); | 491 | int sep = m_currentdoc. findRev ( '/' ); |
492 | if ( sep > 0 ) | 492 | if ( sep > 0 ) |
493 | m_currentdoc = m_currentdoc. mid ( sep + 1 ); | 493 | m_currentdoc = m_currentdoc. mid ( sep + 1 ); |
494 | 494 | ||
495 | m_pages = m_doc-> getNumPages ( ); | 495 | m_pages = m_doc-> getNumPages ( ); |
496 | m_currentpage = 0; | 496 | m_currentpage = 0; |
497 | 497 | ||
498 | QTimer::singleShot ( 0, this, SLOT( delayedInit ( ))); | 498 | QTimer::singleShot ( 0, this, SLOT( delayedInit ( ))); |
499 | } | 499 | } |
500 | else { | 500 | else { |
501 | delete m_doc; | 501 | delete m_doc; |
502 | m_doc = 0; | 502 | m_doc = 0; |
503 | 503 | ||
504 | m_currentdoc = QString::null; | 504 | m_currentdoc = QString::null; |
505 | } | 505 | } |
506 | 506 | ||
507 | updateCaption ( ); | 507 | updateCaption ( ); |
508 | } | 508 | } |
509 | else | 509 | else |
510 | QMessageBox::warning ( this, tr( "Error" ), tr( "File does not exist !" )); | 510 | QMessageBox::warning ( this, tr( "Error" ), tr( "File does not exist !" )); |
511 | } | 511 | } |
512 | 512 | ||
513 | void QPdfDlg::setDocument ( const QString &f ) | 513 | void QPdfDlg::setDocument ( const QString &f ) |
514 | { | 514 | { |
515 | if ( f. find ( ".desktop", 0, true ) == -1 ) | 515 | if ( f. find ( ".desktop", 0, true ) == -1 ) |
516 | openFile ( f ); | 516 | openFile ( f ); |
517 | else | 517 | else |
518 | openFile ( DocLnk ( f )); | 518 | openFile ( DocLnk ( f )); |
519 | 519 | ||
520 | closeFileSelector ( ); | 520 | closeFileSelector ( ); |
521 | } | 521 | } |
522 | 522 | ||
523 | void QPdfDlg::delayedInit ( ) | 523 | void QPdfDlg::delayedInit ( ) |
524 | { | 524 | { |
525 | closeFileSelector ( ); | 525 | closeFileSelector ( ); |
526 | 526 | ||
527 | m_currentpage = 0; | 527 | m_currentpage = 0; |
528 | m_zoom = 0; | 528 | m_zoom = 0; |
529 | m_renderok = false; | 529 | m_renderok = false; |
530 | 530 | ||
531 | setZoom ( 100 ); | 531 | setZoom ( 100 ); |
532 | gotoPage ( 1 ); | 532 | gotoPage ( 1 ); |
533 | 533 | ||
534 | m_renderok = true; | 534 | m_renderok = true; |
535 | 535 | ||
536 | renderPage ( ); | 536 | renderPage ( ); |
537 | 537 | ||
538 | m_outdev-> setFocus ( ); | 538 | m_outdev-> setFocus ( ); |
539 | } | 539 | } |
540 | 540 | ||
diff --git a/noncore/unsupported/qpdf/qpdf.h b/noncore/unsupported/qpdf/qpdf.h index 8b3cff9..fd4f013 100644 --- a/noncore/unsupported/qpdf/qpdf.h +++ b/noncore/unsupported/qpdf/qpdf.h | |||
@@ -1,101 +1,101 @@ | |||
1 | #ifndef __QPDF_H__ | 1 | #ifndef __QPDF_H__ |
2 | #define __QPDF_H__ | 2 | #define __QPDF_H__ |
3 | 3 | ||
4 | #include "aconf.h" | 4 | #include "aconf.h" |
5 | 5 | ||
6 | #include <qmainwindow.h> | 6 | #include <qmainwindow.h> |
7 | 7 | ||
8 | #define QPDF_QPE_ONLY 1 // ofileselector does not work right currently | 8 | //#define QPDF_QPE_ONLY 1 |
9 | 9 | ||
10 | class QPEOutputDev; | 10 | class QPEOutputDev; |
11 | class PDFDoc; | 11 | class PDFDoc; |
12 | 12 | ||
13 | class DocLnk; | 13 | class DocLnk; |
14 | class FileSelector; | 14 | class FileSelector; |
15 | class OFileSelector; | 15 | class OFileSelector; |
16 | class QWidgetStack; | 16 | class QWidgetStack; |
17 | class QLineEdit; | 17 | class QLineEdit; |
18 | 18 | ||
19 | 19 | ||
20 | class QPdfDlg : public QMainWindow { | 20 | class QPdfDlg : public QMainWindow { |
21 | Q_OBJECT | 21 | Q_OBJECT |
22 | 22 | ||
23 | public: | 23 | public: |
24 | QPdfDlg ( ); | 24 | QPdfDlg ( ); |
25 | virtual ~QPdfDlg ( ); | 25 | virtual ~QPdfDlg ( ); |
26 | 26 | ||
27 | public slots: | 27 | public slots: |
28 | void firstPage ( ); | 28 | void firstPage ( ); |
29 | void prevPage ( ); | 29 | void prevPage ( ); |
30 | void nextPage ( ); | 30 | void nextPage ( ); |
31 | void lastPage ( ); | 31 | void lastPage ( ); |
32 | 32 | ||
33 | void gotoPage ( int n ); | 33 | void gotoPage ( int n ); |
34 | 34 | ||
35 | void setZoom ( int z ); | 35 | void setZoom ( int z ); |
36 | 36 | ||
37 | void gotoPageDialog ( ); | 37 | void gotoPageDialog ( ); |
38 | 38 | ||
39 | void toggleFullscreen ( ); | 39 | void toggleFullscreen ( ); |
40 | void toggleFindBar ( ); | 40 | void toggleFindBar ( ); |
41 | 41 | ||
42 | void findText ( const QString & ); | 42 | void findText ( const QString & ); |
43 | void findText ( ); | 43 | void findText ( ); |
44 | 44 | ||
45 | void openFile ( ); | 45 | void openFile ( ); |
46 | void openFile ( const QString & ); | 46 | void openFile ( const QString & ); |
47 | void openFile ( const DocLnk & ); | 47 | void openFile ( const DocLnk & ); |
48 | 48 | ||
49 | void setDocument ( const QString & ); | 49 | void setDocument ( const QString & ); |
50 | 50 | ||
51 | private slots: | 51 | private slots: |
52 | void delayedInit ( ); | 52 | void delayedInit ( ); |
53 | void closeFileSelector ( ); | 53 | void closeFileSelector ( ); |
54 | 54 | ||
55 | void updateCaption ( ); | 55 | void updateCaption ( ); |
56 | 56 | ||
57 | void copyToClipboard ( const QRect & ); | 57 | void copyToClipboard ( const QRect & ); |
58 | 58 | ||
59 | protected: | 59 | protected: |
60 | void setFullscreen ( bool b = true ); | 60 | void setFullscreen ( bool b = true ); |
61 | 61 | ||
62 | void setBusy ( bool b = true ); | 62 | void setBusy ( bool b = true ); |
63 | bool busy ( ) const; | 63 | bool busy ( ) const; |
64 | 64 | ||
65 | void renderPage ( ); | 65 | void renderPage ( ); |
66 | 66 | ||
67 | virtual void resizeEvent ( QResizeEvent *e ); | 67 | virtual void resizeEvent ( QResizeEvent *e ); |
68 | virtual void focusInEvent ( QFocusEvent *e ); | 68 | virtual void focusInEvent ( QFocusEvent *e ); |
69 | 69 | ||
70 | private: | 70 | private: |
71 | QWidgetStack *m_stack; | 71 | QWidgetStack *m_stack; |
72 | QPEOutputDev *m_outdev; | 72 | QPEOutputDev *m_outdev; |
73 | 73 | ||
74 | #ifdef QPDF_QPE_ONLY | 74 | #ifdef QPDF_QPE_ONLY |
75 | FileSelector *m_filesel; | 75 | FileSelector *m_filesel; |
76 | #else | 76 | #else |
77 | OFileSelector *m_filesel; | 77 | OFileSelector *m_filesel; |
78 | #endif | 78 | #endif |
79 | 79 | ||
80 | QToolBar *m_tb_menu, *m_tb_tool, *m_tb_find; | 80 | QToolBar *m_tb_menu, *m_tb_tool, *m_tb_find; |
81 | QLineEdit *m_findedit; | 81 | QLineEdit *m_findedit; |
82 | QPopupMenu *m_pm_zoom; | 82 | QPopupMenu *m_pm_zoom; |
83 | 83 | ||
84 | QToolButton *m_to_find, *m_to_full; | 84 | QToolButton *m_to_find, *m_to_full; |
85 | 85 | ||
86 | bool m_fullscreen; | 86 | bool m_fullscreen; |
87 | 87 | ||
88 | bool m_busy; | 88 | bool m_busy; |
89 | bool m_renderok; | 89 | bool m_renderok; |
90 | 90 | ||
91 | int m_currentpage; | 91 | int m_currentpage; |
92 | int m_pages; | 92 | int m_pages; |
93 | int m_zoom; | 93 | int m_zoom; |
94 | 94 | ||
95 | PDFDoc *m_doc; | 95 | PDFDoc *m_doc; |
96 | 96 | ||
97 | QString m_currentdoc; | 97 | QString m_currentdoc; |
98 | }; | 98 | }; |
99 | 99 | ||
100 | 100 | ||
101 | #endif | 101 | #endif |