00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef CPREFS_H
00010 #define CPREFS_H
00011
00012 #include <qvariant.h>
00013 #include <qwidget.h>
00014 #include <qtabdialog.h>
00015 #include <qtabwidget.h>
00016 #include <qspinbox.h>
00017 #include <qcheckbox.h>
00018 #include <qlineedit.h>
00019
00020 #define USECOMBO
00021
00022 #ifdef USECOMBO
00023 #include <qcombobox.h>
00024 #else
00025 #include <qpe/menubutton.h>
00026 #endif
00027
00028 #include "orkey.h"
00029
00030 class QVBoxLayout;
00031 class QHBoxLayout;
00032 class QGridLayout;
00033
00034 class QLabel;
00035
00036 class QListViewItem;
00037
00038 class CLayoutPrefs : public QWidget
00039 {
00040
00041 public:
00042
00043 friend class CPrefs;
00044
00045 CLayoutPrefs( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
00046 ~CLayoutPrefs();
00047
00048 QCheckBox* StripCR;
00049 QCheckBox* Dehyphen;
00050 QCheckBox* SingleSpace;
00051 QCheckBox* Unindent;
00052 QCheckBox* Reparagraph;
00053 QCheckBox* DoubleSpace;
00054 QCheckBox* Remap;
00055 QCheckBox* Embolden;
00056 QCheckBox* FullJustify;
00057 QCheckBox* FixGraphics;
00058 QCheckBox* hyphenate;
00059
00060 QCheckBox* prepalm;
00061 QCheckBox* pkern;
00062
00063
00064 QCheckBox* InlineTables;
00065 QCheckBox* Underlinelinks;
00066 };
00067
00068 class CLayoutPrefs2 : public QWidget
00069 {
00070
00071 public:
00072
00073 friend class CPrefs;
00074
00075 CLayoutPrefs2( int w, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
00076 ~CLayoutPrefs2();
00077
00078 QSpinBox* ParaLead;
00079 QSpinBox* LineLead;
00080 QSpinBox* Indent;
00081 QSpinBox *TopMargin, *BottomMargin, *LeftMargin, *RightMargin, *gfxzoom, *pageoverlap;
00082 #ifdef USECOMBO
00083 QComboBox *Markup, *fontselector, *fgsel, *bgsel;
00084 #else
00085 MenuButton *Markup, *fontselector, *fgsel, *bgsel;
00086 #endif
00087 };
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112 class CMiscPrefs : public QWidget
00113 {
00114
00115 public:
00116
00117 friend class CPrefs;
00118
00119 CMiscPrefs( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
00120 ~CMiscPrefs();
00121
00122 QCheckBox *annotation, *dictionary, *clipboard, *boutput;
00123 QCheckBox *Depluck, *Dejpluck, *Continuous, *DoubleBuffer;
00124
00125 #ifdef USECOMBO
00126 QComboBox *bgtype, *minibarcol;
00127 #else
00128 MenuButton *bgtype, *minibarcol;
00129 #endif
00130 };
00131
00132 class CScrollPrefs : public QWidget
00133 {
00134
00135 public:
00136
00137 friend class CPrefs;
00138
00139 CScrollPrefs( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
00140 ~CScrollPrefs();
00141
00142 QSpinBox *scrollstep;
00143
00144 #ifdef USECOMBO
00145 QComboBox *scrollcolor, *scrolltype, *outcodec;
00146 #else
00147 MenuButton *scrollcolor, *scrolltype, *outcodec;
00148 #endif
00149 };
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185 class CInterPrefs : public QWidget
00186 {
00187
00188 public:
00189
00190 friend class CPrefs;
00191
00192 CInterPrefs( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
00193 ~CInterPrefs();
00194
00195 QCheckBox *ideogram, *propfontchange, *SwapMouse, *twotouch;
00196 #ifdef USECOMBO
00197 QComboBox* encoding;
00198 #else
00199 MenuButton* encoding;
00200 #endif
00201 QSpinBox* ideogramwidth;
00202 QLineEdit *application, *message;
00203 };
00204
00205
00206 class CPrefs : public QDialog
00207 {
00208 Q_OBJECT
00209 CLayoutPrefs* layout;
00210 CLayoutPrefs2* layout2;
00211 CMiscPrefs* misc;
00212 CScrollPrefs* scroll;
00213 CInterPrefs* inter;
00214
00215 void keyPressEvent(QKeyEvent* e)
00216 {
00217 switch (e->key())
00218 {
00219 case Key_Escape:
00220 e->accept();
00221 reject();
00222 break;
00223 case Key_Space:
00224 case Key_Return:
00225 e->accept();
00226 accept();
00227 break;
00228 default:
00229 QWidget::keyPressEvent(e);
00230 }
00231 }
00232 public:
00233 CPrefs(int w, bool fs = true, QWidget* parent = 0, const char* name = 0);
00234 ~CPrefs()
00235 {
00236 }
00237 bool hyphenate() { return layout->hyphenate->isChecked(); }
00238 void hyphenate(bool _v) { layout->hyphenate->setChecked(_v); }
00239
00240
00241
00242
00243 bool StripCR() { return layout->StripCR->isChecked(); }
00244 bool InlineTables() { return layout->InlineTables->isChecked(); }
00245 bool repalm() { return layout->prepalm->isChecked(); }
00246 bool UnderlineLink() { return layout->Underlinelinks->isChecked(); }
00247 bool kern() { return layout->pkern->isChecked(); }
00248 bool Dehyphen() { return layout->Dehyphen->isChecked(); }
00249 bool SingleSpace() { return layout->SingleSpace->isChecked(); }
00250 bool Unindent() { return layout->Unindent->isChecked(); }
00251 bool Reparagraph() { return layout->Reparagraph->isChecked(); }
00252 bool DoubleSpace() { return layout->DoubleSpace->isChecked(); }
00253 bool Remap() { return layout->Remap->isChecked(); }
00254 bool Embolden() { return layout->Embolden->isChecked(); }
00255 bool FullJustify() { return layout->FullJustify->isChecked(); }
00256
00257
00258 bool FixGraphics() { return layout->FixGraphics->isChecked(); }
00259 int ParaLead() { return layout2->ParaLead->value(); }
00260 int LineLead() { return layout2->LineLead->value(); }
00261 int TopMargin() { return layout2->TopMargin->value(); }
00262 int BottomMargin() { return layout2->BottomMargin->value(); }
00263 int LeftMargin() { return layout2->LeftMargin->value(); }
00264 int RightMargin() { return layout2->RightMargin->value(); }
00265 int Indent() { return layout2->Indent->value(); }
00266 int Markup() { return layout2->Markup->currentItem(); }
00267 QString Font() { return layout2->fontselector->currentText(); }
00268
00269
00270 void StripCR(bool v) { layout->StripCR->setChecked(v); }
00271 void InlineTables(bool v) { layout->InlineTables->setChecked(v); }
00272 void repalm(bool v) { layout->prepalm->setChecked(v); }
00273 void UnderlineLink(bool v) { layout->Underlinelinks->setChecked(v); }
00274 void kern(bool v) { layout->pkern->setChecked(v); }
00275 void Dehyphen(bool v) { layout->Dehyphen->setChecked(v); }
00276 void SingleSpace(bool v) { layout->SingleSpace->setChecked(v); }
00277 void Unindent(bool v) { layout->Unindent->setChecked(v); }
00278 void Reparagraph(bool v) { layout->Reparagraph->setChecked(v); }
00279 void DoubleSpace(bool v) { layout->DoubleSpace->setChecked(v); }
00280 void Remap(bool v) { layout->Remap->setChecked(v); }
00281 void Embolden(bool v) { layout->Embolden->setChecked(v); }
00282 void FullJustify(bool v) { layout->FullJustify->setChecked(v); }
00283
00284
00285 void FixGraphics(bool v) { layout->FixGraphics->setChecked(v); }
00286 void ParaLead(int v) { layout2->ParaLead->setValue(v); }
00287 void LineLead(int v) { layout2->LineLead->setValue(v); }
00288 void TopMargin(int v) { layout2->TopMargin->setValue(v); }
00289 void BottomMargin(int v) { layout2->BottomMargin->setValue(v); }
00290 void LeftMargin(int v) { layout2->LeftMargin->setValue(v); }
00291 void RightMargin(int v) { layout2->RightMargin->setValue(v); }
00292 void Indent(int v) { layout2->Indent->setValue(v); }
00293 #ifdef USECOMBO
00294 void Markup(int v) { layout2->Markup->setCurrentItem(v); }
00295 #else
00296 void Markup(int v) { layout2->Markup->select(v); }
00297 #endif
00298 #ifdef USECOMBO
00299 void bgtype(int v) { misc->bgtype->setCurrentItem(v); }
00300 void scrollcolor(int v) { scroll->scrollcolor->setCurrentItem(v); }
00301 void minibarcol(int v) { misc->minibarcol->setCurrentItem(v); }
00302 #else
00303 void bgtype(int v) { misc->bgtype->select(v); }
00304 void scrollcolor(int v) { scroll->scrollcolor->select(v); }
00305 void minibarcol(int v) { misc->minibarcol->select(v); }
00306 #endif
00307 int bgtype() { return misc->bgtype->currentItem(); }
00308 int scrollcolor() { return scroll->scrollcolor->currentItem(); }
00309 int minibarcol() { return misc->minibarcol->currentItem(); }
00310
00311
00312 #ifdef USECOMBO
00313 void foreground(int v) { layout2->fgsel->setCurrentItem(v); }
00314 #else
00315 void foreground(int v) { layout2->fgsel->select(v); }
00316 #endif
00317 int foreground() { return layout2->fgsel->currentItem(); }
00318
00319 #ifdef USECOMBO
00320 void background(int v) { layout2->bgsel->setCurrentItem(v); }
00321 #else
00322 void background(int v) { layout2->bgsel->select(v); }
00323 #endif
00324 int background() { return layout2->bgsel->currentItem(); }
00325
00326
00327 #ifdef USECOMBO
00328 void Font(QString& s)
00329 {
00330 for (int i = 1; i <= layout2->fontselector->count(); i++)
00331 {
00332 if (layout2->fontselector->text(i) == s)
00333 {
00334 layout2->fontselector->setCurrentItem(i);
00335 break;
00336 }
00337 }
00338 }
00339 #else
00340 void Font(QString& s) { layout2->fontselector->select(s); }
00341 #endif
00342
00343 #ifdef USECOMBO
00344 void outcodec(QString& s)
00345 {
00346 for (int i = 1; i <= scroll->outcodec->count(); i++)
00347 {
00348 if (scroll->outcodec->text(i) == s)
00349 {
00350 scroll->outcodec->setCurrentItem(i);
00351 break;
00352 }
00353 }
00354 }
00355 #else
00356 void outcodec(QString& s) { scroll->outcodec->select(s); }
00357 #endif
00358 QString outcodec() { return scroll->outcodec->currentText(); }
00359
00360 void miscoutput(bool v) { return misc->boutput->setChecked(v); }
00361 bool miscoutput() { return misc->boutput->isChecked(); }
00362
00363 bool Depluck() { return misc->Depluck->isChecked(); }
00364 void Depluck(bool v) { misc->Depluck->setChecked(v); }
00365 bool Dejpluck() { return misc->Dejpluck->isChecked(); }
00366 void Dejpluck(bool v) { misc->Dejpluck->setChecked(v); }
00367 bool Continuous() { return misc->Continuous->isChecked(); }
00368 void Continuous(bool v) { misc->Continuous->setChecked(v); }
00369 bool DoubleBuffer() { return misc->DoubleBuffer->isChecked(); }
00370 void DoubleBuffer(bool v) { misc->DoubleBuffer->setChecked(v); }
00371 bool SwapMouse() { return inter->SwapMouse->isChecked(); }
00372 void SwapMouse(bool v) { inter->SwapMouse->setChecked(v); }
00373
00374
00375 void dictApplication(const QString& v) { inter->application->setText(v); }
00376 QString dictApplication() { return inter->application->text(); }
00377 void dictMessage(const QString& v) { inter->message->setText(v); }
00378 QString dictMessage() { return inter->message->text(); }
00379
00380 void miscannotation(bool v) { misc->annotation->setChecked(v); }
00381 void miscdictionary(bool v) { misc->dictionary->setChecked(v); }
00382 void miscclipboard(bool v) { misc->clipboard->setChecked(v); }
00383 bool miscannotation() { return misc->annotation->isChecked(); }
00384 bool miscdictionary() { return misc->dictionary->isChecked(); }
00385 bool miscclipboard() { return misc->clipboard->isChecked(); }
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401 int gfxsize() { return layout2->gfxzoom->value()/10; }
00402 void gfxsize(int v) { layout2->gfxzoom->setValue(10*v); }
00403 int pageoverlap() { return layout2->pageoverlap->value(); }
00404 void pageoverlap(int v) { layout2->pageoverlap->setValue(v); }
00405
00406 bool twotouch() { return inter->twotouch->isChecked(); }
00407 void twotouch(bool v) { inter->twotouch->setChecked(v); }
00408
00409 bool ideogram() { return inter->ideogram->isChecked(); }
00410 void ideogram(bool v) { inter->ideogram->setChecked(v); }
00411
00412 int ideogramwidth() { return inter->ideogramwidth->value(); }
00413 void ideogramwidth(int v) { inter->ideogramwidth->setValue(v); }
00414
00415 bool propfontchange() { return inter->propfontchange->isChecked(); }
00416 void propfontchange(bool v) { inter->propfontchange->setChecked(v); }
00417
00418 int encoding() { return inter->encoding->currentItem(); }
00419 int scrolltype() { return scroll->scrolltype->currentItem(); }
00420 #ifdef USECOMBO
00421 void encoding(int v) { inter->encoding->setCurrentItem(v); }
00422 void scrolltype(int v) { scroll->scrolltype->setCurrentItem(v); }
00423 #else
00424 void encoding(int v) { inter->encoding->select(v); }
00425 void scrolltype(int v) { scroll->scrolltype->select(v); }
00426 #endif
00427 void scrollstep(int v) { scroll->scrollstep->setValue(v); }
00428 int scrollstep() { return scroll->scrollstep->value(); }
00429 };
00430 #endif // CPREFS_H