summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/Prefs.h
blob: 8fef2f58dc35ad3b5af6b05bdf0ed6720b98017e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
/****************************************************************************
** Form interface generated from reading ui file 'Prefs.ui'
**
** Created: Tue Feb 11 23:53:32 2003
**      by:  The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef CPREFS_H
#define CPREFS_H
#include "useqpe.h"
#include <qvariant.h>
#include <qwidget.h>
#include <qtabdialog.h>
#include <qtabwidget.h>
#include <qspinbox.h>
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qlineedit.h>
#ifdef USEQPE
#include <qpe/menubutton.h>
#endif
//#include "opie.h"

//#ifdef OPIE
#define USECOMBO
//#endif

class QVBoxLayout; 
class QHBoxLayout; 
class QGridLayout; 
//class QCheckBox;
class QLabel;
//class QSpinBox;

class CLayoutPrefs : public QWidget
{ 
    Q_OBJECT
public:

    friend class CPrefs;

    CLayoutPrefs( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
    ~CLayoutPrefs();

    QCheckBox* StripCR;
    QCheckBox* Dehyphen;
    QCheckBox* SingleSpace;
    QCheckBox* Unindent;
    QCheckBox* Reparagraph;
    QCheckBox* DoubleSpace;
    QCheckBox* Remap;
    QCheckBox* Embolden;
    QCheckBox* FullJustify;
};

class CLayoutPrefs2 : public QWidget
{ 
    Q_OBJECT
public:

    friend class CPrefs;

    CLayoutPrefs2( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
    ~CLayoutPrefs2();

    QSpinBox* ParaLead;
    QSpinBox* LineLead;
    QSpinBox* Indent;
    QSpinBox* Margin, *gfxzoom, *pageoverlap;
#ifdef USECOMBO
    QComboBox *Markup, *fontselector;
#else
    MenuButton *Markup, *fontselector;
#endif
};

/*
class CPluckerPrefs : public QWidget
{ 

public:

    friend class CPrefs;

    CPluckerPrefs( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
    ~CPluckerPrefs();

    QCheckBox* Depluck;
    QCheckBox* Dejpluck;
    QCheckBox* Continuous;
protected:

    QHBoxLayout* Layout5;
    QVBoxLayout* Layout11;
    QGridLayout* Layout4;

};
*/
class CMiscPrefs : public QWidget
{ 
    Q_OBJECT
public:

    friend class CPrefs;

    CMiscPrefs( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
    ~CMiscPrefs();

    QCheckBox *annotation, *dictionary, *clipboard;
    QCheckBox *Depluck, *Dejpluck, *Continuous;
};

class CButtonPrefs : public QWidget
{ 
    Q_OBJECT
#ifdef USECOMBO
    void populate(QComboBox*);
#else
    void populate(MenuButton*);
#endif
public:

    friend class CPrefs;

    CButtonPrefs( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
    ~CButtonPrefs();

#ifdef USECOMBO
    QComboBox *returnAction, *spaceAction, *escapeAction, *leftAction, *rightAction, *upAction, *downAction;
#else
    MenuButton *returnAction, *spaceAction, *escapeAction, *leftAction, *rightAction, *upAction, *downAction;
#endif
    QCheckBox *leftScroll, *rightScroll, *upScroll, *downScroll;
};

class CInterPrefs : public QWidget
{ 
    Q_OBJECT
public:

    friend class CPrefs;

    CInterPrefs( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
    ~CInterPrefs();

    QCheckBox *ideogram, *propfontchange, *SwapMouse, *twotouch;
#ifdef USECOMBO
    QComboBox* encoding;
#else
    MenuButton* encoding;
#endif
    QSpinBox* ideogramwidth;
    QLineEdit *application, *message;
};


class CPrefs : public QDialog
{
Q_OBJECT
    CLayoutPrefs* layout;
    CLayoutPrefs2* layout2;
 CMiscPrefs* misc;
 CButtonPrefs* button;
 CInterPrefs* inter;

