libhomegear-base  0.7
Base library for Homegear and Homegear family modules.
HomegearUiElement.h
Go to the documentation of this file.
1 /* Copyright 2013-2019 Homegear GmbH
2  *
3  * libhomegear-base is free software: you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public License as
5  * published by the Free Software Foundation, either version 3 of the
6  * License, or (at your option) any later version.
7  *
8  * libhomegear-base is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with libhomegear-base. If not, see
15  * <http://www.gnu.org/licenses/>.
16  *
17  * In addition, as a special exception, the copyright holders give
18  * permission to link the code of portions of this program with the
19  * OpenSSL library under certain conditions as described in each
20  * individual source file, and distribute linked combinations
21  * including the two.
22  * You must obey the GNU Lesser General Public License in all respects
23  * for all of the code used other than OpenSSL. If you modify
24  * file(s) with this exception, you may extend this exception to your
25  * version of the file(s), but you are not obligated to do so. If you
26  * do not wish to do so, delete this exception statement from your
27  * version. If you delete this exception statement from all source
28  * files in the program, then also delete it here.
29 */
30 
31 #ifndef HOMEGEARUIELEMENT_H_
32 #define HOMEGEARUIELEMENT_H_
33 
34 #include "UiVariable.h"
35 #include "UiIcon.h"
36 #include "UiText.h"
37 #include "UiGrid.h"
38 #include "../../Variable.h"
39 
40 #include <string>
41 #include <memory>
42 #include <unordered_map>
43 #include <list>
44 
45 using namespace rapidxml;
46 
47 namespace BaseLib {
48 
49 class SharedObjects;
50 
51 namespace DeviceDescription {
52 
54 
58 typedef std::shared_ptr<HomegearUiElement> PHomegearUiElement;
59 
64  public:
65  enum class Type {
66  undefined,
67  simple,
68  complex
69  };
70 
71  //Elements
72  std::string id;
73  Type type = Type::undefined;
74  std::string control;
75  std::string description;
76  std::unordered_map<std::string, PUiIcon> icons;
77  std::unordered_map<std::string, PUiText> texts;
78  std::list<PUiVariable> variableInputs;
79  std::list<PUiVariable> variableOutputs;
80  std::unordered_map<std::string, PVariable> metadata;
82  std::list<PUiControl> controls;
83 
87  virtual ~HomegearUiElement() = default;
88 
89  HomegearUiElement &operator=(const HomegearUiElement &rhs);
90 
91  PVariable getElementInfo(bool addHelpInfo = false);
92  protected:
93  BaseLib::SharedObjects *_bl = nullptr;
94 };
95 }
96 }
97 
98 #endif
std::list< PUiControl > controls
Definition: HomegearUiElement.h:82
This is the base library main class.
Definition: BaseLib.h:95
Definition: BaseLib.cpp:34
Class defining a physical packet.
Definition: HomegearUiElement.h:63
std::list< PUiVariable > variableInputs
Definition: HomegearUiElement.h:78
std::string id
Definition: HomegearUiElement.h:72
std::shared_ptr< Variable > PVariable
Definition: PhysicalInterfaceSettings.h:41
std::unordered_map< std::string, PVariable > metadata
Definition: HomegearUiElement.h:80
PUiGrid grid
Definition: HomegearUiElement.h:81
std::shared_ptr< UiGrid > PUiGrid
Definition: UiGrid.h:48
std::string description
Definition: HomegearUiElement.h:75
std::string control
Definition: HomegearUiElement.h:74
std::list< PUiVariable > variableOutputs
Definition: HomegearUiElement.h:79
Class representing a node of XML document.
Definition: rapidxml.h:539
Definition: BinaryPayload.h:38
std::unordered_map< std::string, PUiIcon > icons
Definition: HomegearUiElement.h:76
std::shared_ptr< HomegearUiElement > PHomegearUiElement
Helper type for Packet pointers.
Definition: HomegearUiElement.h:53
Type
Definition: HomegearUiElement.h:65
std::unordered_map< std::string, PUiText > texts
Definition: HomegearUiElement.h:77