author | llornkcor <llornkcor> | 2002-12-20 01:35:01 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-12-20 01:35:01 (UTC) |
commit | 876e1a4724a7bd75dc642e295de354241096e028 (patch) (unidiff) | |
tree | a37c5dcc9d78e04bb6b859ab89d8cf81e6745087 /noncore/apps/opie-reader/QTReaderApp.h | |
parent | 5fd6636ba3d94b48dd543887316c47c5388a43c2 (diff) | |
download | opie-876e1a4724a7bd75dc642e295de354241096e028.zip opie-876e1a4724a7bd75dc642e295de354241096e028.tar.gz opie-876e1a4724a7bd75dc642e295de354241096e028.tar.bz2 |
update - sorry it took so long. hope this works correctly
Diffstat (limited to 'noncore/apps/opie-reader/QTReaderApp.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/QTReaderApp.h | 50 |
1 files changed, 39 insertions, 11 deletions
diff --git a/noncore/apps/opie-reader/QTReaderApp.h b/noncore/apps/opie-reader/QTReaderApp.h index 22c57e4..cb33e4a 100644 --- a/noncore/apps/opie-reader/QTReaderApp.h +++ b/noncore/apps/opie-reader/QTReaderApp.h | |||
@@ -20,13 +20,13 @@ | |||
20 | #ifndef __QTREADERAPP_H | 20 | #ifndef __QTREADERAPP_H |
21 | #define __QTREADERAPP_H | 21 | #define __QTREADERAPP_H |
22 | 22 | ||
23 | //#define __ISEARCH | 23 | //#define __ISEARCH |
24 | 24 | ||
25 | #define MAX_ENCODING 6 | 25 | #define MAX_ENCODING 6 |
26 | #define MAX_ACTIONS 3 | 26 | #define MAX_ACTIONS 4 |
27 | 27 | ||
28 | #include <qmainwindow.h> | 28 | #include <qmainwindow.h> |
29 | #include "CExpander.h" | 29 | #include "CExpander.h" |
30 | #include <qlist.h> | 30 | #include <qlist.h> |
31 | #include <qpe/filemanager.h> | 31 | #include <qpe/filemanager.h> |
32 | #include <qmap.h> | 32 | #include <qmap.h> |
@@ -36,74 +36,84 @@ | |||
36 | //#include "Queue.h" | 36 | //#include "Queue.h" |
37 | 37 | ||
38 | class QWidgetStack; | 38 | class QWidgetStack; |
39 | class QToolButton; | 39 | class QToolButton; |
40 | class QPopupMenu; | 40 | class QPopupMenu; |
41 | class QToolBar; | 41 | class QToolBar; |
42 | class QPEToolBar; | 42 | //class QPEToolBar; |
43 | class CBkmkSelector; | 43 | class CBkmkSelector; |
44 | class QProgressBar; | 44 | class QProgressBar; |
45 | class QAction; | 45 | class QAction; |
46 | class CAnnoEdit; | 46 | class CAnnoEdit; |
47 | class QFloatBar; | 47 | class QFloatBar; |
48 | class CDrawBuffer; | 48 | class CDrawBuffer; |
49 | class QTReader; | 49 | class QTReader; |
50 | class QPixmap; | ||
50 | 51 | ||
51 | enum ActionTypes | 52 | enum ActionTypes |
52 | { | 53 | { |
53 | cesOpenFile = 0, | 54 | cesOpenFile = 0, |
54 | cesAutoScroll, | 55 | cesAutoScroll, |
55 | cesActionMark | 56 | cesActionMark, |
57 | cesFullScreen | ||
56 | }; | 58 | }; |
57 | 59 | ||
58 | #ifdef __ISEARCH | 60 | #ifdef __ISEARCH |
59 | struct searchrecord | 61 | struct searchrecord |
60 | { | 62 | { |
61 | QString s; | 63 | QString s; |
62 | size_t pos; | 64 | size_t pos; |
63 | searchrecord(const QString& _s, size_t _pos) : s(_s), pos(_pos) {} | 65 | searchrecord(const QString& _s, size_t _pos) : s(_s), pos(_pos) {} |
64 | }; | 66 | }; |
65 | #endif | 67 | #endif |
66 | 68 | ||
67 | class infowin; | 69 | class infowin; |
70 | class GraphicWin; | ||
68 | 71 | ||
69 | class QTReaderApp : public QMainWindow | 72 | class QTReaderApp : public QMainWindow |
70 | { | 73 | { |
71 | Q_OBJECT | 74 | Q_OBJECT |
72 | 75 | ||
73 | unsigned long m_savedpos; | 76 | unsigned long m_savedpos; |
74 | bool m_annoIsEditing; | 77 | bool m_annoIsEditing; |
75 | 78 | ||
76 | public: | 79 | public: |
77 | QTReaderApp( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 80 | QTReaderApp( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); |
78 | ~QTReaderApp(); | 81 | ~QTReaderApp(); |
79 | 82 | void suspend(); | |
80 | void openFile( const QString & ); | 83 | void openFile( const QString & ); |
81 | 84 | ||
82 | void setScrollState(bool _b); | 85 | void setScrollState(bool _b); |
83 | 86 | ||
84 | protected: | 87 | protected: |
85 | void setfontHelper(const QString& lcn, int size = 0); | 88 | void setfontHelper(const QString& lcn, int size = 0); |
86 | QAction* m_bkmkAvail; | 89 | QAction* m_bkmkAvail, *m_actFullscreen; |
87 | CAnnoEdit* m_annoWin; | 90 | CAnnoEdit* m_annoWin; |
88 | Bkmk* m_anno; | 91 | Bkmk* m_anno; |
92 | // void resizeEvent(QResizeEvent* e); | ||
93 | void keyPressEvent(QKeyEvent* e); | ||
89 | void closeEvent( QCloseEvent *e ); | 94 | void closeEvent( QCloseEvent *e ); |
90 | void readbkmks(); | 95 | void readbkmks(); |
91 | void do_mono(const QString&); | 96 | void do_mono(const QString&); |
92 | void do_jump(const QString&); | 97 | void do_jump(const QString&); |
93 | void do_overlap(const QString&); | 98 | void do_overlap(const QString&); |
94 | void do_settarget(const QString&); | 99 | void do_settarget(const QString&); |
95 | int EncNameToInt(const QString&); | 100 | int EncNameToInt(const QString&); |
96 | ActionTypes ActNameToInt(const QString&); | 101 | ActionTypes ActNameToInt(const QString&); |
97 | bool m_doAnnotation; | 102 | bool m_doAnnotation; |
98 | bool m_doDictionary; | 103 | bool m_doDictionary; |
99 | bool m_doClipboard; | 104 | bool m_doClipboard; |
105 | bool m_fullscreen; | ||
100 | 106 | ||
101 | public: | 107 | public: |
102 | void saveprefs(); | 108 | void saveprefs(); |
103 | private slots: | 109 | private slots: |
110 | void zoomin(); | ||
111 | void zoomout(); | ||
112 | void setfullscreen(bool sfs); | ||
113 | void setcontinuous(bool sfs); | ||
104 | void setTwoTouch(bool _b); | 114 | void setTwoTouch(bool _b); |
105 | void restoreFocus(); | 115 | void restoreFocus(); |
106 | void OnAnnotation(bool _b) | 116 | void OnAnnotation(bool _b) |
107 | { | 117 | { |
108 | m_doAnnotation = _b; | 118 | m_doAnnotation = _b; |
109 | } | 119 | } |
@@ -113,12 +123,13 @@ private slots: | |||
113 | } | 123 | } |
114 | void OnClipboard(bool _b) | 124 | void OnClipboard(bool _b) |
115 | { | 125 | { |
116 | m_doClipboard = _b; | 126 | m_doClipboard = _b; |
117 | } | 127 | } |
118 | void OnWordSelected(const QString&, size_t, const QString&); | 128 | void OnWordSelected(const QString&, size_t, const QString&); |
129 | void showgraphic(QPixmap&); | ||
119 | void addAnno(const QString&, const QString&, size_t); | 130 | void addAnno(const QString&, const QString&, size_t); |
120 | void addAnno(const QString&, const QString&); | 131 | void addAnno(const QString&, const QString&); |
121 | void addanno(); | 132 | void addanno(); |
122 | void showAnnotation(); | 133 | void showAnnotation(); |
123 | void do_setfont(const QString&); | 134 | void do_setfont(const QString&); |
124 | void encodingSelected(QAction*); | 135 | void encodingSelected(QAction*); |
@@ -138,19 +149,18 @@ private slots: | |||
138 | void savebkmks(); | 149 | void savebkmks(); |
139 | //void importFiles(); | 150 | //void importFiles(); |
140 | void infoClose(); | 151 | void infoClose(); |
141 | // void oldFile(); | 152 | // void oldFile(); |
142 | void showinfo(); | 153 | void showinfo(); |
143 | void setDocument(const QString&); | 154 | void setDocument(const QString&); |
144 | void TBD(); | ||
145 | void TBDzoom(); | ||
146 | 155 | ||
147 | void indentplus(); | 156 | void indentplus(); |
148 | void indentminus(); | 157 | void indentminus(); |
149 | 158 | ||
150 | void fileOpen(); | 159 | void fileOpen(); |
160 | void fileClose(); | ||
151 | 161 | ||
152 | void editCopy(); | 162 | void editCopy(); |
153 | void editFind(); | 163 | void editFind(); |
154 | 164 | ||
155 | void pageup(); | 165 | void pageup(); |
156 | void pagedn(); | 166 | void pagedn(); |
@@ -163,40 +173,54 @@ private slots: | |||
163 | #ifdef __ISEARCH | 173 | #ifdef __ISEARCH |
164 | // void search( const QString& ); | 174 | // void search( const QString& ); |
165 | #else | 175 | #else |
166 | void search(); | 176 | void search(); |
167 | #endif | 177 | #endif |
168 | 178 | ||
169 | void openFile( const DocLnk & ); | ||
170 | void showEditTools(); | 179 | void showEditTools(); |
171 | 180 | ||
172 | void stripcr(bool); | 181 | void stripcr(bool); |
182 | void onespace(bool); | ||
183 | #ifdef REPALM | ||
184 | // void repalm(bool); | ||
185 | #endif | ||
173 | void peanut(bool _b); | 186 | void peanut(bool _b); |
174 | void remap(bool); | 187 | void remap(bool); |
175 | void embolden(bool); | 188 | void embolden(bool); |
176 | void autofmt(bool); | 189 | void autofmt(bool); |
177 | void textfmt(bool); | 190 | void textfmt(bool); |
178 | void striphtml(bool); | 191 | void striphtml(bool); |
179 | void dehyphen(bool); | 192 | void dehyphen(bool); |
180 | void unindent(bool); | 193 | void unindent(bool); |
181 | void repara(bool); | 194 | void repara(bool); |
182 | void dblspce(bool); | 195 | void dblspce(bool); |
183 | void pagemode(bool); | 196 | void pagemode(bool); |
197 | void navkeys(bool); | ||
184 | // void gotobkmk(const QString& bm); | 198 | // void gotobkmk(const QString& bm); |
185 | void gotobkmk(int); | 199 | void gotobkmk(int); |
186 | void cancelbkmk(); | 200 | void cancelbkmk(); |
187 | void do_gotomark(); | 201 | void do_gotomark(); |
188 | void do_delmark(); | 202 | void do_delmark(); |
189 | void do_autogen(); | 203 | void do_autogen(); |
190 | void do_regaction(); | 204 | void do_regaction(); |
191 | void OnRedraw(); | 205 | void OnRedraw(); |
192 | void OnActionPressed(); | 206 | void OnActionPressed(); |
193 | 207 | ||
194 | private: | 208 | private: |
209 | /* | ||
210 | void setstate(unsigned char* _sd, unsigned short _sdlen); | ||
211 | void getstate(unsigned char*& data, unsigned short& len); | ||
212 | */ | ||
213 | void fileOpen2(); | ||
214 | void readfilelist(); | ||
215 | void savefilelist(); | ||
216 | void updatefileinfo(); | ||
217 | bool openfrombkmk(Bkmk*); | ||
195 | QString m_targetapp, m_targetmsg; | 218 | QString m_targetapp, m_targetmsg; |
196 | void listbkmk(); | 219 | void listbkmk(CList<Bkmk>*, const QString& _lab = QString::null); |
220 | QString usefilebrowser(); | ||
197 | void do_regedit(); | 221 | void do_regedit(); |
198 | void colorChanged( const QColor &c ); | 222 | void colorChanged( const QColor &c ); |
199 | void clear(); | 223 | void clear(); |
200 | void updateCaption(); | 224 | void updateCaption(); |
201 | void do_autogen(const QString&); | 225 | void do_autogen(const QString&); |
202 | void do_addbkmk(const QString&); | 226 | void do_addbkmk(const QString&); |
@@ -220,17 +244,17 @@ private slots: | |||
220 | #else | 244 | #else |
221 | bool dosearch(size_t start, CDrawBuffer& test, const QRegExp& arg); | 245 | bool dosearch(size_t start, CDrawBuffer& test, const QRegExp& arg); |
222 | #endif | 246 | #endif |
223 | QWidgetStack *editorStack; | 247 | QWidgetStack *editorStack; |
224 | QTReader* reader; | 248 | QTReader* reader; |
225 | QComboBox* m_fontSelector; | 249 | QComboBox* m_fontSelector; |
226 | QPEToolBar /* *menu,*/ *editBar; | 250 | // QPEToolBar /* *menu,*/ *editBar; |
251 | QToolBar /* *menu,*/ *editBar; | ||
227 | QFloatBar *searchBar, *regBar/*, *m_fontBar*/; | 252 | QFloatBar *searchBar, *regBar/*, *m_fontBar*/; |
228 | QToolBar /* *searchBar, *regBar,*/ *m_fontBar; | 253 | QToolBar /* *searchBar, *regBar,*/ *m_fontBar; |
229 | QLineEdit *searchEdit, *regEdit; | 254 | QLineEdit *searchEdit, *regEdit; |
230 | DocLnk *doc; | ||
231 | bool searchVisible; | 255 | bool searchVisible; |
232 | bool regVisible; | 256 | bool regVisible; |
233 | bool m_fontVisible, m_twoTouch; | 257 | bool m_fontVisible, m_twoTouch; |
234 | bool bFromDocView; | 258 | bool bFromDocView; |
235 | static unsigned long m_uid; | 259 | static unsigned long m_uid; |
236 | long unsigned get_unique_id() { return m_uid++; } | 260 | long unsigned get_unique_id() { return m_uid++; } |
@@ -240,13 +264,15 @@ private slots: | |||
240 | qDebug("resize:(%u,%u)", r->oldSize().width(), r->oldSize().height()); | 264 | qDebug("resize:(%u,%u)", r->oldSize().width(), r->oldSize().height()); |
241 | qDebug("resize:(%u,%u)", r->size().width(), r->size().height()); | 265 | qDebug("resize:(%u,%u)", r->size().width(), r->size().height()); |
242 | // bgroup->move( width()-bgroup->width(), 0 ); | 266 | // bgroup->move( width()-bgroup->width(), 0 ); |
243 | } | 267 | } |
244 | */ | 268 | */ |
245 | CList<Bkmk>* pBkmklist; | 269 | CList<Bkmk>* pBkmklist; |
270 | CList<Bkmk>* pOpenlist; | ||
246 | infowin* m_infoWin; | 271 | infowin* m_infoWin; |
272 | GraphicWin* m_graphicwin; | ||
247 | QProgressBar* pbar; | 273 | QProgressBar* pbar; |
248 | bool m_fBkmksChanged; | 274 | bool m_fBkmksChanged; |
249 | int m_nRegAction; | 275 | int m_nRegAction; |
250 | QString m_autogenstr; | 276 | QString m_autogenstr; |
251 | bool m_dontSave; | 277 | bool m_dontSave; |
252 | }; | 278 | }; |
@@ -257,7 +283,9 @@ const int cDelBkmk = 2; | |||
257 | const int cGotoBkmk = 3; | 283 | const int cGotoBkmk = 3; |
258 | const int cRmBkmkFile = 4; | 284 | const int cRmBkmkFile = 4; |
259 | const int cJump = 5; | 285 | const int cJump = 5; |
260 | const int cMonoSpace = 6; | 286 | const int cMonoSpace = 6; |
261 | const int cOverlap = 7; | 287 | const int cOverlap = 7; |
262 | const int cSetTarget = 8; | 288 | const int cSetTarget = 8; |
289 | const int cOpenFile = 9; | ||
290 | |||
263 | #endif | 291 | #endif |