PluginManagerDialog.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/qt/widgets/plugin/manager/PluginManagerDialog.h
22 
23  \brief A Qt dialog for plugin management.
24 */
25 
26 #ifndef __TERRALIB_QT_WDIGETS_PLUGIN_MANAGER_INTERNAL_PLUGINMANAGERDIALOG_H
27 #define __TERRALIB_QT_WDIGETS_PLUGIN_MANAGER_INTERNAL_PLUGINMANAGERDIALOG_H
28 
29 // TerraLib
30 #include "../../Config.h"
31 
32 // STL
33 #include <memory>
34 
35 // Qt
36 #include <QDialog>
37 
38 // Forward declaration
39 namespace Ui { class PluginManagerDialogForm; }
40 
41 class QTableWidget;
42 class QTableWidgetItem;
43 
44 namespace te
45 {
46  namespace core
47  {
48 // Forward declaration
49  struct PluginInfo;
50  }
51 
52  namespace qt
53  {
54  namespace widgets
55  {
56  class TEQTWIDGETSEXPORT PluginManagerDialog : public QDialog
57  {
58  Q_OBJECT
59  enum class PluginStatus
60  {
61  loaded,
62  unloaded,
63  broken,
64  to_load,
65  to_unload,
66  to_remove
67  };
68 
70  {
71  enabled = 0,
72  display_name = 1,
73  version = 2,
74  license_description = 3,
75  site = 4,
76  provider_name = 5,
77  provider_site = 6,
78  provider_email = 7,
79  name = 8
80  };
81 
82  public:
83 
84  PluginManagerDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
85 
87 
88  protected slots:
89  void onAddPushButtonClicked();
90  void onApplyPushButtonClicked();
91  void onClosePushButtonClicked();
92  void onEnableAllChanged(int state);
93  void onEnabledChanged(int state);
94  void onHelpPushButtonClicked();
95  void onRemovePushButtonClicked();
96 
97  protected:
98  void addEntry(const te::core::PluginInfo& pinfo, PluginStatus status);
99  void changePluginStatus(const std::string& plugin_name);
100  void disableRow(const int row);
101  void fillInstalledPlugins();
102  std::string getPluginName(int row);
103  int getPluginRow(const std::string& plugin_name);
104  PluginStatus getPluginStatus(const int row);
105  void loadPlugins(std::vector<te::core::PluginInfo> v_pInfo);
106  void removeEntries(std::vector<te::core::PluginInfo> v_pInfo);
107  void setChanged(const int row, bool bold);
108  void unloadPlugins(std::vector<core::PluginInfo> v_pInfo);
109  void updateBroken();
110 
111  private:
112 
113  std::unique_ptr<Ui::PluginManagerDialogForm> m_ui;
114  };
115 
116  } // end namespace widgets
117  } // end namespace qt
118 } // end namespace te
119 
120 #endif // __TERRALIB_QT_WDIGETS_PLUGIN_MANAGER_INTERNAL_PLUGINMANAGERDIALOG_H
Basic information about a plugin.
Definition: PluginInfo.h:63
std::unique_ptr< Ui::PluginManagerDialogForm > m_ui
URI C++ Library.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63