Fix doxygen comments that were breaking parsing.
[tagua/yd.git] / src / pref_theme.h
blobf6044f7aa0fa97f54e70b2976cb1ce9739f1531c
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 */
11 #ifndef PREFERENCES__THEME_H
12 #define PREFERENCES__THEME_H
14 #include <set>
15 #include <map>
16 #include <boost/shared_ptr.hpp>
17 #include <QDateTime>
18 #include <QDir>
19 #include "option.h"
20 #include "themeinfo.h"
21 #include "ui_pref_theme.h"
22 #include "ui_pref_theme_page.h"
24 class Settings;
25 class QAction;
26 class Variant;
28 class PrefTheme : public QWidget
29 , private Ui::PrefTheme {
30 Q_OBJECT
31 friend class PrefThemeCategory;
32 typedef class PrefThemeCategory Category;
34 typedef QList<ThemeInfo> ThemeInfoList;
35 typedef std::map<QString, Category*> CategoryMap;
37 std::map<QString, OptList> m_new_theme_options;
38 CategoryMap m_categories;
40 OptList get_file_options(const QString&, bool reload_defaults = false);
41 static ThemeInfoList to_theme_info_list(const QStringList& files, const Settings& s);
42 static int theme_ok_for_variant(const ThemeInfo&, const QString&);
43 static void update_list_view(QListWidget* list, const ThemeInfoList& themes,
44 QString variant, QString settings);
45 private Q_SLOTS:
46 void variantChanged();
48 public:
49 PrefTheme(const QString&, QWidget *parent = 0);
50 ~PrefTheme();
52 void apply();
54 static ThemeInfo getBestTheme(Variant* vi, const QString&);
58 class PrefThemeCategory : public QWidget
59 , private Ui::PrefThemePage {
60 Q_OBJECT
62 public:
63 friend class PrefTheme;
64 QAction* m_reset;
65 PrefTheme* m_parent;
66 QString m_id;
67 PrefTheme::ThemeInfoList m_themes;
68 std::map<QString, QString> m_new_themes;
69 std::map<QString, bool> m_new_use_def;
71 QLayout *m_opt_layout;
72 QWidget *m_opt_widget;
74 PrefThemeCategory(QWidget* parent, PrefTheme* owner);
76 public Q_SLOTS:
77 void reset();
78 void themeChanged();
79 void themeChecked(bool ck);
83 #endif //PREFERENCES__THEME_H