MessageDisplayPluginWidgetController.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package ArmarXGui::gui-plugins::MessageDisplayPluginWidgetController
17  * @author Peter Kaiser ( peter dot kaiser at kit dot edu )
18  * @date 2018
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 #pragma once
23 
24 #include <ArmarXGui/gui-plugins/MessageDisplayPlugin/ui_MessageDisplayPluginWidget.h>
25 
28 #include <ArmarXGui/interface/MessageDisplayInterface.h>
29 
31 
32 #include <QTimer>
33 
34 namespace armarx
35 {
36  /**
37  \page ArmarXGui-GuiPlugins-MessageDisplayPlugin MessageDisplayPlugin
38  \brief The MessageDisplayPlugin allows visualizing ...
39 
40  \image html MessageDisplayPlugin.png
41  The user can
42 
43  API Documentation \ref MessageDisplayPluginWidgetController
44 
45  \see MessageDisplayPluginGuiPlugin
46  */
47 
48  /**
49  * \class MessageDisplayPluginWidgetController
50  * \brief MessageDisplayPluginWidgetController brief one line description
51  *
52  * Detailed description
53  */
56  public armarx::ArmarXComponentWidgetControllerTemplate < MessageDisplayPluginWidgetController >,
57  public armarx::MessageDisplayInterface
58  {
59  Q_OBJECT
60 
61  public:
62  /**
63  * Controller Constructor
64  */
66 
67  /**
68  * Controller destructor
69  */
71 
72  /**
73  * @see ArmarXWidgetController::loadSettings()
74  */
75  void loadSettings(QSettings* settings) override;
76 
77  /**
78  * @see ArmarXWidgetController::saveSettings()
79  */
80  void saveSettings(QSettings* settings) override;
81 
82  /**
83  * Returns the Widget name displayed in the ArmarXGui to create an
84  * instance of this class.
85  */
86  static QString GetWidgetName()
87  {
88  return "Util.MessageDisplayPlugin";
89  }
90 
91  /**
92  * \see armarx::Component::onInitComponent()
93  */
94  void onInitComponent() override;
95 
96  /**
97  * \see armarx::Component::onConnectComponent()
98  */
99  void onConnectComponent() override;
100 
101  void setMessage(const std::string& caption, const std::string& subCaption, const Ice::Current&) override;
102  void setCaption(const std::string& caption, const Ice::Current&) override;
103  void setSubCaption(const std::string& subCaption, const Ice::Current&) override;
104 
105  void updateLabels();
106 
107  public slots:
108  void timerEvent();
109  void setMessageContentImpl(const QString& caption, const QString& subcaption);
110  void setCaptionContentImpl(const QString& caption);
111  void setSubCaptionContentImpl(const QString& subcaption);
112  void clearText();
113 
114  signals:
115  void setMessageContent(const QString& caption, const QString& subcaption);
116  void setCaptionContent(const QString& caption);
117  void setSubCaptionContent(const QString& subcaption);
118 
119  private:
120  /**
121  * Widget Form
122  */
123  Ui::MessageDisplayPluginWidget widget;
124 
125  QTimer fadeTimer;
126  int fadeDuration;
127 
128  QString currentCaption;
129  QString currentSubCaption;
130 
131  // ArmarXWidgetController interface
132  public:
133  QPointer<QWidget> getCustomTitlebarWidget(QWidget* parent) override;
134 
135 
136  };
137 }
138 
139 
armarx::MessageDisplayPluginWidgetController::GetWidgetName
static QString GetWidgetName()
Returns the Widget name displayed in the ArmarXGui to create an instance of this class.
Definition: MessageDisplayPluginWidgetController.h:86
armarx::MessageDisplayPluginWidgetController
MessageDisplayPluginWidgetController brief one line description.
Definition: MessageDisplayPluginWidgetController.h:54
armarx::ArmarXComponentWidgetControllerTemplate
Definition: ArmarXComponentWidgetController.h:69
ArmarXGuiPlugin.h
ArmarXComponentWidgetController.h
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
ImportExportComponent.h