summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/QTReaderApp.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/QTReaderApp.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/QTReaderApp.h50
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
38class QWidgetStack; 38class QWidgetStack;
39class QToolButton; 39class QToolButton;
40class QPopupMenu; 40class QPopupMenu;
41class QToolBar; 41class QToolBar;
42class QPEToolBar; 42//class QPEToolBar;
43class CBkmkSelector; 43class CBkmkSelector;
44class QProgressBar; 44class QProgressBar;
45class QAction; 45class QAction;
46class CAnnoEdit; 46class CAnnoEdit;
47class QFloatBar; 47class QFloatBar;
48class CDrawBuffer; 48class CDrawBuffer;
49class QTReader; 49class QTReader;
50class QPixmap;
50 51
51enum ActionTypes 52enum 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
59struct searchrecord 61struct 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
67class infowin; 69class infowin;
70class GraphicWin;
68 71
69class QTReaderApp : public QMainWindow 72class 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();
103private slots: 109private 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;
257const int cGotoBkmk = 3; 283const int cGotoBkmk = 3;
258const int cRmBkmkFile = 4; 284const int cRmBkmkFile = 4;
259const int cJump = 5; 285const int cJump = 5;
260const int cMonoSpace = 6; 286const int cMonoSpace = 6;
261const int cOverlap = 7; 287const int cOverlap = 7;
262const int cSetTarget = 8; 288const int cSetTarget = 8;
289const int cOpenFile = 9;
290
263#endif 291#endif