karm

preferences.h
1#ifndef KARM_PREFERENCES_H
2#define KARM_PREFERENCES_H
3
4#include <kdialogbase.h>
5
6class TQCheckBox;
7class TQLabel;
8class TQSpinBox;
9class TQString;
10class KURLRequester;
11
16class Preferences :public KDialogBase
17{
18 TQ_OBJECT
19
20
21 public:
22 static Preferences *instance( const TQString& icsfile = "" );
23 void disableIdleDetection();
24
25 // Retrive information about settings
26 bool detectIdleness() const;
27 int idlenessTimeout() const;
28 TQString iCalFile() const;
29 TQString activeCalendarFile() const;
30 bool autoSave() const;
31 bool logging() const;
32 int autoSavePeriod() const;
33 bool promptDelete() const;
34 TQString setPromptDelete( bool prompt );
35 bool displayColumn(int n) const;
36 TQString userRealName() const;
37
38 void emitSignals();
39 bool readBoolEntry( const TQString& uid );
40 void writeEntry( const TQString &key, bool value );
41 void deleteEntry( const TQString &key );
42
43 public slots:
44 void showDialog();
45 void load();
46 void save();
47
48 signals:
49 void detectIdleness(bool on);
50 void idlenessTimeout(int minutes);
51 void iCalFile(TQString);
52 void autoSave(bool on);
53 void autoSavePeriod(int minutes);
54 void setupChanged();
55
56 protected slots:
57 virtual void slotOk();
58 virtual void slotCancel();
59 void idleDetectCheckBoxChanged();
60 void autoSaveCheckBoxChanged();
61
62 private:
63 void makeDisplayPage();
64 void makeBehaviorPage();
65 void makeStoragePage();
66
67 Preferences( const TQString& icsfile = "" );
68 static Preferences *_instance;
69 bool _unsavedChanges;
70
71 // Widgets
72 TQCheckBox *_doIdleDetectionW, *_doAutoSaveW, *_promptDeleteW;
73 TQCheckBox *_displayTimeW, *_displaySessionW,
74 *_displayTotalTimeW, *_displayTotalSessionW;
75 TQCheckBox *_loggingW;
76 TQLabel *_idleDetectLabelW, *_displayColumnsLabelW;
77 TQSpinBox *_idleDetectValueW, *_autoSaveValueW;
78 KURLRequester *_iCalFileW ;
79
80 // Values
81 bool _doIdleDetectionV, _doAutoSaveV, _promptDeleteV, _loggingV;
82 bool _displayColumnV[4];
83 int _idleDetectValueV, _autoSaveValueV;
84 TQString _iCalFileV;
85
87 TQString _userRealName;
88};
89
90#endif // KARM_PREFERENCES_H
91
Provide an interface to the configuration options for the program.
Definition: preferences.h:17