8 #define DECLARE_BOOL(key) \
9 bool is##key() const; \
10 bool def##key() const; \
11 void set##key(bool value)
13 #define DECLARE_OBJECT(Type, key) \
14 Type get##key() const; \
15 Type def##key() const; \
16 void set##key(const Type &value)
18 #define DECLARE_PRIMITIVE(Type, key) \
19 Type get##key() const; \
20 Type def##key() const; \
21 void set##key(Type value)
23 class Preferences : public QSettings
27 explicit Preferences(QObject *parent = 0);
28 Preferences(const QString &path, QObject *parent = 0);
30 void restoreModel(const QString &side, FolderModel *m);
31 void saveModel(const QString &side, const FolderModel *m);
33 void restoreWindow(QMainWindow *w);
34 void saveWindow(const QMainWindow *w);
36 void addBookmark(const QString &name, const QString &path);
38 QString getBookmarkEntry(int n) const;
39 QString getBookmarkPath(int n) const;
41 QColor folderViewFgColor(bool active) const;
42 QColor folderViewBgColor(bool active) const;
43 QColor folderViewMarkedFgColor(bool active) const;
44 QColor folderViewMarkedBgColor(bool active) const;
45 QColor folderViewSystemColor(bool active) const;
46 QColor folderViewHiddenColor(bool active) const;
47 QColor folderViewReadOnlyColor(bool active) const;
48 QColor locationBoxFgColor(bool active) const;
49 QColor locationBoxBgColor(bool active) const;
52 DECLARE_BOOL(CheckUpdate);
53 DECLARE_BOOL(ConfirmQuit);
54 DECLARE_BOOL(ConfirmCopy);
55 DECLARE_BOOL(AutoCloseCopy);
56 DECLARE_BOOL(ConfirmMove);
57 DECLARE_BOOL(AutoCloseMove);
58 DECLARE_BOOL(ConfirmDelete);
59 DECLARE_BOOL(AutoCloseDelete);
60 DECLARE_BOOL(ConfirmRename);
61 DECLARE_BOOL(AutoCloseRename);
62 DECLARE_BOOL(OpenAfterCreation);
63 DECLARE_BOOL(MoveAfterCreation);
65 DECLARE_OBJECT(QString, ArchiverPath);
66 DECLARE_OBJECT(QString, EditorPath);
67 DECLARE_OBJECT(QString, TerminalPath);
68 DECLARE_OBJECT(QString, CopyBehavior);
69 DECLARE_OBJECT(QString, PreferExtensions);
71 DECLARE_OBJECT(QColor, FolderViewFgColor);
72 DECLARE_OBJECT(QColor, FolderViewBgColor);
73 DECLARE_OBJECT(QColor, FolderViewMarkedFgColor);
74 DECLARE_OBJECT(QColor, FolderViewMarkedBgColor);
75 DECLARE_OBJECT(QColor, FolderViewSystemColor);
76 DECLARE_OBJECT(QColor, FolderViewHiddenColor);
77 DECLARE_OBJECT(QColor, FolderViewReadOnlyColor);
78 DECLARE_OBJECT(QColor, LocationBoxFgColor);
79 DECLARE_OBJECT(QColor, LocationBoxBgColor);
80 DECLARE_OBJECT(QColor, SearchBoxFgColor);
81 DECLARE_OBJECT(QColor, SearchBoxBgColor);
82 DECLARE_OBJECT(QColor, SearchBoxUnmatchFgColor);
83 DECLARE_OBJECT(QColor, SearchBoxUnmatchBgColor);
84 DECLARE_OBJECT(QColor, TextViewFgColor);
85 DECLARE_OBJECT(QColor, TextViewBgColor);
86 DECLARE_OBJECT(QColor, ImageViewBgColor);
88 DECLARE_PRIMITIVE(double, DarkFacotr);
89 DECLARE_PRIMITIVE(double, LineHeight);
91 DECLARE_OBJECT(QFont, FolderViewFont);
92 DECLARE_OBJECT(QFont, LocationBoxFont);
93 DECLARE_OBJECT(QFont, SearchBoxFont);
94 DECLARE_OBJECT(QFont, TextViewFont);
102 #endif // PREFERENCES_H