summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/Prefs.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/Prefs.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/Prefs.h190
1 files changed, 117 insertions, 73 deletions
diff --git a/noncore/apps/opie-reader/Prefs.h b/noncore/apps/opie-reader/Prefs.h
index 8fef2f5..cf12b70 100644
--- a/noncore/apps/opie-reader/Prefs.h
+++ b/noncore/apps/opie-reader/Prefs.h
@@ -8,23 +8,24 @@
8****************************************************************************/ 8****************************************************************************/
9#ifndef CPREFS_H 9#ifndef CPREFS_H
10#define CPREFS_H 10#define CPREFS_H
11#include "useqpe.h" 11
12#include <qvariant.h> 12#include <qvariant.h>
13#include <qwidget.h> 13#include <qwidget.h>
14#include <qtabdialog.h> 14#include <qtabdialog.h>
15#include <qtabwidget.h> 15#include <qtabwidget.h>
16#include <qspinbox.h> 16#include <qspinbox.h>
17#include <qcheckbox.h> 17#include <qcheckbox.h>
18#include <qcombobox.h>
19#include <qlineedit.h> 18#include <qlineedit.h>
20#ifdef USEQPE 19
20#define USECOMBO
21
22#ifdef USECOMBO
23#include <qcombobox.h>
24#else
21#include <qpe/menubutton.h> 25#include <qpe/menubutton.h>
22#endif 26#endif
23//#include "opie.h"
24 27
25//#ifdef OPIE 28#include "orkey.h"
26#define USECOMBO
27//#endif
28 29
29class QVBoxLayout; 30class QVBoxLayout;
30class QHBoxLayout; 31class QHBoxLayout;
@@ -32,10 +33,11 @@ class QGridLayout;
32//class QCheckBox; 33//class QCheckBox;
33class QLabel; 34class QLabel;
34//class QSpinBox; 35//class QSpinBox;
36class QListViewItem;
35 37
36class CLayoutPrefs : public QWidget 38class CLayoutPrefs : public QWidget
37{ 39{
38 Q_OBJECT 40
39public: 41public:
40 42
41 friend class CPrefs; 43 friend class CPrefs;
@@ -52,26 +54,33 @@ public:
52 QCheckBox* Remap; 54 QCheckBox* Remap;
53 QCheckBox* Embolden; 55 QCheckBox* Embolden;
54 QCheckBox* FullJustify; 56 QCheckBox* FullJustify;
57 QCheckBox* FixGraphics;
58 QCheckBox* hyphenate;
59 // QCheckBox* customhyphen;
60 QCheckBox* prepalm;
61 QCheckBox* pkern;
62 // QCheckBox* Inverse;
63 // QCheckBox* Negative;
55}; 64};
56 65
57class CLayoutPrefs2 : public QWidget 66class CLayoutPrefs2 : public QWidget
58{ 67{
59 Q_OBJECT 68
60public: 69public:
61 70
62 friend class CPrefs; 71 friend class CPrefs;
63 72
64 CLayoutPrefs2( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 73 CLayoutPrefs2( int w, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
65 ~CLayoutPrefs2(); 74 ~CLayoutPrefs2();
66 75
67 QSpinBox* ParaLead; 76 QSpinBox* ParaLead;
68 QSpinBox* LineLead; 77 QSpinBox* LineLead;
69 QSpinBox* Indent; 78 QSpinBox* Indent;
70 QSpinBox* Margin, *gfxzoom, *pageoverlap; 79 QSpinBox *TopMargin, *BottomMargin, *LeftMargin, *RightMargin, *gfxzoom, *pageoverlap;
71#ifdef USECOMBO 80#ifdef USECOMBO
72 QComboBox *Markup, *fontselector; 81 QComboBox *Markup, *fontselector, *fgsel, *bgsel;
73#else 82#else
74 MenuButton *Markup, *fontselector; 83 MenuButton *Markup, *fontselector, *fgsel, *bgsel;
75#endif 84#endif
76}; 85};
77 86
@@ -99,7 +108,7 @@ protected:
99*/ 108*/
100class CMiscPrefs : public QWidget 109class CMiscPrefs : public QWidget
101{ 110{
102 Q_OBJECT 111
103public: 112public:
104 113
105 friend class CPrefs; 114 friend class CPrefs;
@@ -109,11 +118,26 @@ public:
109 118
110 QCheckBox *annotation, *dictionary, *clipboard; 119 QCheckBox *annotation, *dictionary, *clipboard;
111 QCheckBox *Depluck, *Dejpluck, *Continuous; 120 QCheckBox *Depluck, *Dejpluck, *Continuous;
121
122 QSpinBox *scrollstep;
123
124#ifdef USECOMBO
125 QComboBox *scrollcolor, *bgtype, *scrolltype, *minibarcol;
126#else
127 MenuButton *scrollcolor, *bgtype, *scrolltype, *minibarcol;
128#endif
112}; 129};
130/*
131class QListView;
132class QListViewItem;
113 133
114class CButtonPrefs : public QWidget 134class CButtonPrefs : public QWidget
115{ 135{
116 Q_OBJECT 136 Q_OBJECT
137 QMap<orKey, int> *kmap;
138 QMap<orKey, QListViewItem*> listmap;
139 QListView* lb;
140 void keyPressEvent(QKeyEvent* e);
117#ifdef USECOMBO 141#ifdef USECOMBO
118 void populate(QComboBox*); 142 void populate(QComboBox*);
119#else 143#else
@@ -123,20 +147,24 @@ public:
123 147
124 friend class CPrefs; 148 friend class CPrefs;
125 149
126 CButtonPrefs( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 150 CButtonPrefs( QMap<orKey, int>*, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
127 ~CButtonPrefs(); 151 ~CButtonPrefs();
128 152
129#ifdef USECOMBO 153#ifdef USECOMBO
130 QComboBox *returnAction, *spaceAction, *escapeAction, *leftAction, *rightAction, *upAction, *downAction; 154 QComboBox *action;
131#else 155#else
132 MenuButton *returnAction, *spaceAction, *escapeAction, *leftAction, *rightAction, *upAction, *downAction; 156 MenuButton *action;
133#endif 157#endif
134 QCheckBox *leftScroll, *rightScroll, *upScroll, *downScroll; 158 QSpinBox* debounce;
135};
136 159
160 // QCheckBox *leftScroll, *rightScroll, *upScroll, *downScroll;
161 private slots:
162 void erasemapping(QListViewItem*);
163};
164*/
137class CInterPrefs : public QWidget 165class CInterPrefs : public QWidget
138{ 166{
139 Q_OBJECT 167
140public: 168public:
141 169
142 friend class CPrefs; 170 friend class CPrefs;
@@ -161,7 +189,7 @@ Q_OBJECT
161 CLayoutPrefs* layout; 189 CLayoutPrefs* layout;
162 CLayoutPrefs2* layout2; 190 CLayoutPrefs2* layout2;
163 CMiscPrefs* misc; 191 CMiscPrefs* misc;
164 CButtonPrefs* button; 192 // CButtonPrefs* button;
165 CInterPrefs* inter; 193 CInterPrefs* inter;
166 194
167 void keyPressEvent(QKeyEvent* e) 195 void keyPressEvent(QKeyEvent* e)
@@ -182,11 +210,19 @@ Q_OBJECT
182 } 210 }
183 } 211 }
184 public: 212 public:
185 CPrefs(bool fs = true, QWidget* parent = 0, const char* name = 0); 213 CPrefs(int w, bool fs = true, QWidget* parent = 0, const char* name = 0);
186 ~CPrefs() 214 ~CPrefs()
187 { 215 {
188 } 216 }
217 bool hyphenate() { return layout->hyphenate->isChecked(); }
218 void hyphenate(bool _v) { layout->hyphenate->setChecked(_v); }
219 /*
220 bool customhyphen() { return layout->customhyphen->isChecked(); }
221 void customhyphen(bool _v) { layout->customhyphen->setChecked(_v); }
222 */
189 bool StripCR() { return layout->StripCR->isChecked(); } 223 bool StripCR() { return layout->StripCR->isChecked(); }
224 bool repalm() { return layout->prepalm->isChecked(); }
225 bool kern() { return layout->pkern->isChecked(); }
190 bool Dehyphen() { return layout->Dehyphen->isChecked(); } 226 bool Dehyphen() { return layout->Dehyphen->isChecked(); }
191 bool SingleSpace() { return layout->SingleSpace->isChecked(); } 227 bool SingleSpace() { return layout->SingleSpace->isChecked(); }
192 bool Unindent() { return layout->Unindent->isChecked(); } 228 bool Unindent() { return layout->Unindent->isChecked(); }
@@ -195,15 +231,23 @@ Q_OBJECT
195 bool Remap() { return layout->Remap->isChecked(); } 231 bool Remap() { return layout->Remap->isChecked(); }
196 bool Embolden() { return layout->Embolden->isChecked(); } 232 bool Embolden() { return layout->Embolden->isChecked(); }
197 bool FullJustify() { return layout->FullJustify->isChecked(); } 233 bool FullJustify() { return layout->FullJustify->isChecked(); }
234 // bool Inverse() { return layout->Inverse->isChecked(); }
235 // bool Negative() { return layout->Negative->isChecked(); }
236 bool FixGraphics() { return layout->FixGraphics->isChecked(); }
198 int ParaLead() { return layout2->ParaLead->value(); } 237 int ParaLead() { return layout2->ParaLead->value(); }
199 int LineLead() { return layout2->LineLead->value(); } 238 int LineLead() { return layout2->LineLead->value(); }
200 int Margin() { return layout2->Margin->value(); } 239 int TopMargin() { return layout2->TopMargin->value(); }
240 int BottomMargin() { return layout2->BottomMargin->value(); }
241 int LeftMargin() { return layout2->LeftMargin->value(); }
242 int RightMargin() { return layout2->RightMargin->value(); }
201 int Indent() { return layout2->Indent->value(); } 243 int Indent() { return layout2->Indent->value(); }
202 int Markup() { return layout2->Markup->currentItem(); } 244 int Markup() { return layout2->Markup->currentItem(); }
203 QString Font() { return layout2->fontselector->currentText(); } 245 QString Font() { return layout2->fontselector->currentText(); }
204 246
205 247
206 void StripCR(bool v) { layout->StripCR->setChecked(v); } 248 void StripCR(bool v) { layout->StripCR->setChecked(v); }
249 void repalm(bool v) { layout->prepalm->setChecked(v); }
250 void kern(bool v) { layout->pkern->setChecked(v); }
207 void Dehyphen(bool v) { layout->Dehyphen->setChecked(v); } 251 void Dehyphen(bool v) { layout->Dehyphen->setChecked(v); }
208 void SingleSpace(bool v) { layout->SingleSpace->setChecked(v); } 252 void SingleSpace(bool v) { layout->SingleSpace->setChecked(v); }
209 void Unindent(bool v) { layout->Unindent->setChecked(v); } 253 void Unindent(bool v) { layout->Unindent->setChecked(v); }
@@ -212,9 +256,15 @@ Q_OBJECT
212 void Remap(bool v) { layout->Remap->setChecked(v); } 256 void Remap(bool v) { layout->Remap->setChecked(v); }
213 void Embolden(bool v) { layout->Embolden->setChecked(v); } 257 void Embolden(bool v) { layout->Embolden->setChecked(v); }
214 void FullJustify(bool v) { layout->FullJustify->setChecked(v); } 258 void FullJustify(bool v) { layout->FullJustify->setChecked(v); }
259 // void Negative(bool v) { layout->Negative->setChecked(v); }
260 // void Inverse(bool v) { layout->Inverse->setChecked(v); }
261 void FixGraphics(bool v) { layout->FixGraphics->setChecked(v); }
215 void ParaLead(int v) { layout2->ParaLead->setValue(v); } 262 void ParaLead(int v) { layout2->ParaLead->setValue(v); }
216 void LineLead(int v) { layout2->LineLead->setValue(v); } 263 void LineLead(int v) { layout2->LineLead->setValue(v); }
217 void Margin(int v) { layout2->Margin->setValue(v); } 264 void TopMargin(int v) { layout2->TopMargin->setValue(v); }
265 void BottomMargin(int v) { layout2->BottomMargin->setValue(v); }
266 void LeftMargin(int v) { layout2->LeftMargin->setValue(v); }
267 void RightMargin(int v) { layout2->RightMargin->setValue(v); }
218 void Indent(int v) { layout2->Indent->setValue(v); } 268 void Indent(int v) { layout2->Indent->setValue(v); }
219#ifdef USECOMBO 269#ifdef USECOMBO
220 void Markup(int v) { layout2->Markup->setCurrentItem(v); } 270 void Markup(int v) { layout2->Markup->setCurrentItem(v); }
@@ -222,6 +272,36 @@ Q_OBJECT
222 void Markup(int v) { layout2->Markup->select(v); } 272 void Markup(int v) { layout2->Markup->select(v); }
223#endif 273#endif
224#ifdef USECOMBO 274#ifdef USECOMBO
275 void bgtype(int v) { misc->bgtype->setCurrentItem(v); }
276 void scrollcolor(int v) { misc->scrollcolor->setCurrentItem(v); }
277 void minibarcol(int v) { misc->minibarcol->setCurrentItem(v); }
278#else
279 void bgtype(int v) { misc->bgtype->select(v); }
280 void scrollcolor(int v) { misc->scrollcolor->select(v); }
281 void minibarcol(int v) { misc->minibarcol->select(v); }
282#endif
283 int bgtype() { return misc->bgtype->currentItem(); }
284 int scrollcolor() { return misc->scrollcolor->currentItem(); }
285 int minibarcol() { return misc->minibarcol->currentItem(); }
286
287
288#ifdef USECOMBO
289 void foreground(int v) { layout2->fgsel->setCurrentItem(v); }
290#else
291 void foreground(int v) { layout2->fgsel->select(v); }
292#endif
293 int foreground() { return layout2->fgsel->currentItem(); }
294
295#ifdef USECOMBO
296 void background(int v) { layout2->bgsel->setCurrentItem(v); }
297#else
298 void background(int v) { layout2->bgsel->select(v); }
299#endif
300 int background() { return layout2->bgsel->currentItem(); }
301
302
303
304#ifdef USECOMBO
225 void Font(QString& s) 305 void Font(QString& s)
226 { 306 {
227 for (int i = 1; i <= layout2->fontselector->count(); i++) 307 for (int i = 1; i <= layout2->fontselector->count(); i++)
@@ -258,49 +338,11 @@ Q_OBJECT
258 bool miscannotation() { return misc->annotation->isChecked(); } 338 bool miscannotation() { return misc->annotation->isChecked(); }
259 bool miscdictionary() { return misc->dictionary->isChecked(); } 339 bool miscdictionary() { return misc->dictionary->isChecked(); }
260 bool miscclipboard() { return misc->clipboard->isChecked(); } 340 bool miscclipboard() { return misc->clipboard->isChecked(); }
261 341 /*
262 int spaceAction() { return button->spaceAction->currentItem(); } 342 int Debounce() { return button->debounce->value(); }
263#ifdef USECOMBO 343 void Debounce(int v) { button->debounce->setValue(v); }
264 void spaceAction(int v) { button->spaceAction->setCurrentItem(v); } 344 */
265#else 345 /*
266 void spaceAction(int v) { button->spaceAction->select(v); }
267#endif
268 int escapeAction() { return button->escapeAction->currentItem(); }
269#ifdef USECOMBO
270 void escapeAction(int v) { button->escapeAction->setCurrentItem(v); }
271#else
272 void escapeAction(int v) { button->escapeAction->select(v); }
273#endif
274 int returnAction() { return button->returnAction->currentItem(); }
275#ifdef USECOMBO
276 void returnAction(int v) { button->returnAction->setCurrentItem(v); }
277#else
278 void returnAction(int v) { button->returnAction->select(v); }
279#endif
280 int leftAction() { return button->leftAction->currentItem(); }
281#ifdef USECOMBO
282 void leftAction(int v) { button->leftAction->setCurrentItem(v); }
283#else
284 void leftAction(int v) { button->leftAction->select(v); }
285#endif
286 int rightAction() { return button->rightAction->currentItem(); }
287#ifdef USECOMBO
288 void rightAction(int v) { button->rightAction->setCurrentItem(v); }
289#else
290 void rightAction(int v) { button->rightAction->select(v); }
291#endif
292 int upAction() { return button->upAction->currentItem(); }
293#ifdef USECOMBO
294 void upAction(int v) { button->upAction->setCurrentItem(v); }
295#else
296 void upAction(int v) { button->upAction->select(v); }
297#endif
298 int downAction() { return button->downAction->currentItem(); }
299#ifdef USECOMBO
300 void downAction(int v) { button->downAction->setCurrentItem(v); }
301#else
302 void downAction(int v) { button->downAction->select(v); }
303#endif
304 bool leftScroll() { return button->leftScroll->isChecked(); } 346 bool leftScroll() { return button->leftScroll->isChecked(); }
305 void leftScroll(bool v) { button->leftScroll->setChecked(v); } 347 void leftScroll(bool v) { button->leftScroll->setChecked(v); }
306 bool rightScroll() { return button->rightScroll->isChecked(); } 348 bool rightScroll() { return button->rightScroll->isChecked(); }
@@ -309,10 +351,10 @@ Q_OBJECT
309 void upScroll(bool v) { button->upScroll->setChecked(v); } 351 void upScroll(bool v) { button->upScroll->setChecked(v); }
310 bool downScroll() { return button->downScroll->isChecked(); } 352 bool downScroll() { return button->downScroll->isChecked(); }
311 void downScroll(bool v) { button->downScroll->setChecked(v); } 353 void downScroll(bool v) { button->downScroll->setChecked(v); }
354 */
312 355
313 356 int gfxsize() { return layout2->gfxzoom->value()/10; }
314 int gfxsize() { return layout2->gfxzoom->value(); } 357 void gfxsize(int v) { layout2->gfxzoom->setValue(10*v); }
315 void gfxsize(int v) { layout2->gfxzoom->setValue(v); }
316 int pageoverlap() { return layout2->pageoverlap->value(); } 358 int pageoverlap() { return layout2->pageoverlap->value(); }
317 void pageoverlap(int v) { layout2->pageoverlap->setValue(v); } 359 void pageoverlap(int v) { layout2->pageoverlap->setValue(v); }
318 360
@@ -329,13 +371,15 @@ Q_OBJECT
329 void propfontchange(bool v) { inter->propfontchange->setChecked(v); } 371 void propfontchange(bool v) { inter->propfontchange->setChecked(v); }
330 372
331 int encoding() { return inter->encoding->currentItem(); } 373 int encoding() { return inter->encoding->currentItem(); }
374 int scrolltype() { return misc->scrolltype->currentItem(); }
332#ifdef USECOMBO 375#ifdef USECOMBO
333 void encoding(int v) { inter->encoding->setCurrentItem(v); } 376 void encoding(int v) { inter->encoding->setCurrentItem(v); }
377 void scrolltype(int v) { misc->scrolltype->setCurrentItem(v); }
334#else 378#else
335 void encoding(int v) { inter->encoding->select(v); } 379 void encoding(int v) { inter->encoding->select(v); }
380 void scrolltype(int v) { misc->scrolltype->select(v); }
336#endif 381#endif
337 382 void scrollstep(int v) { misc->scrollstep->setValue(v); }
338 383 int scrollstep() { return misc->scrollstep->value(); }
339
340}; 384};
341#endif // CPREFS_H 385#endif // CPREFS_H