    void keyPressEvent(QKeyEvent* e)
	{
	    switch (e->key())
	    {
		case Key_Escape:
		    e->accept();
		    reject();
		    break;
		case Key_Space:
		case Key_Return:
		    e->accept();
		    accept();
		    break;
		default:
		    QWidget::keyPressEvent(e);
	    }
	}
 public:
    CPrefs(bool fs = true, QWidget* parent = 0, const char* name = 0);
    ~CPrefs()
	{
	}
    bool StripCR() { return layout->StripCR->isChecked(); }
    bool Dehyphen() { return layout->Dehyphen->isChecked(); }
    bool SingleSpace() { return layout->SingleSpace->isChecked(); }
    bool Unindent() { return layout->Unindent->isChecked(); }
    bool Reparagraph() { return layout->Reparagraph->isChecked(); }
    bool DoubleSpace() { return layout->DoubleSpace->isChecked(); }
    bool Remap() { return layout->Remap->isChecked(); }
    bool Embolden() { return layout->Embolden->isChecked(); }
    bool FullJustify() { return layout->FullJustify->isChecked(); }
    int ParaLead() { return layout2->ParaLead->value(); }
    int LineLead() { return layout2->LineLead->value(); }
    int Margin() { return layout2->Margin->value(); }
    int Indent() { return layout2->Indent->value(); }
    int Markup() { return layout2->Markup->currentItem(); }
    QString Font() { return layout2->fontselector->currentText(); }


    void StripCR(bool v) { layout->StripCR->setChecked(v); }
    void Dehyphen(bool v) { layout->Dehyphen->setChecked(v); }
    void SingleSpace(bool v) { layout->SingleSpace->setChecked(v); }
    void Unindent(bool v) { layout->Unindent->setChecked(v); }
    void Reparagraph(bool v) { layout->Reparagraph->setChecked(v); }
    void DoubleSpace(bool v) { layout->DoubleSpace->setChecked(v); }
    void Remap(bool v) { layout->Remap->setChecked(v); }
    void Embolden(bool v) { layout->Embolden->setChecked(v); }
    void FullJustify(bool v) { layout->FullJustify->setChecked(v); }
    void ParaLead(int v) { layout2->ParaLead->setValue(v); }
    void LineLead(int v) { layout2->LineLead->setValue(v); }
    void Margin(int v) { layout2->Margin->setValue(v); }
    void Indent(int v) { layout2->Indent->setValue(v); }
#ifdef USECOMBO
    void Markup(int v) { layout2->Markup->setCurrentItem(v); }
#else
    void Markup(int v) { layout2->Markup->select(v); }
#endif
#ifdef USECOMBO
    void Font(QString& s)
	{
	    for (int i = 1; i <= layout2->fontselector->count(); i++)
	    {
		if (layout2->fontselector->text(i) == s)
		{
		    layout2->fontselector->setCurrentItem(i);
		    break;
		}
	    }
	}
#else
    void Font(QString& s) { layout2->fontselector->select(s); }
#endif

    bool Depluck() { return misc->Depluck->isChecked(); }
    void Depluck(bool v) { misc->Depluck->setChecked(v); }
    bool Dejpluck() { return misc->Dejpluck->isChecked(); }
    void Dejpluck(bool v) { misc->Dejpluck->setChecked(v); }
    bool Continuous() { return misc->Continuous->isChecked(); }
    void Continuous(bool v) { misc->Continuous->setChecked(v); }
    bool SwapMouse() { return inter->SwapMouse->isChecked(); }
    void SwapMouse(bool v) { inter->SwapMouse->setChecked(v); }


    void dictApplication(const QString& v) { inter->application->setText(v); }
    QString dictApplication() { return inter->application->text(); }
    void dictMessage(const QString& v) { inter->message->setText(v); }
    QString dictMessage() { return inter->message->text(); }

