ArmarXGuiInterface.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package
19  * @author
20  * @date
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #pragma once
25 
26 #include "ArmarXWidgetController.h"
27 
28 #include <QWidget>
29 #include <QIcon>
30 
31 class ArmarXWidgetInfo;
32 using ArmarXWidgetInfoPtr = std::shared_ptr<ArmarXWidgetInfo>;
33 
35 using WidgetCreatorMap = std::map<QString, ArmarXWidgetInfoPtr >;
36 
37 /**
38  * @brief The ArmarXWidgetInfo class
39  *
40  * \ingroup ArmarXGuiBase
41  */
43 {
44 public:
45  ArmarXWidgetInfo(WidgetCreatorFunction creatorFunction, QIcon icon, QIcon categoryIcon)
46  : creatorFunction(creatorFunction), icon(icon), categoryIcon(categoryIcon)
47  { }
48 
50  {
51  return creatorFunction();
52  }
53  QIcon getIcon() const
54  {
55  return icon;
56  }
57  QIcon getCategoryIcon() const
58  {
59  return categoryIcon;
60  }
61 
62 private:
63  WidgetCreatorFunction creatorFunction;
64  QIcon icon;
65  QIcon categoryIcon;
66 };
67 
68 /**
69  \class ArmarXGuiInterface
70  \brief The main gui interface.
71  \see ArmarXGuiPlugin
72 
73  */
75 {
76 public:
78  {
79  }
80 
81  virtual QString getPluginName()
82  {
83  return "ArmarXGuiInterface";
84  }
85 
87 };
88 
89 
90 Q_DECLARE_INTERFACE(ArmarXGuiInterface, "ArmarXGuiInterface/1.00")
91 
92 
ArmarXWidgetInfo::getIcon
QIcon getIcon() const
Definition: ArmarXGuiInterface.h:53
ArmarXWidgetInfo
The ArmarXWidgetInfo class.
Definition: ArmarXGuiInterface.h:42
WidgetCreatorFunction
armarx::ArmarXWidgetControllerPtr(* WidgetCreatorFunction)()
Definition: ArmarXGuiInterface.h:34
ArmarXWidgetInfoPtr
std::shared_ptr< ArmarXWidgetInfo > ArmarXWidgetInfoPtr
Definition: ArmarXGuiInterface.h:32
ArmarXWidgetInfo::createInstance
armarx::ArmarXWidgetControllerPtr createInstance() const
Definition: ArmarXGuiInterface.h:49
ArmarXGuiInterface
The main gui interface.
Definition: ArmarXGuiInterface.h:74
ArmarXGuiInterface::~ArmarXGuiInterface
virtual ~ArmarXGuiInterface()
Definition: ArmarXGuiInterface.h:77
ArmarXGuiInterface::getPluginName
virtual QString getPluginName()
Definition: ArmarXGuiInterface.h:81
ArmarXWidgetInfo::ArmarXWidgetInfo
ArmarXWidgetInfo(WidgetCreatorFunction creatorFunction, QIcon icon, QIcon categoryIcon)
Definition: ArmarXGuiInterface.h:45
ArmarXGuiInterface::getProvidedWidgets
virtual WidgetCreatorMap getProvidedWidgets()=0
WidgetCreatorMap
std::map< QString, ArmarXWidgetInfoPtr > WidgetCreatorMap
Definition: ArmarXGuiInterface.h:35
ArmarXWidgetController.h
IceUtil::Handle< ArmarXWidgetController >
armarx::ArmarXWidgetControllerPtr
IceUtil::Handle< ArmarXWidgetController > ArmarXWidgetControllerPtr
Definition: ArmarXWidgetController.h:45
ArmarXWidgetInfo::getCategoryIcon
QIcon getCategoryIcon() const
Definition: ArmarXGuiInterface.h:57