Ignition Gui

API Reference

1.0.0
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 IGNITION_GUI_PLUGIN_HH_
18 #define IGNITION_GUI_PLUGIN_HH_
19 
20 #include <tinyxml2.h>
21 #include <memory>
22 #include <string>
23 
24 #include "ignition/gui/qt.h"
25 #include "ignition/gui/Export.hh"
26 
27 namespace ignition
28 {
29  namespace gui
30  {
31  class PluginPrivate;
32 
47  class IGNITION_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: void PostParentChanges();
84 
93  protected: virtual void LoadConfig(
94  const tinyxml2::XMLElement * /*_pluginElem*/) {}
95 
98  public: virtual std::string Title() const {return this->title;}
99 
103  public: bool DeleteLaterRequested() const;
104 
105  // Documentation inherited
106 // protected: void changeEvent(QEvent *_e) override;
107 
110  protected: void DeleteLater();
111 
113  protected: std::string title = "";
114 
116  protected: std::string configStr;
117 
124  private: virtual void LoadCommonConfig(
125  const tinyxml2::XMLElement *_ignGuiElem);
126 
129  private: void ApplyAnchors();
130 
133  private: std::unique_ptr<PluginPrivate> dataPtr;
134  };
135  }
136 }
137 
138 #endif
virtual std::string Title() const
Get title.
Definition: Plugin.hh:98
virtual void LoadConfig(const tinyxml2::XMLElement *)
Load the plugin with a configuration file. Override this on custom plugins to handle custom configura...
Definition: Plugin.hh:93
std::string configStr
XML configuration.
Definition: Plugin.hh:116
Base class for Ignition GUI plugins.
Definition: Plugin.hh:47
STL class.
Definition: Application.hh:33