WidgetHandler.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include <ArmarXGui/interface/RemoteGuiInterface.h>
6 
7 #include <functional>
8 
9 class QWidget;
10 class QObject;
11 class QString;
12 
13 namespace armarx::RemoteGui
14 {
15 
16  std::string toUtf8(QString const& qstring);
17  QString toQString(std::string const& string);
18 
19  using QWidgetPtr = QWidget* ;
20  using CreateWidgetCallback = std::function<QWidgetPtr(WidgetPtr const&)>;
21 
23  {
24  virtual ~WidgetHandler() = default;
25 
26  virtual bool isValid(Widget const& desc, std::ostream& out = cnull) const = 0;
27 
28  virtual QWidget* createWidget(Widget const& desc,
29  ValueVariant const& initialValue,
30  CreateWidgetCallback const& createChild,
31  const QObject* stateChangeReceiver,
32  const char* stateChangeSlot) const = 0;
33 
34  virtual void updateGui(Widget const& desc,
35  QWidget* widget,
36  ValueVariant const& value) const = 0;
37 
38  virtual RemoteGui::ValueVariant handleGuiChange(Widget const& desc,
39  QWidget* widget) const = 0;
40 
41  virtual std::string getHandlerT() const = 0;
42  };
43 
44 }
armarx::RemoteGui::WidgetHandler::isValid
virtual bool isValid(Widget const &desc, std::ostream &out=cnull) const =0
armarx::RemoteGui::QWidgetPtr
QWidget * QWidgetPtr
Definition: WidgetHandler.h:19
armarx::RemoteGui
Definition: LightweightRemoteGuiComponentPlugin.h:30
cnull.h
armarx::RemoteGui::WidgetHandler::~WidgetHandler
virtual ~WidgetHandler()=default
armarx::RemoteGui::WidgetHandler::handleGuiChange
virtual RemoteGui::ValueVariant handleGuiChange(Widget const &desc, QWidget *widget) const =0
armarx::RemoteGui::toUtf8
std::string toUtf8(QString const &qstring)
Definition: WidgetHandler.cpp:7
armarx::cnull
std::ostream cnull
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
armarx::RemoteGui::Client::Widget
Definition: Widgets.h:21
armarx::RemoteGui::WidgetHandler
Definition: WidgetHandler.h:22
armarx::RemoteGui::WidgetHandler::updateGui
virtual void updateGui(Widget const &desc, QWidget *widget, ValueVariant const &value) const =0
armarx::RemoteGui::WidgetHandler::getHandlerT
virtual std::string getHandlerT() const =0
armarx::WidgetDescription::WidgetPtr
::IceInternal::Handle<::armarx::WidgetDescription::Widget > WidgetPtr
Definition: NJointControllerBase.h:66
armarx::RemoteGui::WidgetHandler::createWidget
virtual QWidget * createWidget(Widget const &desc, ValueVariant const &initialValue, CreateWidgetCallback const &createChild, const QObject *stateChangeReceiver, const char *stateChangeSlot) const =0
armarx::RemoteGui::toQString
QString toQString(std::string const &string)
Definition: WidgetHandler.cpp:12
armarx::RemoteGui::CreateWidgetCallback
std::function< QWidgetPtr(WidgetPtr const &)> CreateWidgetCallback
Definition: WidgetHandler.h:20