Changeset View
Changeset View
Standalone View
Standalone View
plugins/phabricator/phabricatorplugin.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 PHABRICATORPLUGIN_H | ||||
21 | #define PHABRICATORPLUGIN_H | ||||
22 | | ||||
23 | #include <interfaces/iplugin.h> | ||||
24 | #include <interfaces/iprojectservicehookup.h> | ||||
25 | #include <interfaces/iprojectserviceurlmapper.h> | ||||
26 | | ||||
27 | #include "projectvcstracker.h" | ||||
28 | | ||||
29 | class PhabricatorPlugin : public KDevelop::IPlugin, | ||||
30 | public KDevelop::IProjectServiceHookup, | ||||
31 | public KDevelop::IProjectServiceUrlMapper | ||||
32 | { | ||||
33 | Q_OBJECT | ||||
34 | Q_INTERFACES( KDevelop::IProjectServiceHookup ) | ||||
35 | Q_INTERFACES( KDevelop::IProjectServiceUrlMapper ) | ||||
36 | | ||||
37 | public: | ||||
38 | /** | ||||
39 | * Constructor with arguments as needed with KPluginFactory | ||||
40 | * | ||||
41 | * @param parent | ||||
42 | * @param args | ||||
43 | */ | ||||
44 | PhabricatorPlugin(QObject* parent, const QVariantList& args); | ||||
45 | ~PhabricatorPlugin() override; | ||||
46 | | ||||
47 | public: // IPlugin API | ||||
48 | QString projectServiceId() const override; | ||||
49 | QString projectServiceDisplayName() const override; | ||||
50 | QIcon projectServiceIcon() const override; | ||||
51 | | ||||
52 | public: // IProjectServiceHookup API | ||||
53 | QList<KDevelop::IProjectServiceHookupConfiguration*> loadProjectServiceHookupConfigurations(KDevelop::IProject* project) const override; | ||||
54 | void saveProjectServiceHookupConfigurations(const QList<KDevelop::IProjectServiceHookupConfiguration*>& projectServiceHookupConfigurations, | ||||
55 | KDevelop::IProject* project) override; | ||||
56 | KDevelop::IProjectServiceHookupConfiguration* createProjectServiceHookupConfiguration(KDevelop::IProject* project) const override; | ||||
57 | | ||||
58 | KDevelop::ProjectServiceHookupConfigPage* createProjectServiceHookupConfigPage(QWidget* parent) const override; | ||||
59 | | ||||
60 | public: // IProjectServiceUrlMapper API | ||||
61 | ProjectServiceUrlMapperCapabilities projectServiceUrlMapperCapabilities() const override; | ||||
62 | QVector<KDevelop::ProjectServiceUrlData> | ||||
63 | projectServiceUrlsFromTextSelection(const QUrl& url, const KTextEditor::Cursor& cursor, | ||||
64 | KDevelop::IProject* project) const override; | ||||
65 | QVector<KDevelop::ProjectServiceUrlData> | ||||
66 | projectServiceUrlsFromVcsRevision(const KDevelop::VcsRevision& revision, KDevelop::IProject* project) const override; | ||||
67 | using IProjectServiceUrlMapper::projectServiceUrlsFromVcsRevision; | ||||
68 | | ||||
69 | private: | ||||
70 | ProjectVcsTracker m_projectVcsTracker; | ||||
71 | }; | ||||
72 | | ||||
73 | #endif // PHABRICATORPLUGIN_H |