f6ceb73e92b6d599b9059eea33cba4b700ef4f4d
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 <QGraphicsScene>
30 #include "skinhighlighter.h"
31 #include "parsetreemodel.h"
32 #include "preferencesdialog.h"
33 #include "codeeditor.h"
34 #include "tabcontent.h"
35 #include "projectmodel.h"
37 class SkinDocument
: public TabContent
41 static QString
fileFilter()
43 return tr("WPS Files (*.wps *.rwps);;"
44 "SBS Files (*.sbs *.rsbs);;"
45 "FMS Files (*.fms *.rfms);;"
46 "All Skin Files (*.wps *.rwps *.sbs "
47 "*.rsbs *.fms *.rfms);;"
51 SkinDocument(QLabel
* statusLabel
, ProjectModel
* project
= 0,
53 SkinDocument(QLabel
* statusLabel
, QString file
, ProjectModel
* project
= 0,
55 virtual ~SkinDocument();
57 void connectPrefs(PreferencesDialog
* prefs
);
59 ParseTreeModel
* getModel(){ return model
; }
60 QString
file() const{ return fileName
; }
61 QString
title() const{ return titleText
; }
62 QString
getStatus(){ return parseStatus
; }
63 void genCode(){ editor
->document()->setPlainText(model
->genCode()); }
64 void setProject(ProjectModel
* project
){ this->project
= project
; }
71 TabType
type() const{ return Skin
; }
73 QGraphicsScene
* scene(){ return model
->render(project
, &fileName
); }
78 void settingsChanged();
86 QString
findSetting(QString key
, QString fallback
);
96 SkinHighlighter
* highlighter
;
97 ParseTreeModel
* model
;
103 ProjectModel
* project
;
106 #endif // SKINDOCUMENT_H