Tulip  4.4.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
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 1 and Inria Bordeaux - Sud Ouest
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 <QStringList>
25 
26 #include <tulip/tulipconf.h>
27 
28 class QNetworkReply;
29 
30 namespace tlp {
31 
32 class Plugin;
33 
34 struct TLP_QT_SCOPE PluginVersionInformation {
35  bool isValid;
36 
37  QString libraryLocation;
38  QString author;
39  QString version;
40  QString icon;
41  QString description;
42  QString date;
43 
44  QStringList dependencies;
45 
46  PluginVersionInformation();
47  PluginVersionInformation(const PluginVersionInformation& copy);
48 };
49 
50 // deprecated name
51 _DEPRECATED_TYPEDEF(PluginVersionInformation, PluginVersionInformations);
52 
53 struct TLP_QT_SCOPE PluginInformation {
54  QString name;
55  QString category;
56  PluginVersionInformation installedVersion;
57  PluginVersionInformation availableVersion;
58 
59  PluginInformation();
60  PluginInformation(const PluginInformation& copy);
61 
62  void fillLocalInfos(const tlp::Plugin& info);
63 };
64 
65 // deprecated name
66 _DEPRECATED_TYPEDEF(PluginInformation, PluginInformations);
67 
68 class TLP_QT_SCOPE PluginManager {
69  static QStringList _markedForInstallation;
70 
71 public:
72  enum PluginLocation {
73  Remote = 0x01,
74  Local = 0x02
75  };
76  Q_DECLARE_FLAGS(PluginLocations, PluginLocation)
77 
78  static const QString STABLE_LOCATION;
79  static const QString TESTING_LOCATION;
80 
81  typedef QList<PluginVersionInformation> PluginVersionInformationList;
82  _DEPRECATED_TYPEDEF(QList<PluginVersionInformation>, PluginVersionInformationsList);
83 
84  typedef QList<PluginInformation> PluginInformationList;
85  _DEPRECATED_TYPEDEF(QList<PluginInformation>, PluginInformationsList);
86 
87  static void addRemoteLocation(const QString& location);
88  static void removeRemoteLocation(const QString& location);
89  static QStringList remoteLocations();
90 
91  static PluginInformationList listPlugins(PluginLocations locations,const QString& nameFilter = QString(),const QString& categoryFilter = QString());
92 
93  static void markForRemoval(const QString& plugin);
94  static void markForInstallation(const QString& plugin, QObject *recv, const char* progressSlot);
95 
96  static QStringList markedForInstallation();
97  static QStringList markedForRemoval();
98  static void unmarkForRemoval(const QString& file);
99 };
100 
101 Q_DECLARE_OPERATORS_FOR_FLAGS(PluginManager::PluginLocations)
102 }
103 
104 #endif //PLUGINMANAGER_H
105 ///@endcond