GammaRay  2.0.0
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
tooluifactory.h
1 /*
2  This file is part of GammaRay, the Qt application inspection and
3  manipulation tool.
4 
5  Copyright (C) 2010-2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
6  Author: Volker Krause <volker.krause@kdab.com>
7 
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 2 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 #ifndef GAMMARAY_TOOLUIFACTORY_H
23 #define GAMMARAY_TOOLUIFACTORY_H
24 
25 #include <QMetaType>
26 #include <QStringList>
27 #include <QtPlugin>
28 
29 namespace GammaRay {
30 
39 {
40  public:
41  virtual inline ~ToolUiFactory()
42  {
43  }
44 
49  virtual QString id() const = 0;
50 
54  virtual bool remotingSupported() const = 0;
55 
61  virtual QWidget *createWidget(QWidget *parentWidget) = 0;
62 };
63 
67 template <typename ToolUi>
69 {
70 public:
71  virtual inline QString id() const
72  {
73  return QString(); // TODO is this a problem??
74  }
75 
76  virtual inline QWidget *createWidget(QWidget *parentWidget)
77  {
78  return new ToolUi(parentWidget);
79  }
80 
81  virtual bool remotingSupported() const
82  {
83  return true;
84  }
85 };
86 
87 }
88 
89 Q_DECLARE_INTERFACE(GammaRay::ToolUiFactory, "com.kdab.GammaRay.ToolUiFactory/1.0")
90 Q_DECLARE_METATYPE(GammaRay::ToolUiFactory *)
91 
92 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
93 #define Q_PLUGIN_METADATA(x)
94 #endif
95 
96 #endif

Klarälvdalens Datakonsult AB (KDAB)
"The Cross-Platform Experts"
http://www.kdab.com/
GammaRay
Qt-application inspection and manipulation tool
http://www.kdab.com/kdab-products/gammaray/