summaryrefslogtreecommitdiff
path: root/utils/themeeditor/gui/skindocument.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor/gui/skindocument.h')
-rw-r--r--utils/themeeditor/gui/skindocument.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/utils/themeeditor/gui/skindocument.h b/utils/themeeditor/gui/skindocument.h
new file mode 100644
index 0000000000..c6449ca627
--- /dev/null
+++ b/utils/themeeditor/gui/skindocument.h
@@ -0,0 +1,96 @@
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 SKINDOCUMENT_H
23#define SKINDOCUMENT_H
24
25#include <QWidget>
26#include <QLabel>
27#include <QHBoxLayout>
28
29#include "skinhighlighter.h"
30#include "parsetreemodel.h"
31#include "preferencesdialog.h"
32#include "codeeditor.h"
33#include "tabcontent.h"
34
35class SkinDocument : public TabContent
36{
37Q_OBJECT
38public:
39 static QString fileFilter()
40 {
41 return tr("WPS Files (*.wps *.rwps);;"
42 "SBS Files (*.sbs *.rsbs);;"
43 "FMS Files (*.fms *.rfms);;"
44 "All Skin Files (*.wps *.rwps *.sbs "
45 "*.rsbs *.fms *.rfms);;"
46 "All Files (*.*)");
47 }
48
49 SkinDocument(QLabel* statusLabel, QWidget *parent = 0);
50 SkinDocument(QLabel* statusLabel, QString file, QWidget* parent = 0);
51 virtual ~SkinDocument();
52
53 void connectPrefs(PreferencesDialog* prefs);
54
55 ParseTreeModel* getModel(){ return model; }
56 QString file() const{ return fileName; }
57 QString title() const{ return titleText; }
58 QString getStatus(){ return parseStatus; }
59 void genCode(){ editor->document()->setPlainText(model->genCode()); }
60
61 void save();
62 void saveAs();
63
64 bool requestClose();
65
66 TabType type() const{ return Skin; }
67
68signals:
69
70public slots:
71 void settingsChanged();
72 void cursorChanged();
73
74private slots:
75 void codeChanged();
76
77private:
78 void setupUI();
79
80 QString titleText;
81 QString fileName;
82 QString saved;
83 QString parseStatus;
84
85 QLayout* layout;
86 CodeEditor* editor;
87
88 SkinHighlighter* highlighter;
89 ParseTreeModel* model;
90
91 QLabel* statusLabel;
92
93 bool blockUpdate;
94};
95
96#endif // SKINDOCUMENT_H