Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/services/interfaces/iprojectservicehookup.h
- This file was added.
1 | /* This file is part of KDevelop | ||||
---|---|---|---|---|---|
2 | Copyright 2017 Friedrich W. H. Kossebau <kossebau@kde.org> | ||||
3 | | ||||
4 | This library is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU Library General Public | ||||
6 | License as published by the Free Software Foundation; either | ||||
7 | version 2 of the License, or (at your option) any later version. | ||||
8 | | ||||
9 | This library is distributed in the hope that it will be useful, | ||||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
12 | Library General Public License for more details. | ||||
13 | | ||||
14 | You should have received a copy of the GNU Library General Public License | ||||
15 | along with this library; see the file COPYING.LIB. If not, write to | ||||
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
17 | Boston, MA 02110-1301, USA. | ||||
18 | */ | ||||
19 | | ||||
20 | #ifndef KDEVPLATFORM_IPROJECTSERVICEHOOKUP_H | ||||
21 | #define KDEVPLATFORM_IPROJECTSERVICEHOOKUP_H | ||||
22 | | ||||
23 | #include "servicesexport.h" | ||||
24 | | ||||
25 | #include <QtPlugin> | ||||
26 | #include <QList> | ||||
27 | | ||||
28 | class QWidget; | ||||
29 | | ||||
30 | namespace KDevelop | ||||
31 | { | ||||
32 | | ||||
33 | class IProject; | ||||
34 | class IProjectServiceHookupConfiguration; | ||||
35 | class ProjectServiceHookupConfigPage; | ||||
36 | | ||||
37 | /** | ||||
38 | * Provides hook-up of projects with a service related to the projects. | ||||
39 | * Examples are web services like issue tracker, task boards, repo browsers, | ||||
40 | * communication channels, build servers. The actual service capabilities | ||||
41 | * are implemented by other specific interfaces. | ||||
42 | */ | ||||
43 | class KDEVPLATFORMSERVICES_EXPORT IProjectServiceHookup | ||||
44 | { | ||||
45 | public: | ||||
46 | virtual ~IProjectServiceHookup(); | ||||
47 | | ||||
48 | /** | ||||
49 | * @return a unique identifier for the project service, | ||||
50 | */ | ||||
51 | virtual QString projectServiceId() const = 0; | ||||
52 | | ||||
53 | /** | ||||
54 | * Gets the user-visible string for the service type | ||||
55 | * | ||||
56 | * @return a translated user-visible name for the service type | ||||
57 | */ | ||||
58 | virtual QString projectServiceDisplayName() const = 0; | ||||
59 | | ||||
60 | /** | ||||
61 | * Gets the icon for the UI representing the service type. | ||||
62 | * @return an icon suitable for display in the UI | ||||
63 | */ | ||||
64 | virtual QIcon projectServiceIcon() const = 0; | ||||
65 | | ||||
66 | /** | ||||
67 | * Loads the hookup configurations for the given @p project and the service this plugin supports. | ||||
68 | * @param project the project which the configurations are for | ||||
69 | * @return list of configuration objects, ownership is passed to the caller | ||||
70 | */ | ||||
71 | virtual QList<IProjectServiceHookupConfiguration*> loadProjectServiceHookupConfigurations(IProject* project) const = 0; | ||||
72 | | ||||
73 | /** | ||||
74 | * Stores the hookup configurations for the given @p project with the service this plugin supports. | ||||
75 | * @param projectServiceHookupConfigurations list of all configuration objects to save, ownership is not passed | ||||
76 | * @param project the project which the configurations are for | ||||
77 | */ | ||||
78 | virtual void saveProjectServiceHookupConfigurations(const QList<IProjectServiceHookupConfiguration*>& projectServiceHookupConfigurations, | ||||
79 | IProject* project) = 0; | ||||
80 | | ||||
81 | /** | ||||
82 | * Generates an empty hookup configuration object for the given @p project with the service this plugin supports. | ||||
83 | * The configuration is not stored yet, for that it needs to be passed to | ||||
84 | * @c saveProjectServiceHookupConfigurations() with all other existing configuration objects. | ||||
85 | * The id and the displayName property can be preset with default data, but will be adapted by the caller. | ||||
86 | * @param project the project which the configuration is for | ||||
87 | * @return a new empty configuration object, ownership is passed to the caller | ||||
88 | */ | ||||
89 | virtual IProjectServiceHookupConfiguration* createProjectServiceHookupConfiguration(IProject* project) const = 0; | ||||
90 | | ||||
91 | /** | ||||
92 | * Creates a widget for editing a hookup configuration of a project with the service this plugin supports. | ||||
93 | * | ||||
94 | * The @c ProjectServiceHookupConfigPage subclass of the returned widget instance needs to support | ||||
95 | * the matching @c IProjectServiceHookupConfiguration subclass supported in the rest of this interface. | ||||
96 | * | ||||
97 | * @param parent the parent widget for the newly created widget | ||||
98 | * @return a new widget object to edit a hookup configuration, ownership is passed to the caller. | ||||
99 | */ | ||||
100 | virtual ProjectServiceHookupConfigPage* createProjectServiceHookupConfigPage(QWidget* parent) const = 0; | ||||
101 | }; | ||||
102 | | ||||
103 | } | ||||
104 | | ||||
105 | Q_DECLARE_INTERFACE(KDevelop::IProjectServiceHookup, "org.kdevelop.IProjectServiceHookup") | ||||
106 | | ||||
107 | #endif // KDEVPLATFORM_IPROJECTSERVICEHOOKUP_H |