author | llornkcor <llornkcor> | 2002-09-14 02:19:09 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-09-14 02:19:09 (UTC) |
commit | 2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975 (patch) (unidiff) | |
tree | eeed16b5f80dd5883991a7a06133f5f7a6936256 /noncore/apps/opie-reader/QTReaderApp.h | |
parent | 5a95ed6a000a56849b8f093deea500214856c626 (diff) | |
download | opie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.zip opie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.tar.gz opie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.tar.bz2 |
update by Tim
Diffstat (limited to 'noncore/apps/opie-reader/QTReaderApp.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/QTReaderApp.h | 73 |
1 files changed, 65 insertions, 8 deletions
diff --git a/noncore/apps/opie-reader/QTReaderApp.h b/noncore/apps/opie-reader/QTReaderApp.h index 48575e9..22c57e4 100644 --- a/noncore/apps/opie-reader/QTReaderApp.h +++ b/noncore/apps/opie-reader/QTReaderApp.h | |||
@@ -23,24 +23,37 @@ | |||
23 | //#define __ISEARCH | 23 | //#define __ISEARCH |
24 | 24 | ||
25 | #define MAX_ENCODING 6 | 25 | #define MAX_ENCODING 6 |
26 | #define MAX_ACTIONS 3 | ||
26 | 27 | ||
27 | #include <qmainwindow.h> | 28 | #include <qmainwindow.h> |
28 | #include "QTReader.h" | 29 | #include "CExpander.h" |
29 | #include <qlist.h> | 30 | #include <qlist.h> |
30 | #include <qpe/filemanager.h> | 31 | #include <qpe/filemanager.h> |
31 | #include <qmap.h> | 32 | #include <qmap.h> |
32 | #include <qlineedit.h> | 33 | #include <qlineedit.h> |
33 | #include <qstack.h> | 34 | #include <qstack.h> |
34 | #include <qlistbox.h> | 35 | #include <qlistbox.h> |
35 | #include "Queue.h" | 36 | //#include "Queue.h" |
36 | 37 | ||
37 | class QWidgetStack; | 38 | class QWidgetStack; |
38 | class QToolButton; | 39 | class QToolButton; |
39 | class QPopupMenu; | 40 | class QPopupMenu; |
40 | class QToolBar; | 41 | class QToolBar; |
42 | class QPEToolBar; | ||
41 | class CBkmkSelector; | 43 | class CBkmkSelector; |
42 | class QProgressBar; | 44 | class QProgressBar; |
43 | class QAction; | 45 | class QAction; |
46 | class CAnnoEdit; | ||
47 | class QFloatBar; | ||
48 | class CDrawBuffer; | ||
49 | class QTReader; | ||
50 | |||
51 | enum ActionTypes | ||
52 | { | ||
53 | cesOpenFile = 0, | ||
54 | cesAutoScroll, | ||
55 | cesActionMark | ||
56 | }; | ||
44 | 57 | ||
45 | #ifdef __ISEARCH | 58 | #ifdef __ISEARCH |
46 | struct searchrecord | 59 | struct searchrecord |
@@ -58,6 +71,7 @@ class QTReaderApp : public QMainWindow | |||
58 | Q_OBJECT | 71 | Q_OBJECT |
59 | 72 | ||
60 | unsigned long m_savedpos; | 73 | unsigned long m_savedpos; |
74 | bool m_annoIsEditing; | ||
61 | 75 | ||
62 | public: | 76 | public: |
63 | QTReaderApp( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 77 | QTReaderApp( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); |
@@ -68,6 +82,10 @@ class QTReaderApp : public QMainWindow | |||
68 | void setScrollState(bool _b); | 82 | void setScrollState(bool _b); |
69 | 83 | ||
70 | protected: | 84 | protected: |
85 | void setfontHelper(const QString& lcn, int size = 0); | ||
86 | QAction* m_bkmkAvail; | ||
87 | CAnnoEdit* m_annoWin; | ||
88 | Bkmk* m_anno; | ||
71 | void closeEvent( QCloseEvent *e ); | 89 | void closeEvent( QCloseEvent *e ); |
72 | void readbkmks(); | 90 | void readbkmks(); |
73 | void do_mono(const QString&); | 91 | void do_mono(const QString&); |
@@ -75,11 +93,36 @@ class QTReaderApp : public QMainWindow | |||
75 | void do_overlap(const QString&); | 93 | void do_overlap(const QString&); |
76 | void do_settarget(const QString&); | 94 | void do_settarget(const QString&); |
77 | int EncNameToInt(const QString&); | 95 | int EncNameToInt(const QString&); |
78 | void saveprefs(); | 96 | ActionTypes ActNameToInt(const QString&); |
97 | bool m_doAnnotation; | ||
98 | bool m_doDictionary; | ||
99 | bool m_doClipboard; | ||
79 | 100 | ||
101 | public: | ||
102 | void saveprefs(); | ||
80 | private slots: | 103 | private slots: |
104 | void setTwoTouch(bool _b); | ||
105 | void restoreFocus(); | ||
106 | void OnAnnotation(bool _b) | ||
107 | { | ||
108 | m_doAnnotation = _b; | ||
109 | } | ||
110 | void OnDictionary(bool _b) | ||
111 | { | ||
112 | m_doDictionary = _b; | ||
113 | } | ||
114 | void OnClipboard(bool _b) | ||
115 | { | ||
116 | m_doClipboard = _b; | ||
117 | } | ||
118 | void OnWordSelected(const QString&, size_t, const QString&); | ||
119 | void addAnno(const QString&, const QString&, size_t); | ||
120 | void addAnno(const QString&, const QString&); | ||
121 | void addanno(); | ||
122 | void showAnnotation(); | ||
81 | void do_setfont(const QString&); | 123 | void do_setfont(const QString&); |
82 | void encodingSelected(QAction*); | 124 | void encodingSelected(QAction*); |
125 | void buttonActionSelected(QAction*); | ||
83 | void msgHandler(const QCString&, const QByteArray&); | 126 | void msgHandler(const QCString&, const QByteArray&); |
84 | void monospace(bool); | 127 | void monospace(bool); |
85 | void jump(); | 128 | void jump(); |
@@ -127,11 +170,15 @@ private slots: | |||
127 | void showEditTools(); | 170 | void showEditTools(); |
128 | 171 | ||
129 | void stripcr(bool); | 172 | void stripcr(bool); |
173 | void peanut(bool _b); | ||
174 | void remap(bool); | ||
175 | void embolden(bool); | ||
176 | void autofmt(bool); | ||
177 | void textfmt(bool); | ||
130 | void striphtml(bool); | 178 | void striphtml(bool); |
131 | void dehyphen(bool); | 179 | void dehyphen(bool); |
132 | void unindent(bool); | 180 | void unindent(bool); |
133 | void repara(bool); | 181 | void repara(bool); |
134 | void setbold(bool); | ||
135 | void dblspce(bool); | 182 | void dblspce(bool); |
136 | void pagemode(bool); | 183 | void pagemode(bool); |
137 | // void gotobkmk(const QString& bm); | 184 | // void gotobkmk(const QString& bm); |
@@ -141,8 +188,11 @@ private slots: | |||
141 | void do_delmark(); | 188 | void do_delmark(); |
142 | void do_autogen(); | 189 | void do_autogen(); |
143 | void do_regaction(); | 190 | void do_regaction(); |
191 | void OnRedraw(); | ||
192 | void OnActionPressed(); | ||
144 | 193 | ||
145 | private: | 194 | private: |
195 | QString m_targetapp, m_targetmsg; | ||
146 | void listbkmk(); | 196 | void listbkmk(); |
147 | void do_regedit(); | 197 | void do_regedit(); |
148 | void colorChanged( const QColor &c ); | 198 | void colorChanged( const QColor &c ); |
@@ -150,6 +200,7 @@ private slots: | |||
150 | void updateCaption(); | 200 | void updateCaption(); |
151 | void do_autogen(const QString&); | 201 | void do_autogen(const QString&); |
152 | void do_addbkmk(const QString&); | 202 | void do_addbkmk(const QString&); |
203 | bool findNextBookmark(size_t start); | ||
153 | 204 | ||
154 | private: | 205 | private: |
155 | 206 | ||
@@ -157,24 +208,29 @@ private slots: | |||
157 | 208 | ||
158 | QAction* m_EncodingAction[MAX_ENCODING]; | 209 | QAction* m_EncodingAction[MAX_ENCODING]; |
159 | 210 | ||
211 | QAction* m_buttonAction[MAX_ACTIONS]; | ||
212 | |||
160 | CBkmkSelector* bkmkselector; | 213 | CBkmkSelector* bkmkselector; |
161 | 214 | ||
215 | ActionTypes m_spaceTarget; | ||
162 | size_t searchStart; | 216 | size_t searchStart; |
163 | #ifdef __ISEARCH | 217 | #ifdef __ISEARCH |
164 | QStack<searchrecord>* searchStack; | 218 | QStack<searchrecord>* searchStack; |
165 | bool dosearch(size_t start, CBuffer& test, const QString& arg); | 219 | bool dosearch(size_t start, CDrawBuffer& test, const QString& arg); |
166 | #else | 220 | #else |
167 | bool dosearch(size_t start, CBuffer& test, const QRegExp& arg); | 221 | bool dosearch(size_t start, CDrawBuffer& test, const QRegExp& arg); |
168 | #endif | 222 | #endif |
169 | QWidgetStack *editorStack; | 223 | QWidgetStack *editorStack; |
170 | QTReader* reader; | 224 | QTReader* reader; |
171 | QComboBox* m_fontSelector; | 225 | QComboBox* m_fontSelector; |
172 | QToolBar *menu, *editBar, *searchBar, *regBar, *m_fontBar; | 226 | QPEToolBar /* *menu,*/ *editBar; |
227 | QFloatBar *searchBar, *regBar/*, *m_fontBar*/; | ||
228 | QToolBar /* *searchBar, *regBar,*/ *m_fontBar; | ||
173 | QLineEdit *searchEdit, *regEdit; | 229 | QLineEdit *searchEdit, *regEdit; |
174 | DocLnk *doc; | 230 | DocLnk *doc; |
175 | bool searchVisible; | 231 | bool searchVisible; |
176 | bool regVisible; | 232 | bool regVisible; |
177 | bool m_fontVisible; | 233 | bool m_fontVisible, m_twoTouch; |
178 | bool bFromDocView; | 234 | bool bFromDocView; |
179 | static unsigned long m_uid; | 235 | static unsigned long m_uid; |
180 | long unsigned get_unique_id() { return m_uid++; } | 236 | long unsigned get_unique_id() { return m_uid++; } |
@@ -192,6 +248,7 @@ private slots: | |||
192 | bool m_fBkmksChanged; | 248 | bool m_fBkmksChanged; |
193 | int m_nRegAction; | 249 | int m_nRegAction; |
194 | QString m_autogenstr; | 250 | QString m_autogenstr; |
251 | bool m_dontSave; | ||
195 | }; | 252 | }; |
196 | 253 | ||
197 | const int cAutoGen = 0; | 254 | const int cAutoGen = 0; |