summaryrefslogtreecommitdiff
path: root/utils/themeeditor/projectsettings.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor/projectsettings.h')
-rw-r--r--utils/themeeditor/projectsettings.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/utils/themeeditor/projectsettings.h b/utils/themeeditor/projectsettings.h
new file mode 100644
index 0000000000..ed785ac02c
--- /dev/null
+++ b/utils/themeeditor/projectsettings.h
@@ -0,0 +1,71 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2010 Robert Bieber
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef PROJCETSETTINGS_H
23#define PROJECTSETTINGS_H
24
25#include "projectmodel.h"
26#include <QHash>
27
28class ProjectSettings : public ProjectNode
29{
30public:
31 ProjectSettings(QHash<QString, QString>& settings, ProjectModel* model,
32 ProjectNode* parent);
33 virtual ~ProjectSettings();
34
35 virtual ProjectNode* parent() const;
36 virtual ProjectNode* child(int row) const;
37 virtual int numChildren() const;
38 virtual int row() const;
39 virtual QVariant data(int column) const;
40 virtual Qt::ItemFlags flags(int column) const;
41 virtual void activated();
42
43private:
44 ProjectNode* parentLink;
45
46};
47
48/* A class to enumerate a single file */
49class ProjectSetting: public ProjectNode
50{
51public:
52 ProjectSetting(QPair<QString, QString> setting, ProjectModel* model,
53 ProjectNode* parent);
54 virtual ~ProjectSetting();
55
56 virtual ProjectNode* parent() const{ return parentLink; }
57 virtual ProjectNode* child(int row) const{ return 0; }
58 virtual int numChildren() const{ return 0; }
59 virtual int row() const{
60 return parentLink->indexOf(const_cast<ProjectSetting*>(this));
61 }
62 virtual QVariant data(int column) const;
63 virtual Qt::ItemFlags flags(int column) const;
64 virtual void activated();
65
66private:
67 ProjectNode* parentLink;
68 QPair<QString, QString> setting;
69};
70
71#endif // PROJECTSETTINGS_H