1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2010 Robert Bieber
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef SKINDOCUMENT_H
23 #define SKINDOCUMENT_H
27 #include <QHBoxLayout>
28 #include <QPlainTextEdit>
30 #include "skinhighlighter.h"
31 #include "parsetreemodel.h"
32 #include "preferencesdialog.h"
34 class SkinDocument
: public QWidget
38 static QString
fileFilter()
40 return tr("WPS Files (*.wps *.rwps);;"
41 "SBS Files (*.sbs *.rsbs);;"
42 "FMS Files (*.fms *.rfms);;"
43 "All Skin Files (*.wps *.rwps *.sbs "
44 "*.rsbs *.fms *.rfms);;"
48 SkinDocument(QLabel
* statusLabel
, QWidget
*parent
= 0);
49 SkinDocument(QLabel
* statusLabel
, QString file
, QWidget
* parent
= 0);
50 virtual ~SkinDocument();
52 void connectPrefs(PreferencesDialog
* prefs
);
54 ParseTreeModel
* getModel(){ return model
; }
55 QString
getTitle(){ return title
; }
56 QString
getStatus(){ return parseStatus
; }
57 void genCode(){ editor
->document()->setPlainText(model
->genCode()); }
65 void titleChanged(QString
);
68 void settingsChanged();
82 QPlainTextEdit
* editor
;
84 SkinHighlighter
* highlighter
;
85 ParseTreeModel
* model
;
90 #endif // SKINDOCUMENT_H