Tulip  5.2.0
Large graphs analysis and drawing
PluginManager.h
1 /*
2  *
3  * This file is part of Tulip (http://tulip.labri.fr)
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 struct TLP_QT_SCOPE PluginInformation {
52  QString name;
53  QString category;
54  PluginVersionInformation installedVersion;
55  PluginVersionInformation availableVersion;
56 
57  PluginInformation();
58  PluginInformation(const PluginInformation &copy);
59 
60  void fillLocalInfo(const tlp::Plugin &info);
61 };
62 
63 class TLP_QT_SCOPE PluginManager {
64  static QStringList _markedForInstallation;
65 
66 public:
67  enum PluginLocation { Remote = 0x01, Local = 0x02 };
68  Q_DECLARE_FLAGS(PluginLocations, PluginLocation)
69 
70  static const QString STABLE_LOCATION;
71  static const QString TESTING_LOCATION;
72 
73  typedef QList<PluginVersionInformation> PluginVersionInformationList;
74 
75  typedef QList<PluginInformation> PluginInformationList;
76 
77  static void addRemoteLocation(const QString &location);
78  static void removeRemoteLocation(const QString &location);
79  static QStringList remoteLocations();
80 
81  static PluginInformationList listPlugins(PluginLocations locations,
82  const QString &nameFilter = QString(),
83  const QString &categoryFilter = QString());
84 
85  static void markForRemoval(const QString &plugin);
86  static void markForInstallation(const QString &plugin, QObject *recv, const char *progressSlot);
87 
88  static QStringList markedForInstallation();
89  static QStringList markedForRemoval();
90  static void unmarkForRemoval(const QString &file);
91 };
92 
93 Q_DECLARE_OPERATORS_FOR_FLAGS(PluginManager::PluginLocations)
94 }
95 
96 #endif // PLUGINMANAGER_H
97 ///@endcond
Top-level interface for plug-ins.
Definition: Plugin.h:85