MessageDisplayComponentPlugin.cpp
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::ArmarXObjects::ArmarXGuiComponentPlugins
17 * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
18 * @date 2019
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
24
26
27namespace armarx::plugins
28{
29 void
31 const std::string& subCaption) const
32 {
33 ARMARX_CHECK_NOT_NULL(_display);
34 _display->setMessage(caption, subCaption);
35 }
36
37 void
39 {
40 ARMARX_CHECK_NOT_NULL(_display);
41 _display->setCaption(text);
42 }
43
44 void
46 {
47 ARMARX_CHECK_NOT_NULL(_display);
48 _display->setSubCaption(text);
49 }
50
51 const MessageDisplayInterfacePrx&
53 {
54 return _display;
55 }
56
57 void
59 {
60 if (!_display)
61 {
62 parent<Component>().offeringTopicFromProperty(_propertyName);
63 }
64 }
65
66 void
68 {
69 if (!_display)
70 {
71 parent<Component>().getTopicFromProperty(_display, _propertyName);
72 }
73 }
74
75 void
77 {
78 if (!properties->hasDefinition(_propertyName))
79 {
80 properties->defineOptionalProperty<std::string>(
81 _propertyName,
82 "MessageDisplayTopic",
83 "Name of the message display component that should be used");
84 }
85 }
86} // namespace armarx::plugins
87
88namespace armarx
89{
94
95 void
97 const std::string& subCaption) const
98 {
99 _messageDisplayComponentPlugin->setDisplayMessage(caption, subCaption);
100 }
101
102 void
104 {
105 _messageDisplayComponentPlugin->setDisplayMessageCaption(text);
106 }
107
108 void
110 {
111 _messageDisplayComponentPlugin->setDisplayMessageSubCaption(text);
112 }
113
114 const MessageDisplayInterfacePrx&
116 {
117 return _messageDisplayComponentPlugin->getMessageDisplay();
118 }
119} // namespace armarx
PluginT * addPlugin(const std::string prefix="", ParamsT &&... params)
void setDisplayMessageSubCaption(const std::string &text) const
void setDisplayMessageCaption(const std::string &text) const
void setDisplayMessage(const std::string &caption, const std::string &subCaption) const
const MessageDisplayInterfacePrx & getMessageDisplay() const
void setDisplayMessageSubCaption(const std::string &text) const
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
void setDisplayMessage(const std::string &caption, const std::string &subCaption) const
const MessageDisplayInterfacePrx & getMessageDisplay() const
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
This file is part of ArmarX.
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.