author | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
---|---|---|
committer | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
commit | 73253e93327cf4ef0932de1b4afb56af22a0f37e (patch) (unidiff) | |
tree | 1c9a7a6dd3341e036a894d348a3372525d29acec /noncore/apps/opie-reader/QTReaderApp.h | |
parent | e90847c784c48bd21bf8768cb38edb853b832697 (diff) | |
download | opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.zip opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.gz opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.bz2 |
updated source to opie-reader 0.7g
Diffstat (limited to 'noncore/apps/opie-reader/QTReaderApp.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/QTReaderApp.h | 155 |
1 files changed, 99 insertions, 56 deletions
diff --git a/noncore/apps/opie-reader/QTReaderApp.h b/noncore/apps/opie-reader/QTReaderApp.h index fe3eebf..5ecc42d 100644 --- a/noncore/apps/opie-reader/QTReaderApp.h +++ b/noncore/apps/opie-reader/QTReaderApp.h | |||
@@ -39,4 +39,10 @@ | |||
39 | #include <qlistbox.h> | 39 | #include <qlistbox.h> |
40 | #ifdef USEQPE | ||
41 | #include <qpe/qpeapplication.h> | ||
42 | #endif | ||
43 | #include "orkey.h" | ||
40 | //#include "Queue.h" | 44 | //#include "Queue.h" |
45 | #include "BGType.h" | ||
41 | 46 | ||
47 | class QBoxLayout; | ||
42 | class QWidgetStack; | 48 | class QWidgetStack; |
@@ -46,5 +52,6 @@ class QToolBar; | |||
46 | #ifdef USEQPE | 52 | #ifdef USEQPE |
47 | class QToolBar; | 53 | class QPEToolBar; |
48 | class QMenuBar; | 54 | class QPEMenuBar; |
49 | #endif | 55 | #endif |
56 | class QScrollBar; | ||
50 | class CBkmkSelector; | 57 | class CBkmkSelector; |
@@ -58,30 +65,5 @@ class QImage; | |||
58 | class Config; | 65 | class Config; |
66 | class CButtonPrefs; | ||
59 | 67 | ||
60 | enum ActionTypes | 68 | #ifdef USEQPE |
61 | { | ||
62 | cesNone = 0, | ||
63 | cesOpenFile, | ||
64 | cesAutoScroll, | ||
65 | cesActionMark, | ||
66 | cesActionAnno, | ||
67 | cesFullScreen, | ||
68 | cesZoomIn, | ||
69 | cesZoomOut, | ||
70 | cesBack, | ||
71 | cesForward, | ||
72 | cesHome, | ||
73 | cesPageUp, | ||
74 | cesPageDown, | ||
75 | cesLineUp, | ||
76 | cesLineDown, | ||
77 | cesStartDoc, | ||
78 | cesEndDoc | ||
79 | }; | ||
80 | /* | ||
81 | *m_preferences_action, *m_close_action *m_info_action, *m_touch_action, | ||
82 | *m_find_action, *m_jump_action, *m_setfont_action *m_goto_action, | ||
83 | *m_delete_action; *m_autogen_action, *m_clear_action, *m_save_action; | ||
84 | *m_tidy_action, *m_startBlock_action, *m_endBlock_action; | ||
85 | *m_setenc_action, *m_setmono_action; | ||
86 | */ | ||
87 | enum ToolbarPolicy | 69 | enum ToolbarPolicy |
@@ -92,2 +74,9 @@ enum ToolbarPolicy | |||
92 | }; | 74 | }; |
75 | #else | ||
76 | enum ToolbarPolicy | ||
77 | { | ||
78 | cesMenuTool = 0, | ||
79 | cesMultiple | ||
80 | }; | ||
81 | #endif | ||
93 | 82 | ||
@@ -106,3 +95,4 @@ enum regedit_type | |||
106 | cExtraSpace, | 95 | cExtraSpace, |
107 | cExtraLead | 96 | cExtraLead, |
97 | cRepara | ||
108 | }; | 98 | }; |
@@ -117,3 +107,4 @@ enum bkmk_action | |||
117 | cRmConfig, | 107 | cRmConfig, |
118 | cExportLinks | 108 | cExportLinks, |
109 | cLdTheme | ||
119 | }; | 110 | }; |
@@ -142,5 +133,16 @@ class QTReaderApp : public QMainWindow | |||
142 | 133 | ||
134 | QColor getcolour(int c); | ||
135 | |||
136 | QMap<orKey, int> kmap; | ||
143 | unsigned long m_savedpos; | 137 | unsigned long m_savedpos; |
144 | int m_debounce; | 138 | int m_debounce; |
139 | bool m_kmapchanged; | ||
140 | bground m_bgtype; | ||
145 | timeb m_lastkeytime; | 141 | timeb m_lastkeytime; |
142 | QScrollBar* m_scrollbar; | ||
143 | QScrollBar* scrollbar; | ||
144 | int m_qtscroll, m_localscroll; | ||
145 | bool m_hidebars, m_scrollishidden, m_statusishidden; | ||
146 | QBoxLayout *m_layout; | ||
147 | QLabel* m_prog; | ||
146 | bool m_annoIsEditing; | 148 | bool m_annoIsEditing; |
@@ -148,4 +150,5 @@ class QTReaderApp : public QMainWindow | |||
148 | bool m_url_clipboard, m_url_localfile, m_url_globalfile; | 150 | bool m_url_clipboard, m_url_localfile, m_url_globalfile; |
151 | CButtonPrefs* m_buttonprefs; | ||
149 | fontselector_action m_fontAction; | 152 | fontselector_action m_fontAction; |
150 | void doAction(ActionTypes a, QKeyEvent* e); | 153 | void doAction(QKeyEvent* e); |
151 | 154 | ||
@@ -155,8 +158,21 @@ class QTReaderApp : public QMainWindow | |||
155 | 158 | ||
156 | void handlekey(QKeyEvent* e); | ||
157 | void hideEvent(QHideEvent*) | 159 | void hideEvent(QHideEvent*) |
158 | { | 160 | { |
161 | #ifdef USEQPE | ||
162 | if (m_grabkeyboard) | ||
163 | { | ||
164 | ((QPEApplication*)qApp)->ungrabKeyboard(); | ||
165 | } | ||
166 | #endif | ||
159 | suspend(); | 167 | suspend(); |
160 | } | 168 | } |
161 | 169 | #ifdef USEQPE | |
170 | void showEvent(QShowEvent*) | ||
171 | { | ||
172 | if (m_grabkeyboard) | ||
173 | { | ||
174 | ((QPEApplication*)qApp)->grabKeyboard(); | ||
175 | } | ||
176 | } | ||
177 | #endif | ||
162 | void suspend(); | 178 | void suspend(); |
@@ -164,3 +180,2 @@ class QTReaderApp : public QMainWindow | |||
164 | 180 | ||
165 | void setScrollState(bool _b); | ||
166 | 181 | ||
@@ -171,4 +186,10 @@ class QTReaderApp : public QMainWindow | |||
171 | Bkmk* m_anno; | 186 | Bkmk* m_anno; |
187 | int m_scrollcolor, m_scrollbarcolor, m_background, m_foreground; | ||
172 | // void resizeEvent(QResizeEvent* e); | 188 | // void resizeEvent(QResizeEvent* e); |
173 | void closeEvent( QCloseEvent *e ); | 189 | void closeEvent( QCloseEvent *e ); |
190 | #ifdef NEWFULLSCREEN | ||
191 | void resizeEvent(QResizeEvent *); | ||
192 | void focusInEvent(QFocusEvent*); | ||
193 | void enableFullscreen(); | ||
194 | #endif | ||
174 | void readbkmks(); | 195 | void readbkmks(); |
@@ -176,2 +197,3 @@ class QTReaderApp : public QMainWindow | |||
176 | void do_jump(const QString&); | 197 | void do_jump(const QString&); |
198 | void do_reparastring(const QString&); | ||
177 | void do_settarget(const QString&); | 199 | void do_settarget(const QString&); |
@@ -181,5 +203,8 @@ class QTReaderApp : public QMainWindow | |||
181 | void do_saveconfig(const QString&, bool); | 203 | void do_saveconfig(const QString&, bool); |
182 | bool readconfig(const QString&, bool); | 204 | bool readconfig(const QString&, const QString&, bool); |
183 | bool PopulateConfig(const char*); | 205 | bool PopulateConfig(const char*, bool usedirs = false); |
184 | ActionTypes ActNameToInt(const QString&); | 206 | ActionTypes ActNameToInt(const QString&); |
207 | #ifdef USEQPE | ||
208 | bool m_grabkeyboard; | ||
209 | #endif | ||
185 | bool m_doAnnotation; | 210 | bool m_doAnnotation; |
@@ -192,2 +217,7 @@ class QTReaderApp : public QMainWindow | |||
192 | public slots: | 217 | public slots: |
218 | void setBackgroundBitmap(); | ||
219 | void UpdateStatus(); | ||
220 | void setScrollState(bool _b); | ||
221 | void handlekey(QKeyEvent* e); | ||
222 | void forceopen(const QString& filename); | ||
193 | void setDocument(const QString&); | 223 | void setDocument(const QString&); |
@@ -197,3 +227,5 @@ private slots: | |||
197 | #endif | 227 | #endif |
228 | void actionscroll(int v); | ||
198 | void SaveConfig(); | 229 | void SaveConfig(); |
230 | void LoadTheme(); | ||
199 | void LoadConfig(); | 231 | void LoadConfig(); |
@@ -205,2 +237,5 @@ private slots: | |||
205 | void setfullscreen(bool sfs); | 237 | void setfullscreen(bool sfs); |
238 | void setrotated(bool sfs); | ||
239 | void setinverted(bool sfs); | ||
240 | void setgrab(bool sfs); | ||
206 | // void setcontinuous(bool sfs); | 241 | // void setcontinuous(bool sfs); |
@@ -220,6 +255,6 @@ private slots: | |||
220 | } | 255 | } |
221 | void OnWordSelected(const QString&, size_t, const QString&); | 256 | void OnWordSelected(const QString&, size_t, size_t, const QString&); |
222 | void OnURLSelected(const QString& href); | 257 | void OnURLSelected(const QString& href, const size_t tgt); |
223 | void showgraphic(QImage&); | 258 | void showgraphic(QImage&); |
224 | void addAnno(const QString&, const QString&, size_t); | 259 | void addAnno(const QString&, const QString&, size_t, size_t); |
225 | void addAnno(const QString&, const QString&); | 260 | void addAnno(const QString&, const QString&); |
@@ -229,6 +264,7 @@ private slots: | |||
229 | void do_setfont(const QString&); | 264 | void do_setfont(const QString&); |
230 | void buttonActionSelected(QAction*); | 265 | //void buttonActionSelected(QAction*); |
231 | // void msgHandler(const QCString&, const QByteArray&); | 266 | void msgHandler(const QCString&, const QByteArray&); |
232 | void monospace(bool); | 267 | void monospace(bool); |
233 | void jump(); | 268 | void jump(); |
269 | void reparastring(); | ||
234 | void settarget(); | 270 | void settarget(); |
@@ -249,2 +285,3 @@ private slots: | |||
249 | void showtoolbarprefs(); | 285 | void showtoolbarprefs(); |
286 | void showbuttonprefs(); | ||
250 | void infoClose(); | 287 | void infoClose(); |
@@ -284,5 +321,3 @@ private slots: | |||
284 | // void onespace(bool); | 321 | // void onespace(bool); |
285 | #ifdef REPALM | ||
286 | // void repalm(bool); | 322 | // void repalm(bool); |
287 | #endif | ||
288 | // void peanut(bool _b); | 323 | // void peanut(bool _b); |
@@ -310,2 +345,4 @@ private slots: | |||
310 | private: | 345 | private: |
346 | void setscrollcolour(); | ||
347 | void setscrollbarcolour(); | ||
311 | void writeUrl(const QString& file, const QString& href); | 348 | void writeUrl(const QString& file, const QString& href); |
@@ -321,4 +358,8 @@ private slots: | |||
321 | QAction *m_setenc_action, *m_setmono_action, *m_saveconfig_action; | 358 | QAction *m_setenc_action, *m_setmono_action, *m_saveconfig_action; |
322 | QAction *m_loadconfig_action, *m_toolbarprefs_action, *m_tidyconfig_action; | 359 | QAction *m_loadconfig_action, *m_loadtheme_action, *m_toolbarprefs_action, *m_tidyconfig_action; |
323 | QAction *m_exportlinks_action; | 360 | QAction *m_exportlinks_action, *m_rotate_action, *m_buttonprefs_action, *m_inverse_action; |
361 | QAction *m_repara_action; | ||
362 | #ifdef USEQPE | ||
363 | QAction *m_grab_action; | ||
364 | #endif | ||
324 | void addtoolbars(Config* config); | 365 | void addtoolbars(Config* config); |
@@ -349,3 +390,3 @@ private slots: | |||
349 | bool openfrombkmk(Bkmk*); | 390 | bool openfrombkmk(Bkmk*); |
350 | QString m_targetapp, m_targetmsg; | 391 | QString m_targetapp, m_targetmsg, m_statusstring, m_themename; |
351 | bool listbkmk(CList<Bkmk>*, const QString& _lab = QString::null); | 392 | bool listbkmk(CList<Bkmk>*, const QString& _lab = QString::null); |
@@ -368,5 +409,5 @@ private slots: | |||
368 | 409 | ||
369 | ActionTypes m_spaceTarget, m_escapeTarget, m_returnTarget, m_leftTarget, m_rightTarget, | 410 | // ActionTypes m_spaceTarget, m_escapeTarget, m_returnTarget, m_leftTarget, m_rightTarget, |
370 | m_upTarget, m_downTarget; | 411 | //m_upTarget, m_downTarget; |
371 | bool m_leftScroll, m_rightScroll, m_upScroll, m_downScroll; | 412 | //bool m_leftScroll, m_rightScroll, m_upScroll, m_downScroll; |
372 | bool m_bcloseDisabled, m_disableesckey; | 413 | bool m_bcloseDisabled, m_disableesckey; |
@@ -382,6 +423,9 @@ private slots: | |||
382 | QComboBox* m_fontSelector; | 423 | QComboBox* m_fontSelector; |
383 | // QToolBar /* *menu,*/ *fileBar; | 424 | // QPEToolBar /* *menu,*/ *fileBar; |
384 | QToolBar *menubar, *fileBar, *navBar, *viewBar, *markBar; | ||
385 | #ifdef USEQPE | 425 | #ifdef USEQPE |
386 | QMenuBar *mb; | 426 | QToolBar *menubar; |
427 | #endif | ||
428 | QToolBar *fileBar, *navBar, *viewBar, *markBar; | ||
429 | #ifdef USEQPE | ||
430 | QPEMenuBar *mb; | ||
387 | #else | 431 | #else |
@@ -395,3 +439,2 @@ private slots: | |||
395 | bool m_fontVisible, m_twoTouch; | 439 | bool m_fontVisible, m_twoTouch; |
396 | bool bFromDocView; | ||
397 | static unsigned long m_uid; | 440 | static unsigned long m_uid; |
@@ -401,4 +444,4 @@ private slots: | |||
401 | { | 444 | { |
402 | // odebug << "resize:(" << r->oldSize().width() << "," << r->oldSize().height() << ")" << oendl; | 445 | // qDebug("resize:(%u,%u)", r->oldSize().width(), r->oldSize().height()); |
403 | // odebug << "resize:(" << r->size().width() << "," << r->size().height() << ")" << oendl; | 446 | // qDebug("resize:(%u,%u)", r->size().width(), r->size().height()); |
404 | // bgroup->move( width()-bgroup->width(), 0 ); | 447 | // bgroup->move( width()-bgroup->width(), 0 ); |