summaryrefslogtreecommitdiff
path: root/utils/themeeditor/parsetreemodel.h
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-05-26 21:13:14 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-05-26 21:13:14 +0000
commit565cd0096393dcd3a33b546d76714c64c2c786e3 (patch)
tree2b1882d987048bb00cd394a50f1cb24585b08af5 /utils/themeeditor/parsetreemodel.h
parent28a7c5d3692e59b5c80a9f713cf931b6453cb1ca (diff)
downloadrockbox-565cd0096393dcd3a33b546d76714c64c2c786e3.tar.gz
rockbox-565cd0096393dcd3a33b546d76714c64c2c786e3.zip
Trying to implement QAbstractItemModel for parse trees, haven't got it working yet (current state will spawn an empty treeview window)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26318 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/parsetreemodel.h')
-rw-r--r--utils/themeeditor/parsetreemodel.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/utils/themeeditor/parsetreemodel.h b/utils/themeeditor/parsetreemodel.h
new file mode 100644
index 0000000000..78484eb5f4
--- /dev/null
+++ b/utils/themeeditor/parsetreemodel.h
@@ -0,0 +1,59 @@
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
22extern "C"
23{
24#include "skin_parser.h"
25#include "skin_debug.h"
26}
27
28#ifndef PARSETREEMODEL_H
29#define PARSETREEMODEL_H
30
31#include <QAbstractItemModel>
32#include <QList>
33
34#include "parsetreenode.h"
35
36class ParseTreeModel : public QAbstractItemModel
37{
38
39 Q_OBJECT
40
41public:
42 /* Initializes a tree with a WPS document in a string */
43 ParseTreeModel(char* wps, QObject* parent = 0);
44 virtual ~ParseTreeModel();
45
46 QModelIndex index(int row, int column, const QModelIndex& parent) const;
47 QModelIndex parent(const QModelIndex &child) const;
48 int rowCount(const QModelIndex &parent) const;
49 int columnCount(const QModelIndex &parent) const;
50 QVariant data(const QModelIndex &index, int role) const;
51
52private:
53 ParseTreeNode* root;
54 struct skin_element* wps;
55};
56
57
58
59#endif // PARSETREEMODEL_H