1 | /*************************************************************************** |
2 | * Copyright 2012 Viranch Mehta <viranch.mehta@gmail.com> * |
3 | * * |
4 | * This program is free software; you can redistribute it and/or modify * |
5 | * it under the terms of the GNU Library General Public License * |
6 | * version 2 as published by the Free Software Foundation * |
7 | * * |
8 | * This program is distributed in the hope that it will be useful, * |
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
11 | * GNU Library General Public License for more details. * |
12 | * * |
13 | * You should have received a copy of the GNU Library General Public * |
14 | * License along with this program; if not, write to the * |
15 | * Free Software Foundation, Inc., * |
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * |
17 | ***************************************************************************/ |
18 | |
19 | #ifndef KGDECLARATIVEVIEW_H |
20 | #define KGDECLARATIVEVIEW_H |
21 | |
22 | #include <QDeclarativeView> |
23 | |
24 | #include <libkdegames_export.h> |
25 | |
26 | class KgThemeProvider; |
27 | |
28 | /** |
29 | * @class KgDeclarativeView |
30 | * @since 4.11 |
31 | * @short A QDeclarativeView that adds KDE specific module paths and javascript bindings. |
32 | * |
33 | * This class is a QDeclarativeView that sets up a KDE specific environment |
34 | * like custom QML module paths and javascript function bindings (like i18n) |
35 | * to the declarative view. |
36 | * |
37 | * For porting KDE games to QML, the central widget of main window is to |
38 | * be replaced by KgDeclarativeView (inside which all the .qml graphics take |
39 | * place), leaving the toolbars, menubars and statusbars as they are, and |
40 | * updating their specifics via signals from QML to C++ part of the code. |
41 | */ |
42 | class KDEGAMES_EXPORT KgDeclarativeView : public QDeclarativeView |
43 | { |
44 | Q_OBJECT |
45 | public: |
46 | ///Construcs a new KgDeclarativeView with KDE specific environment. |
47 | ///@param parent The parent widget for this view (usually the main |
48 | ///window of the game) |
49 | KgDeclarativeView(QWidget *parent=0); |
50 | |
51 | private: |
52 | class Private; |
53 | Private* const d; |
54 | |
55 | }; |
56 | |
57 | #endif //KGDECLARATIVEVIEW_H |
58 | |