Plasma
declarativewidget.h
Go to the documentation of this file.
00001 /* 00002 * Copyright 2010 Marco Martin <mart@kde.org> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU Library General Public License as 00006 * published by the Free Software Foundation; either version 2, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details 00013 * 00014 * You should have received a copy of the GNU Library General Public 00015 * License along with this program; if not, write to the 00016 * Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef PLASMA_DECLARATIVEWIDGET_H 00021 #define PLASMA_DECLARATIVEWIDGET_H 00022 00023 #include <QtGui/QGraphicsWidget> 00024 00025 #include <plasma/plasma_export.h> 00026 00027 class QDeclarativeEngine; 00028 class QDeclarativeComponent; 00029 00030 namespace Plasma 00031 { 00032 00033 class DeclarativeWidgetPrivate; 00034 00048 class PLASMA_EXPORT DeclarativeWidget : public QGraphicsWidget 00049 { 00050 Q_OBJECT 00051 00052 Q_PROPERTY(QString qmlPath READ qmlPath WRITE setQmlPath) 00053 Q_PROPERTY(bool initializationDelayed READ isInitializationDelayed WRITE setInitializationDelayed) 00054 Q_PROPERTY(QObject * rootObject READ rootObject) 00055 00056 public: 00057 00063 explicit DeclarativeWidget(QGraphicsWidget *parent = 0); 00064 ~DeclarativeWidget(); 00065 00071 void setQmlPath(const QString &path); 00072 00076 QString qmlPath() const; 00077 00087 void setInitializationDelayed(const bool delay); 00088 00093 bool isInitializationDelayed() const; 00094 00098 QDeclarativeEngine* engine(); 00099 00103 QObject *rootObject() const; 00104 00108 QDeclarativeComponent *mainComponent() const; 00109 00110 protected: 00111 void resizeEvent(QGraphicsSceneResizeEvent *event); 00112 00113 Q_SIGNALS: 00117 void finished(); 00118 00119 private: 00120 friend class DeclarativeWidgetPrivate; 00121 DeclarativeWidgetPrivate * const d; 00122 00123 Q_PRIVATE_SLOT(d, void finishExecute()) 00124 Q_PRIVATE_SLOT(d, void scheduleExecutionEnd()) 00125 }; 00126 00127 } // namespace Plasma 00128 00129 #endif // multiple inclusion guard
KDE 4.6 API Reference