    void miscannotation(bool v) { misc->annotation->setChecked(v); }
    void miscdictionary(bool v) { misc->dictionary->setChecked(v); }
    void miscclipboard(bool v) { misc->clipboard->setChecked(v); }
    bool miscannotation() { return misc->annotation->isChecked(); }
    bool miscdictionary() { return misc->dictionary->isChecked(); }
    bool miscclipboard() { return misc->clipboard->isChecked(); }

    int spaceAction() { return button->spaceAction->currentItem(); }
#ifdef USECOMBO
    void spaceAction(int v) { button->spaceAction->setCurrentItem(v); }
#else
    void spaceAction(int v) { button->spaceAction->select(v); }
#endif
    int escapeAction() { return button->escapeAction->currentItem(); }
#ifdef USECOMBO
    void escapeAction(int v) { button->escapeAction->setCurrentItem(v); }
#else
    void escapeAction(int v) { button->escapeAction->select(v); }
#endif
    int returnAction() { return button->returnAction->currentItem(); }
#ifdef USECOMBO
    void returnAction(int v) { button->returnAction->setCurrentItem(v); }
#else
    void returnAction(int v) { button->returnAction->select(v); }
#endif
    int leftAction() { return button->leftAction->currentItem(); }
#ifdef USECOMBO
    void leftAction(int v) { button->leftAction->setCurrentItem(v); }
#else
    void leftAction(int v) { button->leftAction->select(v); }
#endif
    int rightAction() { return button->rightAction->currentItem(); }
#ifdef USECOMBO
    void rightAction(int v) { button->rightAction->setCurrentItem(v); }
#else
    void rightAction(int v) { button->rightAction->select(v); }
#endif
    int upAction() { return button->upAction->currentItem(); }
#ifdef USECOMBO
    void upAction(int v) { button->upAction->setCurrentItem(v); }
#else
    void upAction(int v) { button->upAction->select(v); }
#endif
    int downAction() { return button->downAction->currentItem(); }
#ifdef USECOMBO
    void downAction(int v) { button->downAction->setCurrentItem(v); }
#else
    void downAction(int v) { button->downAction->select(v); }
#endif
    bool leftScroll() { return button->leftScroll->isChecked(); }
    void leftScroll(bool v) { button->leftScroll->setChecked(v); }
    bool rightScroll() { return button->rightScroll->isChecked(); }
    void rightScroll(bool v) { button->rightScroll->setChecked(v); }
    bool upScroll() { return button->upScroll->isChecked(); }
    void upScroll(bool v) { button->upScroll->setChecked(v); }
    bool downScroll() { return button->downScroll->isChecked(); }
    void downScroll(bool v) { button->downScroll->setChecked(v); }


    int gfxsize() { return layout2->gfxzoom->value(); }
    void gfxsize(int v) { layout2->gfxzoom->setValue(v); }
    int pageoverlap() { return layout2->pageoverlap->value(); }
    void pageoverlap(int v) { layout2->pageoverlap->setValue(v); }

    bool twotouch() { return inter->twotouch->isChecked(); }
    void twotouch(bool v) { inter->twotouch->setChecked(v); }

    bool ideogram() { return inter->ideogram->isChecked(); }
    void ideogram(bool v) { inter->ideogram->setChecked(v); }

    int ideogramwidth() { return inter->ideogramwidth->value(); }
    void ideogramwidth(int v) { inter->ideogramwidth->setValue(v); }

    bool propfontchange() { return inter->propfontchange->isChecked(); }
    void propfontchange(bool v) { inter->propfontchange->setChecked(v); }

    int encoding() { return inter->encoding->currentItem(); }
#ifdef USECOMBO
    void encoding(int v) { inter->encoding->setCurrentItem(v); }
#else
    void encoding(int v) { inter->encoding->select(v); }
#endif



};
#endif // CPREFS_H