author | groucho <groucho> | 2003-05-07 09:01:39 (UTC) |
---|---|---|
committer | groucho <groucho> | 2003-05-07 09:01:39 (UTC) |
commit | 118d03d815a7615b9c53363218a7ac45b3f4c514 (patch) (unidiff) | |
tree | 356953e2413cddcec0f35bd47bb6439767da7051 /noncore/apps/opie-reader/QTReaderApp.h | |
parent | 00894537decf01c5a5cdc565b2740b5e67a2e90f (diff) | |
download | opie-118d03d815a7615b9c53363218a7ac45b3f4c514.zip opie-118d03d815a7615b9c53363218a7ac45b3f4c514.tar.gz opie-118d03d815a7615b9c53363218a7ac45b3f4c514.tar.bz2 |
Incorporated TimWs current source tree and make it compile
Diffstat (limited to 'noncore/apps/opie-reader/QTReaderApp.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/QTReaderApp.h | 257 |
1 files changed, 204 insertions, 53 deletions
diff --git a/noncore/apps/opie-reader/QTReaderApp.h b/noncore/apps/opie-reader/QTReaderApp.h index cb33e4a..2765d47 100644 --- a/noncore/apps/opie-reader/QTReaderApp.h +++ b/noncore/apps/opie-reader/QTReaderApp.h | |||
@@ -22,11 +22,15 @@ | |||
22 | 22 | ||
23 | //#define _SCROLLPIPE | ||
23 | //#define __ISEARCH | 24 | //#define __ISEARCH |
24 | 25 | ||
25 | #define MAX_ENCODING 6 | 26 | //#define MAX_ENCODING 6 |
26 | #define MAX_ACTIONS 4 | 27 | #define MAX_ACTIONS 5 |
27 | 28 | ||
29 | #include "useqpe.h" | ||
30 | #include <sys/timeb.h> | ||
28 | #include <qmainwindow.h> | 31 | #include <qmainwindow.h> |
29 | #include "CExpander.h" | 32 | #include "CExpander.h" |
33 | #include "CEncoding.h" | ||
30 | #include <qlist.h> | 34 | #include <qlist.h> |
31 | #include <qpe/filemanager.h> | 35 | //#include <qpe/filemanager.h> |
32 | #include <qmap.h> | 36 | #include <qmap.h> |
@@ -41,3 +45,6 @@ class QPopupMenu; | |||
41 | class QToolBar; | 45 | class QToolBar; |
42 | //class QPEToolBar; | 46 | #ifdef USEQPE |
47 | class QPEToolBar; | ||
48 | class QPEMenuBar; | ||
49 | #endif | ||
43 | class CBkmkSelector; | 50 | class CBkmkSelector; |
@@ -49,3 +56,4 @@ class CDrawBuffer; | |||
49 | class QTReader; | 56 | class QTReader; |
50 | class QPixmap; | 57 | class QImage; |
58 | class Config; | ||
51 | 59 | ||
@@ -53,6 +61,65 @@ enum ActionTypes | |||
53 | { | 61 | { |
54 | cesOpenFile = 0, | 62 | cesNone = 0, |
63 | cesOpenFile, | ||
55 | cesAutoScroll, | 64 | cesAutoScroll, |
56 | cesActionMark, | 65 | cesActionMark, |
57 | cesFullScreen | 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 | ||
88 | { | ||
89 | cesSingle = 0, | ||
90 | cesMenuTool, | ||
91 | cesMultiple | ||
92 | }; | ||
93 | |||
94 | enum regedit_type | ||
95 | { | ||
96 | cAutoGen, | ||
97 | cAddBkmk, | ||
98 | cJump, | ||
99 | cMonoSpace, | ||
100 | cSetTarget, | ||
101 | #ifdef _SCROLLPIPE | ||
102 | cSetPipeTarget, | ||
103 | #endif | ||
104 | cSetConfigName, | ||
105 | cMargin, | ||
106 | cExtraSpace, | ||
107 | cExtraLead | ||
108 | }; | ||
109 | |||
110 | enum bkmk_action | ||
111 | { | ||
112 | cOpenFile, | ||
113 | cGotoBkmk, | ||
114 | cDelBkmk, | ||
115 | cRmBkmkFile, | ||
116 | cLdConfig, | ||
117 | cRmConfig, | ||
118 | cExportLinks | ||
119 | }; | ||
120 | |||
121 | enum fontselector_action | ||
122 | { | ||
123 | cChooseFont, | ||
124 | cChooseEncoding | ||
58 | }; | 125 | }; |
@@ -76,3 +143,9 @@ class QTReaderApp : public QMainWindow | |||
76 | unsigned long m_savedpos; | 143 | unsigned long m_savedpos; |
144 | int m_debounce; | ||
145 | timeb m_lastkeytime; | ||
77 | bool m_annoIsEditing; | 146 | bool m_annoIsEditing; |
147 | bool m_propogatefontchange, m_bFloatingDialog; | ||
148 | bool m_url_clipboard, m_url_localfile, m_url_globalfile; | ||
149 | fontselector_action m_fontAction; | ||
150 | void doAction(ActionTypes a, QKeyEvent* e); | ||
78 | 151 | ||
@@ -81,2 +154,9 @@ class QTReaderApp : public QMainWindow | |||
81 | ~QTReaderApp(); | 154 | ~QTReaderApp(); |
155 | |||
156 | void handlekey(QKeyEvent* e); | ||
157 | void hideEvent(QHideEvent*) | ||
158 | { | ||
159 | suspend(); | ||
160 | } | ||
161 | |||
82 | void suspend(); | 162 | void suspend(); |
@@ -92,3 +172,2 @@ class QTReaderApp : public QMainWindow | |||
92 | // void resizeEvent(QResizeEvent* e); | 172 | // void resizeEvent(QResizeEvent* e); |
93 | void keyPressEvent(QKeyEvent* e); | ||
94 | void closeEvent( QCloseEvent *e ); | 173 | void closeEvent( QCloseEvent *e ); |
@@ -97,5 +176,9 @@ class QTReaderApp : public QMainWindow | |||
97 | void do_jump(const QString&); | 176 | void do_jump(const QString&); |
98 | void do_overlap(const QString&); | ||
99 | void do_settarget(const QString&); | 177 | void do_settarget(const QString&); |
100 | int EncNameToInt(const QString&); | 178 | #ifdef _SCROLLPIPE |
179 | //void do_setpipetarget(const QString&); | ||
180 | #endif | ||
181 | void do_saveconfig(const QString&, bool); | ||
182 | bool readconfig(const QString&, bool); | ||
183 | bool PopulateConfig(const char*); | ||
101 | ActionTypes ActNameToInt(const QString&); | 184 | ActionTypes ActNameToInt(const QString&); |
@@ -105,10 +188,20 @@ class QTReaderApp : public QMainWindow | |||
105 | bool m_fullscreen; | 188 | bool m_fullscreen; |
106 | 189 | bool m_loadedconfig; | |
107 | public: | 190 | public: |
108 | void saveprefs(); | 191 | void saveprefs(); |
192 | public slots: | ||
193 | void setDocument(const QString&); | ||
109 | private slots: | 194 | private slots: |
195 | #ifdef _SCRIPT | ||
196 | // void RunScript(); | ||
197 | #endif | ||
198 | void SaveConfig(); | ||
199 | void LoadConfig(); | ||
200 | void TidyConfig(); | ||
201 | void ExportLinks(); | ||
110 | void zoomin(); | 202 | void zoomin(); |
111 | void zoomout(); | 203 | void zoomout(); |
204 | void chooseencoding(); | ||
112 | void setfullscreen(bool sfs); | 205 | void setfullscreen(bool sfs); |
113 | void setcontinuous(bool sfs); | 206 | // void setcontinuous(bool sfs); |
114 | void setTwoTouch(bool _b); | 207 | void setTwoTouch(bool _b); |
@@ -128,3 +221,4 @@ private slots: | |||
128 | void OnWordSelected(const QString&, size_t, const QString&); | 221 | void OnWordSelected(const QString&, size_t, const QString&); |
129 | void showgraphic(QPixmap&); | 222 | void OnURLSelected(const QString& href); |
223 | void showgraphic(QImage&); | ||
130 | void addAnno(const QString&, const QString&, size_t); | 224 | void addAnno(const QString&, const QString&, size_t); |
@@ -133,11 +227,14 @@ private slots: | |||
133 | void showAnnotation(); | 227 | void showAnnotation(); |
228 | void do_setencoding(int i); | ||
134 | void do_setfont(const QString&); | 229 | void do_setfont(const QString&); |
135 | void encodingSelected(QAction*); | ||
136 | void buttonActionSelected(QAction*); | 230 | void buttonActionSelected(QAction*); |
137 | void msgHandler(const QCString&, const QByteArray&); | 231 | //void msgHandler(const QCString&, const QByteArray&); |
138 | void monospace(bool); | 232 | void monospace(bool); |
139 | void jump(); | 233 | void jump(); |
140 | void setoverlap(); | ||
141 | void settarget(); | 234 | void settarget(); |
142 | void setspacing(); | 235 | #ifdef _SCROLLPIPE |
236 | //void setpipetarget(); | ||
237 | //void setpause(bool); | ||
238 | #endif | ||
239 | //void setspacing(); | ||
143 | void setfont(); | 240 | void setfont(); |
@@ -150,2 +247,4 @@ private slots: | |||
150 | //void importFiles(); | 247 | //void importFiles(); |
248 | void showprefs(); | ||
249 | void showtoolbarprefs(); | ||
151 | void infoClose(); | 250 | void infoClose(); |
@@ -153,6 +252,5 @@ private slots: | |||
153 | void showinfo(); | 252 | void showinfo(); |
154 | void setDocument(const QString&); | ||
155 | 253 | ||
156 | void indentplus(); | 254 | // void indentplus(); |
157 | void indentminus(); | 255 | // void indentminus(); |
158 | 256 | ||
@@ -164,2 +262,5 @@ private slots: | |||
164 | 262 | ||
263 | void gotoStart(); | ||
264 | void gotoEnd(); | ||
265 | |||
165 | void pageup(); | 266 | void pageup(); |
@@ -180,4 +281,5 @@ private slots: | |||
180 | 281 | ||
181 | void stripcr(bool); | 282 | // void stripcr(bool); |
182 | void onespace(bool); | 283 | // void setfulljust(bool); |
284 | // void onespace(bool); | ||
183 | #ifdef REPALM | 285 | #ifdef REPALM |
@@ -185,14 +287,15 @@ private slots: | |||
185 | #endif | 287 | #endif |
186 | void peanut(bool _b); | 288 | // void peanut(bool _b); |
187 | void remap(bool); | 289 | // void remap(bool); |
188 | void embolden(bool); | 290 | // void embolden(bool); |
189 | void autofmt(bool); | 291 | // void autofmt(bool); |
190 | void textfmt(bool); | 292 | // void textfmt(bool); |
191 | void striphtml(bool); | 293 | // void striphtml(bool); |
192 | void dehyphen(bool); | 294 | // void dehyphen(bool); |
193 | void unindent(bool); | 295 | // void depluck(bool); |
194 | void repara(bool); | 296 | // void dejpluck(bool); |
195 | void dblspce(bool); | 297 | // void unindent(bool); |
298 | // void repara(bool); | ||
299 | // void dblspce(bool); | ||
196 | void pagemode(bool); | 300 | void pagemode(bool); |
197 | void navkeys(bool); | ||
198 | // void gotobkmk(const QString& bm); | 301 | // void gotobkmk(const QString& bm); |
@@ -205,5 +308,34 @@ private slots: | |||
205 | void OnRedraw(); | 308 | void OnRedraw(); |
206 | void OnActionPressed(); | ||
207 | 309 | ||
208 | private: | 310 | private: |
311 | void writeUrl(const QString& file, const QString& href); | ||
312 | QAction *m_preferences_action, *m_open_action, *m_close_action; | ||
313 | QAction *m_info_action, *m_touch_action, *m_find_action, *m_start_action; | ||
314 | QAction *m_end_action, *m_jump_action, *m_pageline_action; | ||
315 | QAction *m_pageup_action, *m_pagedn_action, *m_back_action; | ||
316 | QAction *m_home_action, *m_forward_action, *m_zoomin_action; | ||
317 | QAction *m_zoomout_action, *m_setfont_action, *m_mark_action; | ||
318 | QAction *m_annotate_action, *m_goto_action, *m_delete_action; | ||
319 | QAction *m_autogen_action, *m_clear_action, *m_save_action; | ||
320 | QAction *m_tidy_action, *m_startBlock_action, *m_endBlock_action; | ||
321 | QAction *m_setenc_action, *m_setmono_action, *m_saveconfig_action; | ||
322 | QAction *m_loadconfig_action, *m_toolbarprefs_action, *m_tidyconfig_action; | ||
323 | QAction *m_exportlinks_action; | ||
324 | void addtoolbars(Config* config); | ||
325 | ToolbarPolicy m_tbpol, m_tbpolsave; | ||
326 | ToolBarDock m_tbposition; | ||
327 | bool m_tbmove, m_tbmovesave; | ||
328 | QToolBar* filebar(); | ||
329 | QToolBar* viewbar(); | ||
330 | QToolBar* navbar(); | ||
331 | QToolBar* markbar(); | ||
332 | void hidetoolbars(); | ||
333 | void addfilebar(Config* _config, const QString& key, QAction* a); | ||
334 | void addviewbar(Config* _config, const QString& key, QAction* a); | ||
335 | void addnavbar(Config* _config, const QString& key, QAction* a); | ||
336 | void addmarkbar(Config* _config, const QString& key, QAction* a); | ||
337 | bool checkbar(Config* _config, const QString& key); | ||
338 | #ifdef _SCRIPT | ||
339 | void SaveScript(const char* sname); | ||
340 | #endif | ||
209 | /* | 341 | /* |
@@ -218,3 +350,3 @@ private slots: | |||
218 | QString m_targetapp, m_targetmsg; | 350 | QString m_targetapp, m_targetmsg; |
219 | void listbkmk(CList<Bkmk>*, const QString& _lab = QString::null); | 351 | bool listbkmk(CList<Bkmk>*, const QString& _lab = QString::null); |
220 | QString usefilebrowser(); | 352 | QString usefilebrowser(); |
@@ -232,4 +364,2 @@ private slots: | |||
232 | 364 | ||
233 | QAction* m_EncodingAction[MAX_ENCODING]; | ||
234 | |||
235 | QAction* m_buttonAction[MAX_ACTIONS]; | 365 | QAction* m_buttonAction[MAX_ACTIONS]; |
@@ -238,3 +368,6 @@ private slots: | |||
238 | 368 | ||
239 | ActionTypes m_spaceTarget; | 369 | ActionTypes m_spaceTarget, m_escapeTarget, m_returnTarget, m_leftTarget, m_rightTarget, |
370 | m_upTarget, m_downTarget; | ||
371 | bool m_leftScroll, m_rightScroll, m_upScroll, m_downScroll; | ||
372 | bool m_bcloseDisabled, m_disableesckey; | ||
240 | size_t searchStart; | 373 | size_t searchStart; |
@@ -249,4 +382,9 @@ private slots: | |||
249 | QComboBox* m_fontSelector; | 382 | QComboBox* m_fontSelector; |
250 | // QPEToolBar /* *menu,*/ *editBar; | 383 | // QPEToolBar /* *menu,*/ *fileBar; |
251 | QToolBar /* *menu,*/ *editBar; | 384 | QToolBar *menubar, *fileBar, *navBar, *viewBar, *markBar; |
385 | #ifdef USEQPE | ||
386 | QPEMenuBar *mb; | ||
387 | #else | ||
388 | QMenuBar *mb; | ||
389 | #endif | ||
252 | QFloatBar *searchBar, *regBar/*, *m_fontBar*/; | 390 | QFloatBar *searchBar, *regBar/*, *m_fontBar*/; |
@@ -263,4 +401,4 @@ private slots: | |||
263 | { | 401 | { |
264 | qDebug("resize:(%u,%u)", r->oldSize().width(), r->oldSize().height()); | 402 | // qDebug("resize:(%u,%u)", r->oldSize().width(), r->oldSize().height()); |
265 | qDebug("resize:(%u,%u)", r->size().width(), r->size().height()); | 403 | // qDebug("resize:(%u,%u)", r->size().width(), r->size().height()); |
266 | // bgroup->move( width()-bgroup->width(), 0 ); | 404 | // bgroup->move( width()-bgroup->width(), 0 ); |
@@ -274,3 +412,5 @@ private slots: | |||
274 | bool m_fBkmksChanged; | 412 | bool m_fBkmksChanged; |
275 | int m_nRegAction; | 413 | // int m_nRegAction; |
414 | regedit_type m_nRegAction; | ||
415 | bkmk_action m_nBkmkAction; | ||
276 | QString m_autogenstr; | 416 | QString m_autogenstr; |
@@ -279,13 +419,24 @@ private slots: | |||
279 | 419 | ||
280 | const int cAutoGen = 0; | 420 | //const int cAutoGen = 0; |
281 | const int cAddBkmk = 1; | 421 | //const int cAddBkmk = 1; |
282 | const int cDelBkmk = 2; | 422 | //const int cDelBkmk = 2; |
283 | const int cGotoBkmk = 3; | 423 | //const int cGotoBkmk = 3; |
284 | const int cRmBkmkFile = 4; | 424 | //const int cRmBkmkFile = 4; |
285 | const int cJump = 5; | 425 | //const int cJump = 5; |
286 | const int cMonoSpace = 6; | 426 | //const int cMonoSpace = 6; |
287 | const int cOverlap = 7; | 427 | //const int cOverlap = 7; |
288 | const int cSetTarget = 8; | 428 | //const int cSetTarget = 8; |
289 | const int cOpenFile = 9; | 429 | //const int cOpenFile = 9; |
430 | //const int cSetPipeTarget = 10; | ||
431 | //const int cSetConfigName = 11; | ||
432 | //const int cMargin = 12; | ||
433 | //const int cExtraSpace = 14; | ||
434 | //const int cExtraLead = 15; | ||
435 | //const int cGfxSize = 16; | ||
436 | //const int cChooseFont = 2; | ||
437 | //const int cChooseEncoding = 1; | ||
290 | 438 | ||
291 | #endif | 439 | #endif |
440 | |||
441 | |||
442 | |||