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 <QTimer>
25 
27 
28 #include <ArmarXGui/gui-plugins/MessageDisplayPlugin/ui_MessageDisplayPluginWidget.h>
29 #include <ArmarXGui/interface/MessageDisplayInterface.h>
32 
33 namespace armarx
34 {
35  /**
36  \page ArmarXGui-GuiPlugins-MessageDisplayPlugin MessageDisplayPlugin
37  \brief The MessageDisplayPlugin allows visualizing ...
38 
39  \image html MessageDisplayPlugin.png
40  The user can
41 
42  API Documentation \ref MessageDisplayPluginWidgetController
43 
44  \see MessageDisplayPluginGuiPlugin
45  */
46 
47  /**
48  * \class MessageDisplayPluginWidgetController
49  * \brief MessageDisplayPluginWidgetController brief one line description
50  *
51  * Detailed description
52  */
55  MessageDisplayPluginWidgetController>,
56  public armarx::MessageDisplayInterface
57  {
58  Q_OBJECT
59 
60  public:
61  /**
62  * Controller Constructor
63  */
65 
66  /**
67  * Controller destructor
68  */
70 
71  /**
72  * @see ArmarXWidgetController::loadSettings()
73  */
74  void loadSettings(QSettings* settings) override;
75 
76  /**
77  * @see ArmarXWidgetController::saveSettings()
78  */
79  void saveSettings(QSettings* settings) override;
80 
81  /**
82  * Returns the Widget name displayed in the ArmarXGui to create an
83  * instance of this class.
84  */
85  static QString
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,
102  const std::string& subCaption,
103  const Ice::Current&) override;
104  void setCaption(const std::string& caption, const Ice::Current&) override;
105  void setSubCaption(const std::string& subCaption, const Ice::Current&) override;
106 
107  void updateLabels();
108 
109  public slots:
110  void timerEvent();
111  void setMessageContentImpl(const QString& caption, const QString& subcaption);
112  void setCaptionContentImpl(const QString& caption);
113  void setSubCaptionContentImpl(const QString& subcaption);
114  void clearText();
115 
116  signals:
117  void setMessageContent(const QString& caption, const QString& subcaption);
118  void setCaptionContent(const QString& caption);
119  void setSubCaptionContent(const QString& subcaption);
120 
121  private:
122  /**
123  * Widget Form
124  */
125  Ui::MessageDisplayPluginWidget widget;
126 
127  QTimer fadeTimer;
128  int fadeDuration;
129 
130  QString currentCaption;
131  QString currentSubCaption;
132 
133  // ArmarXWidgetController interface
134  public:
135  QPointer<QWidget> getCustomTitlebarWidget(QWidget* parent) override;
136  };
137 } // namespace armarx
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:53
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:27
ImportExportComponent.h