summaryrefslogtreecommitdiff
path: root/utils/themeeditor/projectmodel.h
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-06-08 21:30:28 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-06-08 21:30:28 +0000
commit61b5f0c973fb9d91f8023664c95bfc5570e2f474 (patch)
tree67c92fc88abb2345263907a48404a13d6ecfe74a /utils/themeeditor/projectmodel.h
parent007ef43a506d495953b6bbc8838fc439224fd0a1 (diff)
downloadrockbox-61b5f0c973fb9d91f8023664c95bfc5570e2f474.tar.gz
rockbox-61b5f0c973fb9d91f8023664c95bfc5570e2f474.zip
Theme Editor: Began implementing classes to display project files and settings in the project panel
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26706 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/projectmodel.h')
-rw-r--r--utils/themeeditor/projectmodel.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/utils/themeeditor/projectmodel.h b/utils/themeeditor/projectmodel.h
new file mode 100644
index 0000000000..e3bf93dcb5
--- /dev/null
+++ b/utils/themeeditor/projectmodel.h
@@ -0,0 +1,72 @@
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 PROJECTMODEL_H
23#define PROJECTMODEL_H
24
25#include <QAbstractItemModel>
26
27class ProjectNode;
28
29class ProjectModel : public QAbstractItemModel
30{
31Q_OBJECT
32public:
33 static const int numColumns = 1;
34
35 ProjectModel(QObject *parent = 0);
36 virtual ~ProjectModel();
37
38 QModelIndex index(int row, int column, const QModelIndex& parent) const;
39 QModelIndex parent(const QModelIndex &child) const;
40 int rowCount(const QModelIndex &parent) const;
41 int columnCount(const QModelIndex &parent) const;
42 QVariant data(const QModelIndex &index, int role) const;
43 QVariant headerData(int col, Qt::Orientation orientation, int role) const;
44 Qt::ItemFlags flags(const QModelIndex &index) const;
45 bool setData(const QModelIndex &index, const QVariant &value, int role);
46
47
48signals:
49
50public slots:
51
52private:
53 ProjectNode* root;
54
55};
56
57/* A simple abstract class required for categories */
58class ProjectNode
59{
60public:
61 virtual ProjectNode* parent() const = 0;
62 virtual ProjectNode* child(int row) const = 0;
63 virtual int numChildren() const = 0;
64 virtual int row() const = 0;
65 virtual QVariant data(int column) const = 0;
66 virtual QString title() const = 0;
67 virtual Qt::ItemFlags flags(const QModelIndex& index) const = 0;
68 virtual void activated(const QModelIndex& index) = 0;
69
70};
71
72#endif // PROJECTMODEL_H