KTutorial
0.5.1
|
00001 /*************************************************************************** 00002 * Copyright (C) 2008 by Daniel Calviño Sánchez <danxuliu@gmail.com> * 00003 * Copyright (C) 2009 by Daniel Calviño Sánchez <danxuliu@gmail.com> * 00004 * Copyright (C) 2010 by Daniel Calviño Sánchez <danxuliu@gmail.com> * 00005 * Copyright (C) 2011 by Daniel Calviño Sánchez <danxuliu@gmail.com> * 00006 * Copyright (C) 2012 by Daniel Calviño Sánchez <danxuliu@gmail.com> * 00007 * * 00008 * This program is free software; you can redistribute it and/or modify * 00009 * it under the terms of the GNU General Public License as published by * 00010 * the Free Software Foundation; either version 2 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * This program is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU General Public License * 00019 * along with this program; If not, see <http://www.gnu.org/licenses/>. * 00020 ***************************************************************************/ 00021 00022 #ifndef KTUTORIAL_KTUTORIAL_H 00023 #define KTUTORIAL_KTUTORIAL_H 00024 00025 #include <QtGui/QWidget> 00026 00027 #include "ktutorial_export.h" 00028 00029 #include "ObjectFinder.h" 00030 00031 class KXmlGuiWindow; 00032 00033 namespace ktutorial { 00034 class KTutorialCustomization; 00035 class Tutorial; 00036 } 00037 00038 namespace ktutorial { 00039 00077 class KTUTORIAL_EXPORT KTutorial: public QObject { 00078 Q_OBJECT 00079 public: 00080 00086 static KTutorial* self(); 00087 00091 virtual ~KTutorial(); 00092 00103 bool registerWaitForMetaObject(const QMetaObject& waitForMetaObject, 00104 const QString& typeName = QString()); 00105 00117 void setup(KXmlGuiWindow* window); 00118 00126 void setup(KTutorialCustomization* ktutorialCustomization); 00127 00138 bool registerTutorial(Tutorial* tutorial); 00139 00145 QWidget* mainApplicationWindow() const; 00146 00197 template <typename T> 00198 T findObject(const QString& name) const { 00199 return objectFinder()->findObject<T>(name, mainApplicationWindow()); 00200 } 00201 00202 private: 00203 00207 static KTutorial* sSelf; 00208 00209 class KTutorialPrivate* d; 00210 00215 KTutorial(); 00216 00222 ObjectFinder* objectFinder() const; 00223 00224 }; 00225 00226 } 00227 00228 #endif