Back to index

salome-gui  6.5.0
QtxPagePrefMgr.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 // File:      QtxPagePrefMgr.h
00021 // Author:    Sergey TELKOV
00022 //
00023 #ifndef QTXPAGEPREFMGR_H
00024 #define QTXPAGEPREFMGR_H
00025 
00026 #include "QtxPreferenceMgr.h"
00027 
00028 #include "QtxPathEdit.h"
00029 #include "QtxPathListEdit.h"
00030 
00031 #include <QFrame>
00032 #include <QLabel>
00033 #include <QPointer>
00034 #include <QIcon>
00035 
00036 class QtxGridBox;
00037 class QtxFontEdit;
00038 class QtxGroupBox;
00039 class QtxComboBox;
00040 class QtxColorButton;
00041 class QtxBiColorTool;
00042 class QtxShortcutEdit;
00043 class QtxShortcutTree;
00044 class QtxBackgroundTool;
00045 
00046 class QToolBox;
00047 class QLineEdit;
00048 class QTextEdit;
00049 class QCheckBox;
00050 class QTabWidget;
00051 class QToolButton;
00052 class QListWidget;
00053 class QFileDialog;
00054 class QDateTimeEdit;
00055 class QStackedWidget;
00056 class QSlider;
00057 class QTreeWidget;
00058 
00059 class QTX_EXPORT QtxPagePrefMgr : public QFrame, public QtxPreferenceMgr
00060 {
00061   Q_OBJECT
00062 
00063 public:
00064   QtxPagePrefMgr( QtxResourceMgr*, QWidget* = 0 );
00065   virtual ~QtxPagePrefMgr();
00066 
00067   virtual QSize    sizeHint() const;
00068   virtual QSize    minimumSizeHint() const;
00069 
00070   virtual void     updateContents();
00071 
00072 signals:
00073   void             resourceChanged( int );
00074   void             resourceChanged( QString&, QString& );
00075   void             resourcesChanged( const QMap<int, QString>& );
00076 
00077 public slots:
00078   virtual void     setVisible( bool );
00079 
00080 protected:
00081   virtual void     itemAdded( QtxPreferenceItem* );
00082   virtual void     itemRemoved( QtxPreferenceItem* );
00083   virtual void     itemChanged( QtxPreferenceItem* );
00084 
00085   virtual QVariant optionValue( const QString& ) const;
00086   virtual void     setOptionValue( const QString&, const QVariant& );
00087 
00088 private:
00089   void             initialize() const;
00090   void             initialize( QtxPreferenceItem* );
00091 
00092 private:
00093   QtxGridBox*      myBox;
00094   bool             myInit;
00095 };
00096 
00097 class QTX_EXPORT QtxPagePrefItem : public QtxPreferenceItem
00098 {
00099   class Listener;
00100 
00101 public:
00102   QtxPagePrefItem( const QString&, QtxPreferenceItem* = 0,
00103                    const QString& = QString(), const QString& = QString() );
00104   virtual ~QtxPagePrefItem();
00105 
00106   QWidget*          widget() const;
00107 
00108   virtual void      activate();
00109 
00110 protected:
00111   void              setWidget( QWidget* );
00112 
00113   virtual void      itemAdded( QtxPreferenceItem* );
00114   virtual void      itemRemoved( QtxPreferenceItem* );
00115   virtual void      itemChanged( QtxPreferenceItem* );
00116 
00117   void              pageChildItems( QList<QtxPagePrefItem*>&, const bool = false ) const;
00118 
00119   virtual void      store();
00120   virtual void      retrieve();
00121 
00122   virtual void      widgetShown();
00123   virtual void      widgetHided();
00124 
00125   virtual void      ensureVisible( QtxPreferenceItem* );
00126 
00127 private:
00128   virtual void      contentChanged();
00129 
00130 private:
00131   QPointer<QWidget> myWidget;
00132   Listener*         myListener;
00133 };
00134 
00135 class QTX_EXPORT QtxPageNamedPrefItem : public QtxPagePrefItem
00136 {
00137 public:
00138   QtxPageNamedPrefItem( const QString&, QtxPreferenceItem* = 0,
00139                         const QString& = QString(), const QString& = QString() );
00140   virtual ~QtxPageNamedPrefItem();
00141 
00142   virtual void      setTitle( const QString& );
00143 
00144   static void       adjustLabels( QtxPagePrefItem* );
00145 
00146 protected:
00147   QLabel*           label() const;
00148   QWidget*          control() const;
00149 
00150   void              setControl( QWidget* );
00151 
00152 private:
00153   QPointer<QLabel>  myLabel;
00154   QPointer<QWidget> myControl;
00155 };
00156 
00157 class QTX_EXPORT QtxPagePrefListItem : public QObject, public QtxPagePrefItem
00158 {
00159   Q_OBJECT
00160 
00161 public:
00162   QtxPagePrefListItem( const QString&, QtxPreferenceItem* = 0,
00163                        const QString& = QString(), const QString& = QString() );
00164   virtual ~QtxPagePrefListItem();
00165 
00166   virtual void     updateContents();
00167 
00168   QString          emptyInfo() const;
00169   void             setEmptyInfo( const QString& );
00170 
00171   bool             isFixedSize() const;
00172   void             setFixedSize( const bool );
00173 
00174 private slots:
00175   void             onItemSelectionChanged();
00176 
00177 protected:
00178   virtual QVariant optionValue( const QString& ) const;
00179   virtual void     setOptionValue( const QString&, const QVariant& );
00180   virtual void     ensureVisible( QtxPreferenceItem* );
00181 
00182   virtual void     widgetShown();
00183 
00184 private:
00185   void             updateInfo();
00186   void             updateGeom();
00187   void             updateState();
00188   void             updateVisible();
00189 
00190   int              selected() const;
00191   QtxPagePrefItem* selectedItem() const;
00192   void             setSelected( const int );
00193 
00194 private:
00195   bool             myFix;
00196   QListWidget*     myList;
00197   QStackedWidget*  myStack;
00198 
00199   QString          myInfText;
00200   QLabel*          myInfLabel;
00201 };
00202 
00203 class QTX_EXPORT QtxPagePrefToolBoxItem : public QtxPagePrefItem
00204 {
00205 public:
00206   QtxPagePrefToolBoxItem( const QString&, QtxPreferenceItem* = 0,
00207                           const QString& = QString(), const QString& = QString() );
00208   virtual ~QtxPagePrefToolBoxItem();
00209 
00210   virtual void     updateContents();
00211 
00212 protected:
00213   virtual void     ensureVisible( QtxPreferenceItem* );
00214 
00215 private:
00216   void             updateToolBox();
00217 
00218 private:
00219   QToolBox*        myToolBox;
00220 };
00221 
00222 class QTX_EXPORT QtxPagePrefTabsItem : public QtxPagePrefItem
00223 {
00224 public:
00225   QtxPagePrefTabsItem( const QString&, QtxPreferenceItem* = 0,
00226                        const QString& = QString(), const QString& = QString() );
00227   virtual ~QtxPagePrefTabsItem();
00228 
00229   virtual void     updateContents();
00230 
00231   int              tabPosition() const;
00232   void             setTabPosition( const int );
00233 
00234   int              tabShape() const;
00235   void             setTabShape( const int );
00236 
00237   QSize            tabIconSize() const;
00238   void             setTabIconSize( const QSize& );
00239 
00240 protected:
00241   virtual QVariant optionValue( const QString& ) const;
00242   virtual void     setOptionValue( const QString&, const QVariant& );
00243   virtual void     ensureVisible( QtxPreferenceItem* );
00244 
00245 private:
00246   void             updateTabs();
00247 
00248 private:
00249   QTabWidget*      myTabs;
00250 };
00251 
00252 class QTX_EXPORT QtxPagePrefFrameItem : public QtxPagePrefItem
00253 {
00254 public:
00255   QtxPagePrefFrameItem( const QString&, QtxPreferenceItem* = 0,
00256                         const QString& = QString(), const QString& = QString() );
00257   virtual ~QtxPagePrefFrameItem();
00258 
00259   virtual void     updateContents();
00260 
00261   bool             stretch() const;
00262   void             setStretch( const bool );
00263 
00264   int              margin() const;
00265   void             setMargin( const int );
00266 
00267   int              spacing() const;
00268   void             setSpacing( const int );
00269 
00270   int              columns() const;
00271   void             setColumns( const int );
00272 
00273   Qt::Orientation  orientation() const;
00274   void             setOrientation( const Qt::Orientation );
00275 
00276 protected:
00277   virtual QVariant optionValue( const QString& ) const;
00278   virtual void     setOptionValue( const QString&, const QVariant& );
00279 
00280   virtual void     widgetShown();
00281 
00282 private:
00283   void             updateFrame();
00284 
00285 private:
00286   QtxGridBox*      myBox;
00287 };
00288 
00289 class QTX_EXPORT QtxPagePrefGroupItem : public QtxPagePrefItem
00290 {
00291 public:
00292   QtxPagePrefGroupItem( const QString&, QtxPreferenceItem* = 0,
00293                         const QString& = QString(), const QString& = QString() );
00294   QtxPagePrefGroupItem( const int, const QString&, QtxPreferenceItem* = 0,
00295                         const QString& = QString(), const QString& = QString() );
00296   virtual ~QtxPagePrefGroupItem();
00297 
00298   virtual void     updateContents();
00299 
00300   int              margin() const;
00301   void             setMargin( const int );
00302 
00303   int              spacing() const;
00304   void             setSpacing( const int );
00305 
00306   int              columns() const;
00307   void             setColumns( const int );
00308 
00309   Qt::Orientation  orientation() const;
00310   void             setOrientation( const Qt::Orientation );
00311 
00312   bool             isFlat() const;
00313   void             setFlat( const bool );
00314 
00315   virtual void     setResource( const QString&, const QString& );
00316 
00317   virtual void     store();
00318   virtual void     retrieve();
00319 
00320   QtxGridBox*      gridBox() const;
00321 
00322 protected:
00323   virtual QVariant optionValue( const QString& ) const;
00324   virtual void     setOptionValue( const QString&, const QVariant& );
00325 
00326   virtual void     widgetShown();
00327 
00328 private:
00329   void             updateState();
00330   void             updateGroup();
00331 
00332 private:
00333   QtxGridBox*      myBox;
00334   QtxGroupBox*     myGroup;
00335 };
00336 
00337 class QTX_EXPORT QtxPagePrefLabelItem : public QtxPagePrefItem
00338 {
00339 public:
00340   QtxPagePrefLabelItem( const QString&, QtxPreferenceItem* = 0 );
00341   QtxPagePrefLabelItem( Qt::Alignment, const QString&, QtxPreferenceItem* = 0 );
00342   virtual ~QtxPagePrefLabelItem();
00343 
00344   virtual void      setTitle( const QString& );
00345 
00346   Qt::Alignment     alignment() const;
00347   void              setAlignment( Qt::Alignment );
00348 
00349 protected:
00350   virtual QVariant optionValue( const QString& ) const;
00351   virtual void     setOptionValue( const QString&, const QVariant& );
00352 
00353 private:
00354   QPointer<QLabel>  myLabel;
00355 };
00356 
00357 class QTX_EXPORT QtxPagePrefSpaceItem : public QtxPagePrefItem
00358 {
00359 public:
00360   QtxPagePrefSpaceItem( QtxPreferenceItem* = 0 );
00361   QtxPagePrefSpaceItem( Qt::Orientation, QtxPreferenceItem* = 0 );
00362   QtxPagePrefSpaceItem( const int, const int, QtxPreferenceItem* = 0 );
00363   virtual ~QtxPagePrefSpaceItem();
00364 
00365   int              size( Qt::Orientation ) const;
00366   void             setSize( Qt::Orientation, const int );
00367 
00368   int              stretch( Qt::Orientation ) const;
00369   void             setStretch( Qt::Orientation, const int );
00370 
00371 protected:
00372   virtual QVariant optionValue( const QString& ) const;
00373   virtual void     setOptionValue( const QString&, const QVariant& );
00374 
00375 private:
00376   void             initialize( const int, const int, const int, const int );
00377 };
00378 
00379 class QTX_EXPORT QtxPagePrefCheckItem : public QtxPagePrefItem
00380 {
00381 public:
00382   QtxPagePrefCheckItem( const QString&, QtxPreferenceItem* = 0,
00383                         const QString& = QString(), const QString& = QString() );
00384   virtual ~QtxPagePrefCheckItem();
00385 
00386   virtual void     setTitle( const QString& );
00387 
00388   virtual void     store();
00389   virtual void     retrieve();
00390 
00391 private:
00392   QCheckBox*       myCheck;
00393 };
00394 
00395 class QTX_EXPORT QtxPagePrefEditItem : public QtxPageNamedPrefItem
00396 {
00397 public:
00398   typedef enum { String, Integer, Double } InputType;
00399 
00400 public:
00401   QtxPagePrefEditItem( const QString&, QtxPreferenceItem* = 0,
00402                        const QString& = QString(), const QString& = QString() );
00403   QtxPagePrefEditItem( const int, const QString&, QtxPreferenceItem* = 0,
00404                        const QString& = QString(), const QString& = QString() );
00405   virtual ~QtxPagePrefEditItem();
00406 
00407   int              inputType() const;
00408   void             setInputType( const int );
00409 
00410   int              decimals() const;
00411   void             setDecimals( const int );
00412   
00413   int              echoMode() const;
00414   void             setEchoMode( const int );
00415 
00416   virtual void     store();
00417   virtual void     retrieve();
00418 
00419 protected:
00420   virtual QVariant optionValue( const QString& ) const;
00421   virtual void     setOptionValue( const QString&, const QVariant& );
00422 
00423 private:
00424   void             updateEditor();
00425 
00426 private:
00427   int              myType;
00428   int              myDecimals;
00429   int              myEchoMode;
00430   QLineEdit*       myEditor;
00431 };
00432 
00433 class QTX_EXPORT QtxPagePrefSliderItem : public QObject,public QtxPageNamedPrefItem
00434 {
00435   Q_OBJECT
00436 
00437 public:
00438   QtxPagePrefSliderItem( const QString&, QtxPreferenceItem* = 0,
00439                          const QString& = QString(), const QString& = QString() );
00440   virtual ~QtxPagePrefSliderItem();
00441 
00442   int              singleStep() const;
00443   int              pageStep() const;
00444   int              minimum() const;
00445   int              maximum() const;
00446   QList<QIcon>     icons() const; 
00447 
00448   void             setSingleStep( const int& );
00449   void             setPageStep( const int& );
00450   void             setMinimum( const int& );
00451   void             setMaximum( const int& );
00452   void             setIcons( const QList<QIcon>& );
00453 
00454   virtual void     store();
00455   virtual void     retrieve();
00456 
00457 protected:
00458   virtual QVariant optionValue( const QString& ) const;
00459   virtual void     setOptionValue( const QString&, const QVariant& );
00460 
00461 private slots:
00462   void             setIcon( int );
00463 
00464 private:
00465   void             updateSlider();
00466   void             setIcons( const QVariant& );
00467 
00468 private:
00469   QSlider*         mySlider;
00470   QLabel*          myLabel;
00471   QList<QIcon>     myIcons;
00472 };
00473 
00474 class QTX_EXPORT QtxPagePrefSelectItem : public QtxPageNamedPrefItem
00475 {
00476 public:
00477   typedef enum { NoInput, String, Integer, Double } InputType;
00478 
00479 public:
00480   QtxPagePrefSelectItem( const QString&, QtxPreferenceItem* = 0,
00481                          const QString& = QString(), const QString& = QString() );
00482   QtxPagePrefSelectItem( const int, const QString&, QtxPreferenceItem* = 0,
00483                          const QString& = QString(), const QString& = QString() );
00484   virtual ~QtxPagePrefSelectItem();
00485 
00486   int              inputType() const;
00487   void             setInputType( const int );
00488 
00489   QStringList      strings() const;
00490   QList<int>       numbers() const;
00491   QList<QIcon>     icons() const;
00492 
00493   void             setStrings( const QStringList& );
00494   void             setNumbers( const QList<int>& );
00495   void             setIcons( const QList<QIcon>& );
00496 
00497   virtual void     store();
00498   virtual void     retrieve();
00499 
00500 protected:
00501   virtual QVariant optionValue( const QString& ) const;
00502   virtual void     setOptionValue( const QString&, const QVariant& );
00503 
00504 private:
00505   void             updateSelector();
00506   void             setStrings( const QVariant& );
00507   void             setNumbers( const QVariant& );
00508   void             setIcons( const QVariant& );
00509 
00510 private:
00511   int              myType;
00512   QtxComboBox*     mySelector;
00513 };
00514 
00515 class QTX_EXPORT QtxPagePrefSpinItem : public QtxPageNamedPrefItem
00516 {
00517 public:
00518   typedef enum { Integer, Double } InputType;
00519 
00520 public:
00521   QtxPagePrefSpinItem( const QString&, QtxPreferenceItem* = 0,
00522                        const QString& = QString(), const QString& = QString() );
00523   QtxPagePrefSpinItem( const int, const QString&, QtxPreferenceItem* = 0,
00524                        const QString& = QString(), const QString& = QString() );
00525   virtual ~QtxPagePrefSpinItem();
00526 
00527   QVariant         step() const;
00528   QVariant         precision() const;
00529   QVariant         minimum() const;
00530   QVariant         maximum() const;
00531 
00532   QString          prefix() const;
00533   QString          suffix() const;
00534   QString          specialValueText() const;
00535 
00536   void             setStep( const QVariant& );
00537   void             setPrecision( const QVariant& );
00538   void             setMinimum( const QVariant& );
00539   void             setMaximum( const QVariant& );
00540 
00541   void             setPrefix( const QString& );
00542   void             setSuffix( const QString& );
00543   void             setSpecialValueText( const QString& );
00544 
00545   int              inputType() const;
00546   void             setInputType( const int );
00547 
00548   virtual void     store();
00549   virtual void     retrieve();
00550 
00551 protected:
00552   virtual QVariant optionValue( const QString& ) const;
00553   virtual void     setOptionValue( const QString&, const QVariant& );
00554 
00555 private:
00556   void             updateSpinBox();
00557 
00558 private:
00559   int              myType;
00560 };
00561 
00562 class QTX_EXPORT QtxPagePrefTextItem : public QtxPageNamedPrefItem
00563 {
00564 public:
00565   QtxPagePrefTextItem( QtxPreferenceItem* = 0,
00566                        const QString& = QString(), const QString& = QString() );
00567   QtxPagePrefTextItem( const QString&, QtxPreferenceItem* = 0,
00568                        const QString& = QString(), const QString& = QString() );
00569   virtual ~QtxPagePrefTextItem();
00570 
00571   virtual void     store();
00572   virtual void     retrieve();
00573 
00574 private:
00575   QTextEdit*       myEditor;
00576 };
00577 
00578 class QTX_EXPORT QtxPagePrefColorItem : public QtxPageNamedPrefItem
00579 {
00580 public:
00581   QtxPagePrefColorItem( const QString&, QtxPreferenceItem* = 0,
00582                         const QString& = QString(), const QString& = QString() );
00583   virtual ~QtxPagePrefColorItem();
00584 
00585   virtual void     store();
00586   virtual void     retrieve();
00587 
00588 private:
00589   QtxColorButton*  myColor;
00590 };
00591 
00592 class QTX_EXPORT QtxPagePrefBiColorItem : public QtxPageNamedPrefItem
00593 {
00594 public:
00595   QtxPagePrefBiColorItem( const QString&, QtxPreferenceItem* = 0,
00596                         const QString& = QString(), const QString& = QString() );
00597   virtual ~QtxPagePrefBiColorItem();
00598 
00599   virtual QString  text() const;
00600   virtual void     setText( const QString& );
00601 
00602   virtual void     store();
00603   virtual void     retrieve();
00604 
00605 protected:
00606   virtual QVariant optionValue( const QString& ) const;
00607   virtual void     setOptionValue( const QString&, const QVariant& );
00608 
00609 private:
00610   QtxBiColorTool*  myColors;
00611 };
00612 
00613 class QTX_EXPORT QtxPagePrefFontItem : public QObject, public QtxPageNamedPrefItem
00614 {
00615   Q_OBJECT
00616 
00617 public:
00618   QtxPagePrefFontItem( const int, const QString&, QtxPreferenceItem* = 0,
00619                        const QString& = QString(), const QString& = QString() );
00620   QtxPagePrefFontItem( const QString&, QtxPreferenceItem* = 0,
00621                        const QString& = QString(), const QString& = QString() );
00622   virtual ~QtxPagePrefFontItem();
00623 
00624   int              features() const;
00625   void             setFeatures( const int );
00626 
00627   void             setMode( const int );
00628   int              mode() const;
00629 
00630   void             setFonts( const QStringList& );
00631   QStringList      fonts() const;
00632 
00633   void             setSizes( const QList<int>& = QList<int>() );
00634   QList<int>       sizes() const;
00635 
00636   virtual void     store();
00637   virtual void     retrieve();
00638 
00639 protected:
00640   virtual QVariant optionValue( const QString& ) const;
00641   virtual void     setOptionValue( const QString&, const QVariant& );
00642 
00643 private:
00644   QtxFontEdit*     myFont;
00645 };
00646 
00647 class QTX_EXPORT QtxPagePrefPathItem : public QtxPageNamedPrefItem
00648 {
00649 public:
00650   QtxPagePrefPathItem( const Qtx::PathType, const QString&, QtxPreferenceItem* = 0,
00651                        const QString& = QString(), const QString& = QString() );
00652   QtxPagePrefPathItem( const QString&, QtxPreferenceItem* = 0,
00653                        const QString& = QString(), const QString& = QString() );
00654   virtual ~QtxPagePrefPathItem();
00655 
00656   Qtx::PathType    pathType() const;
00657   void             setPathType( const Qtx::PathType );
00658 
00659   QString          pathFilter() const;
00660   void             setPathFilter( const QString& );
00661 
00662   virtual void     store();
00663   virtual void     retrieve();
00664 
00665 protected:
00666   virtual QVariant optionValue( const QString& ) const;
00667   virtual void     setOptionValue( const QString&, const QVariant& );
00668 
00669 private:
00670   QtxPathEdit*     myPath;
00671 };
00672 
00673 class QTX_EXPORT QtxPagePrefPathListItem : public QtxPageNamedPrefItem
00674 {
00675 public:
00676   QtxPagePrefPathListItem( QtxPreferenceItem* = 0,
00677                            const QString& = QString(), const QString& = QString() );
00678   QtxPagePrefPathListItem( const QString&, QtxPreferenceItem* = 0,
00679                            const QString& = QString(), const QString& = QString() );
00680   QtxPagePrefPathListItem( const Qtx::PathType, const QString&, QtxPreferenceItem* = 0,
00681                            const QString& = QString(), const QString& = QString() );
00682   virtual ~QtxPagePrefPathListItem();
00683 
00684   Qtx::PathType    pathType() const;
00685   void             setPathType( const Qtx::PathType );
00686 
00687   virtual void     store();
00688   virtual void     retrieve();
00689 
00690 protected:
00691   virtual QVariant optionValue( const QString& ) const;
00692   virtual void     setOptionValue( const QString&, const QVariant& );
00693 
00694 private:
00695   QtxPathListEdit* myPaths;
00696 };
00697 
00698 class QTX_EXPORT QtxPagePrefDateTimeItem : public QtxPageNamedPrefItem
00699 {
00700 public:
00701   typedef enum { Date, Time, DateTime } InputType;
00702 
00703 public:
00704   QtxPagePrefDateTimeItem( const QString&, QtxPreferenceItem* = 0,
00705                            const QString& = QString(), const QString& = QString() );
00706   QtxPagePrefDateTimeItem( const int, const QString&, QtxPreferenceItem* = 0,
00707                            const QString& = QString(), const QString& = QString() );
00708   virtual ~QtxPagePrefDateTimeItem();
00709 
00710   int              inputType() const;
00711   void             setInputType( const int );
00712 
00713   bool             calendar() const;
00714   void             setCalendar( const bool );
00715 
00716   QDate            maximumDate() const;
00717   QTime            maximumTime() const;
00718   QDate            minimumDate() const;
00719   QTime            minimumTime() const;
00720 
00721   void             setMaximumDate( const QDate& );
00722   void             setMaximumTime( const QTime& );
00723   void             setMinimumDate( const QDate& );
00724   void             setMinimumTime( const QTime& );
00725 
00726   virtual void     store();
00727   virtual void     retrieve();
00728 
00729 protected:
00730   virtual QVariant optionValue( const QString& ) const;
00731   virtual void     setOptionValue( const QString&, const QVariant& );
00732 
00733 private:
00734   void             updateDateTime();
00735 
00736 private:
00737   int              myType;
00738   QDateTimeEdit*   myDateTime;
00739 };
00740 
00741 class QTX_EXPORT QtxPagePrefShortcutBtnsItem : public QtxPageNamedPrefItem
00742 {
00743 public:
00744   QtxPagePrefShortcutBtnsItem( const QString&, QtxPreferenceItem* = 0,
00745                                const QString& = QString(), const QString& = QString() );
00746   virtual ~QtxPagePrefShortcutBtnsItem();
00747   virtual void     store();
00748   virtual void     retrieve();
00749 
00750 private:
00751   QtxShortcutEdit* myShortcut;
00752 };
00753 
00754 class QTX_EXPORT QtxPagePrefShortcutTreeItem : public QtxPageNamedPrefItem
00755 {
00756 public:
00757   QtxPagePrefShortcutTreeItem( const QString&, QtxPreferenceItem* = 0, 
00758                                const QString& = QString(), const QString& = QString() );
00759   virtual ~QtxPagePrefShortcutTreeItem();
00760   virtual void     store();
00761   virtual void     retrieve();
00762                                                            
00763 private:
00764   QtxShortcutTree* myShortcutTree;
00765   QString          mySection;
00766 };
00767 
00768 class QTX_EXPORT QtxPagePrefBackgroundItem : public QObject, public QtxPageNamedPrefItem
00769 {
00770   Q_OBJECT
00771 
00772 public:
00773   QtxPagePrefBackgroundItem( const QString&, QtxPreferenceItem* = 0,
00774                           const QString& = QString(), const QString& = QString() );
00775   virtual ~QtxPagePrefBackgroundItem();
00776 
00777   void               gradients( QStringList&, QIntList& ) const;
00778   void               setGradients( const QStringList&, const QIntList& = QIntList() );
00779 
00780   bool               isModeAllowed( Qtx::BackgroundMode ) const;
00781   void               setModeAllowed( Qtx::BackgroundMode, bool );
00782 
00783   bool               isTextureModeAllowed( Qtx::TextureMode ) const;
00784   void               setTextureModeAllowed( Qtx::TextureMode, bool );
00785 
00786   bool               isTextureAllowed() const;
00787   void               setTextureAllowed( bool );
00788 
00789   QString            imageFormats() const;
00790   void               setImageFormats( const QString& );
00791 
00792   Qt::Orientation    orientation() const;
00793   void               setOrientation( Qt::Orientation );
00794 
00795   virtual void       store();
00796   virtual void       retrieve();
00797 
00798 protected:
00799   virtual QVariant   optionValue( const QString& ) const;
00800   virtual void       setOptionValue( const QString&, const QVariant& );
00801 
00802 private:
00803   QtxBackgroundTool* myBgTool;
00804 };
00805 
00806 class QtxUserDefinedContent: public QWidget
00807 {
00808  public:
00809   QtxUserDefinedContent(QWidget* parent = 0, Qt::WindowFlags f = 0 ):QWidget(parent, f) {};
00810   virtual void store(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref) = 0;
00811   virtual void retrieve(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref) = 0;
00812 };
00813 
00814 
00815 class QTX_EXPORT QtxUserDefinedItem : public QtxPageNamedPrefItem
00816 {
00817 public:
00818   QtxUserDefinedItem( QtxPreferenceItem* parent );
00819 
00820   void setContent( QtxUserDefinedContent* theContent );
00821 
00822   virtual void store();
00823   virtual void retrieve();
00824 
00825 protected:
00826   virtual QVariant optionValue( const QString& theName ) const;
00827   virtual void     setOptionValue( const QString& theName, const QVariant& theVal );
00828 
00829 private:
00830   QtxUserDefinedContent* myContent;
00831 };
00832 
00833 #endif