ProfileDefaultValueEditWidget.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 ArmarX::
17 * @author Valerij Wittenbeck (valerij.wittenbeck at student dot kit dot edu
18 * @date 2015
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 
24 #pragma once
25 
26 
27 #include <optional>
28 
29 #include <QWidget>
30 
31 #include <Ice/ObjectFactory.h>
32 
35 
36 namespace armarx::Ui
37 {
38  class ProfileDefaultValueEditWidget;
39 }
40 
41 namespace armarx
42 {
43  class ProfileDefaultValueEditWidget : public QWidget
44  {
45  Q_OBJECT
46 
47  private:
48  enum Widget
49  {
50  eLineEdit = 0,
51  eEditButton = 1,
52  eSetButton = 2
53  };
54 
55  public:
56  explicit ProfileDefaultValueEditWidget(QString typeString,
57  QString jsonValue,
58  Ice::CommunicatorPtr communicator,
59  QWidget* parent = 0);
61  // void setType(const QString& typeString);
62  QString getType();
63  void setEditable(bool editable);
64  std::optional<QString> getValueAsString();
65  std::optional<QString> getValueAsJson();
66  VariantContainerBasePtr getVariantContainer();
67 
68  private slots:
69  void resetValue();
70  void setButtonClicked();
71  void editDefaultButtonClicked();
72 
73  private:
74  void initEditButton();
75 
76  Ui::ProfileDefaultValueEditWidget* ui;
77 
78  QString typeString;
79  QString jsonValue;
80  Ice::CommunicatorPtr communicator;
81 
82  bool editable;
83  };
84 
85 
86 } // namespace armarx
armarx::Ui
Definition: GuiUseCaseSelector.h:33
armarx::ProfileDefaultValueEditWidget::getVariantContainer
VariantContainerBasePtr getVariantContainer()
Definition: ProfileDefaultValueEditWidget.cpp:177
armarx::ProfileDefaultValueEditWidget
Definition: ProfileDefaultValueEditWidget.h:43
armarx::ProfileDefaultValueEditWidget::getValueAsString
std::optional< QString > getValueAsString()
Definition: ProfileDefaultValueEditWidget.cpp:141
VariantContainer.h
armarx::ProfileDefaultValueEditWidget::~ProfileDefaultValueEditWidget
~ProfileDefaultValueEditWidget() override
Definition: ProfileDefaultValueEditWidget.cpp:123
armarx::ProfileDefaultValueEditWidget::setEditable
void setEditable(bool editable)
Definition: ProfileDefaultValueEditWidget.cpp:134
IceInternal::Handle<::Ice::Communicator >
armarx::ProfileDefaultValueEditWidget::getValueAsJson
std::optional< QString > getValueAsJson()
Definition: ProfileDefaultValueEditWidget.cpp:156
armarx::ProfileDefaultValueEditWidget::getType
QString getType()
Definition: ProfileDefaultValueEditWidget.cpp:128
armarx::ProfileDefaultValueEditWidget::ProfileDefaultValueEditWidget
ProfileDefaultValueEditWidget(QString typeString, QString jsonValue, Ice::CommunicatorPtr communicator, QWidget *parent=0)
Definition: ProfileDefaultValueEditWidget.cpp:43
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
VariantInfo.h