karm

preferences.h

00001 #ifndef KARM_PREFERENCES_H
00002 #define KARM_PREFERENCES_H
00003 
00004 #include <kdialogbase.h>
00005 
00006 class QCheckBox;
00007 class QLabel;
00008 class QSpinBox;
00009 class QString;
00010 class KURLRequester;
00011 
00016 class Preferences :public KDialogBase
00017 {
00018   Q_OBJECT
00019 
00020   public:
00021     static Preferences *instance( const QString& icsfile = "" );
00022     void disableIdleDetection();
00023 
00024     // Retrive information about settings
00025     bool detectIdleness() const;
00026     int idlenessTimeout() const;
00027     QString iCalFile() const;
00028     QString activeCalendarFile() const;
00029     bool autoSave() const;
00030     bool logging() const;
00031     int autoSavePeriod() const;
00032     bool promptDelete() const;
00033     QString setPromptDelete( bool prompt );
00034     bool displayColumn(int n) const;
00035     QString userRealName() const;
00036 
00037     void emitSignals();
00038     bool readBoolEntry( const QString& uid );
00039     void writeEntry( const QString &key, bool value );
00040     void deleteEntry( const QString &key );
00041 
00042   public slots:
00043     void showDialog();
00044     void load();
00045     void save();
00046 
00047   signals:
00048     void detectIdleness(bool on);
00049     void idlenessTimeout(int minutes);
00050     void iCalFile(QString);
00051     void autoSave(bool on);
00052     void autoSavePeriod(int minutes);
00053     void setupChanged();
00054 
00055   protected slots:
00056     virtual void slotOk();
00057     virtual void slotCancel();
00058     void idleDetectCheckBoxChanged();
00059     void autoSaveCheckBoxChanged();
00060 
00061   private:
00062     void makeDisplayPage();
00063     void makeBehaviorPage();
00064     void makeStoragePage();
00065 
00066     Preferences( const QString& icsfile = "" );
00067     static Preferences *_instance;
00068     bool _unsavedChanges;
00069 
00070     // Widgets
00071     QCheckBox *_doIdleDetectionW, *_doAutoSaveW, *_promptDeleteW;
00072     QCheckBox *_displayTimeW, *_displaySessionW,
00073               *_displayTotalTimeW, *_displayTotalSessionW;
00074     QCheckBox *_loggingW;
00075     QLabel    *_idleDetectLabelW, *_displayColumnsLabelW;
00076     QSpinBox  *_idleDetectValueW, *_autoSaveValueW;
00077     KURLRequester *_iCalFileW ;
00078 
00079     // Values
00080     bool _doIdleDetectionV, _doAutoSaveV, _promptDeleteV, _loggingV;
00081     bool _displayColumnV[4];
00082     int  _idleDetectValueV, _autoSaveValueV;
00083     QString _iCalFileV;
00084 
00086     QString _userRealName;
00087 };
00088 
00089 #endif // KARM_PREFERENCES_H
00090 
KDE Home | KDE Accessibility Home | Description of Access Keys