Changeset View
Changeset View
Standalone View
Standalone View
plugins/qthelp/qthelpproviderabstract.h
Show All 23 Lines | |||||
24 | 24 | | |||
25 | #include <interfaces/idocumentationprovider.h> | 25 | #include <interfaces/idocumentationprovider.h> | ||
26 | #include <QObject> | 26 | #include <QObject> | ||
27 | #include <QVariantList> | 27 | #include <QVariantList> | ||
28 | #include <QHelpEngine> | 28 | #include <QHelpEngine> | ||
29 | 29 | | |||
30 | class HelpNetworkAccessManager; | 30 | class HelpNetworkAccessManager; | ||
31 | 31 | | |||
32 | class ExternalViewerProcess; | ||||
33 | | ||||
32 | class QtHelpProviderAbstract : public QObject, public KDevelop::IDocumentationProvider | 34 | class QtHelpProviderAbstract : public QObject, public KDevelop::IDocumentationProvider | ||
33 | { | 35 | { | ||
34 | Q_OBJECT | 36 | Q_OBJECT | ||
35 | Q_INTERFACES( KDevelop::IDocumentationProvider ) | 37 | Q_INTERFACES( KDevelop::IDocumentationProvider ) | ||
36 | public: | 38 | public: | ||
37 | QtHelpProviderAbstract(QObject *parent, const QString &collectionFileName, const QVariantList & args); | 39 | QtHelpProviderAbstract(QObject *parent, const QString &collectionFileName, const QVariantList & args); | ||
38 | virtual ~QtHelpProviderAbstract(); | 40 | virtual ~QtHelpProviderAbstract(); | ||
39 | KDevelop::IDocumentation::Ptr documentationForDeclaration (KDevelop::Declaration*) const override; | 41 | KDevelop::IDocumentation::Ptr documentationForDeclaration (KDevelop::Declaration*) const override; | ||
40 | 42 | | |||
41 | KDevelop::IDocumentation::Ptr documentationForIndex(const QModelIndex& idx) const override; | 43 | KDevelop::IDocumentation::Ptr documentationForIndex(const QModelIndex& idx) const override; | ||
42 | QAbstractItemModel* indexModel() const override; | 44 | QAbstractItemModel* indexModel() const override; | ||
43 | 45 | | |||
44 | KDevelop::IDocumentation::Ptr homePage() const override; | 46 | KDevelop::IDocumentation::Ptr homePage() const override; | ||
45 | 47 | | |||
46 | /// @return False in case we failed to load any documentation files, else true | 48 | /// @return False in case we failed to load any documentation files, else true | ||
47 | bool isValid() const; | 49 | bool isValid() const; | ||
48 | 50 | | |||
51 | ExternalViewerProcess *externalViewer() const; | ||||
52 | bool externalViewerCommand(const QByteArray& command) const; | ||||
53 | bool externalViewerCommand(const char* command) const; | ||||
54 | void setUseExternalViewer(const bool extViewer); | ||||
55 | bool useExternalViewer() const { return s_useExternalViewer; } | ||||
56 | | ||||
49 | QHelpEngine* engine() { return &m_engine; } | 57 | QHelpEngine* engine() { return &m_engine; } | ||
50 | 58 | | |||
51 | HelpNetworkAccessManager* networkAccess() const; | 59 | HelpNetworkAccessManager* networkAccess() const; | ||
52 | public Q_SLOTS: | 60 | public Q_SLOTS: | ||
53 | void jumpedTo(const QUrl& newUrl) const; | 61 | void jumpedTo(const QUrl& newUrl) const; | ||
54 | Q_SIGNALS: | 62 | Q_SIGNALS: | ||
55 | void addHistory(const KDevelop::IDocumentation::Ptr& doc) const override; | 63 | void addHistory(const KDevelop::IDocumentation::Ptr& doc) const override; | ||
56 | protected: | 64 | protected: | ||
57 | QHelpEngine m_engine; | 65 | QHelpEngine m_engine; | ||
58 | HelpNetworkAccessManager* const m_nam; | 66 | HelpNetworkAccessManager* const m_nam; | ||
67 | static bool s_useExternalViewer; | ||||
68 | static ExternalViewerProcess* m_externalViewerProcess; | ||||
69 | friend class ExternalViewerProcess; | ||||
59 | }; | 70 | }; | ||
60 | 71 | | |||
61 | #endif // QTHELPPROVIDERABSTRACT_H | 72 | #endif // QTHELPPROVIDERABSTRACT_H |