Plugin.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 Open Source Robotics Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17#ifndef GZ_GUI_PLUGIN_HH_
18#define GZ_GUI_PLUGIN_HH_
19
20#include <tinyxml2.h>
21#include <gz/utils/ImplPtr.hh>
22#include <memory>
23#include <string>
24
25#include "gz/gui/qt.h"
26#include "gz/gui/Export.hh"
27
28namespace gz::gui
29{
31 namespace plugins {}
32
47 class GZ_GUI_VISIBLE Plugin : public QObject
48 {
49 Q_OBJECT
50
52 public: Plugin();
53
55 public: virtual ~Plugin();
56
66 public: void Load(const tinyxml2::XMLElement *_pluginElem);
67
70 public: virtual std::string ConfigStr();
71
75 public: QQuickItem *CardItem() const;
76
79 public: QQuickItem *PluginItem() const;
80
83 public: QQmlContext *Context() const;
84
87 public: void PostParentChanges();
88
97 protected: virtual void LoadConfig(
98 const tinyxml2::XMLElement *_pluginElem);
99
102 public: virtual std::string Title() const;
103
107 public: bool DeleteLaterRequested() const;
108
111 protected: void DeleteLater();
112
114 protected: std::string title = "";
115
118
125 private: virtual void LoadCommonConfig(
126 const tinyxml2::XMLElement *_gzGuiElem);
127
130 private: void ApplyAnchors();
131
134 GZ_UTILS_UNIQUE_IMPL_PTR(dataPtr)
135 };
136} // namespace gz::gui
137#endif // GZ_GUI_PLUGIN_HH_