Tulip  5.0.0
Large graphs analysis and drawing
PluginManager.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 #ifndef PLUGINMANAGER_H
22 #define PLUGINMANAGER_H
23 
24 #include <QObject>
25 #include <QStringList>
26 
27 #include <tulip/tulipconf.h>
28 
29 class QNetworkReply;
30 
31 namespace tlp {
32 
33 class Plugin;
34 
35 struct TLP_QT_SCOPE PluginVersionInformation {
36  bool isValid;
37 
38  QString libraryLocation;
39  QString author;
40  QString version;
41  QString icon;
42  QString description;
43  QString date;
44 
45  QStringList dependencies;
46 
47  PluginVersionInformation();
48  PluginVersionInformation(const PluginVersionInformation& copy);
49 };
50 
51 
52 struct TLP_QT_SCOPE PluginInformation {
53  QString name;
54  QString category;
55  PluginVersionInformation installedVersion;
56  PluginVersionInformation availableVersion;
57 
58  PluginInformation();
59  PluginInformation(const PluginInformation& copy);
60 
61  void fillLocalInfo(const tlp::Plugin& info);
62 };
63 
64 class TLP_QT_SCOPE PluginManager {
65  static QStringList _markedForInstallation;
66 
67 public:
68  enum PluginLocation {
69  Remote = 0x01,
70  Local = 0x02
71  };
72  Q_DECLARE_FLAGS(PluginLocations, PluginLocation)
73 
74  static const QString STABLE_LOCATION;
75  static const QString TESTING_LOCATION;
76 
77  typedef QList<PluginVersionInformation> PluginVersionInformationList;
78 
79  typedef QList<PluginInformation> PluginInformationList;
80 
81  static void addRemoteLocation(const QString& location);
82  static void removeRemoteLocation(const QString& location);
83  static QStringList remoteLocations();
84 
85  static PluginInformationList listPlugins(PluginLocations locations,const QString& nameFilter = QString(),const QString& categoryFilter = QString());
86 
87  static void markForRemoval(const QString& plugin);
88  static void markForInstallation(const QString& plugin, QObject *recv, const char* progressSlot);
89 
90  static QStringList markedForInstallation();
91  static QStringList markedForRemoval();
92  static void unmarkForRemoval(const QString& file);
93 };
94 
95 Q_DECLARE_OPERATORS_FOR_FLAGS(PluginManager::PluginLocations)
96 }
97 
98 #endif //PLUGINMANAGER_H
99 ///@endcond
Top-level interface for plug-ins.
Definition: Plugin.h:79