diff options
author | Eike Ziller <eike.ziller@digia.com> | 2014-09-25 16:29:56 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2014-09-26 14:49:09 +0200 |
commit | a56432b3b177bbdabc55f796fb78a27cc87e9afb (patch) | |
tree | 567707bf47a6ff0c78bfafed06c6ebc1b0c5d5d3 /src/plugins/help/helpwidget.h | |
parent | 85ac96511632c7037fc7720299b31d33681b4c88 (diff) | |
download | qt-creator-a56432b3b177bbdabc55f796fb78a27cc87e9afb.tar.gz |
Share code between "central" and other help viewers.
This removes a lot of duplication of actions and interaction.
It's also a preparation step into making the external help
window behave more like the full-fledged help mode.
Change-Id: I318d831f229b0a75bb8702a5f163c96cce6a668c
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src/plugins/help/helpwidget.h')
-rw-r--r-- | src/plugins/help/helpwidget.h | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/src/plugins/help/helpwidget.h b/src/plugins/help/helpwidget.h index 12788746f7..bd00034881 100644 --- a/src/plugins/help/helpwidget.h +++ b/src/plugins/help/helpwidget.h @@ -37,7 +37,11 @@ QT_BEGIN_NAMESPACE class QAction; +class QComboBox; +class QFont; class QMenu; +class QPrinter; +class QStackedWidget; QT_END_NAMESPACE namespace Help { @@ -50,6 +54,7 @@ class HelpWidget : public QWidget Q_OBJECT public: enum WidgetStyle { + ModeWidget, SideBarWidget, ExternalWindow }; @@ -58,6 +63,21 @@ public: ~HelpWidget(); HelpViewer *currentViewer() const; + void setCurrentViewer(HelpViewer *viewer); + int currentIndex() const; + void addViewer(HelpViewer *viewer, bool highlightSearchTerms = false); + void removeViewerAt(int index); + + void setViewerFont(const QFont &font); + + // so central widget can save the state + int viewerCount() const; + HelpViewer *viewerAt(int index) const; + +public slots: + void setSource(const QUrl &url); + void setSourceFromSearch(const QUrl &url); + void updateCloseButton(); protected: void closeEvent(QCloseEvent *); @@ -66,17 +86,29 @@ signals: void openHelpMode(const QUrl &url); void closeButtonClicked(); void aboutToClose(); + void sourceChanged(const QUrl &url); + void filterActivated(const QString &name); private slots: void updateBackMenu(); void updateForwardMenu(); void updateWindowTitle(); void helpModeButtonClicked(); + +private: void goHome(); void addBookmark(); + void copy(); + void forward(); + void backward(); + void scaleUp(); + void scaleDown(); + void resetScale(); + void print(HelpViewer *viewer); + void highlightSearchTerms(); -private: Core::IContext *m_context; + WidgetStyle m_style; QAction *m_switchToHelp; QAction *m_homeAction; QMenu *m_backMenu; @@ -84,13 +116,16 @@ private: QAction *m_backAction; QAction *m_forwardAction; QAction *m_addBookmarkAction; + QComboBox *m_filterComboBox; + QAction *m_closeAction; QAction *m_scaleUp; QAction *m_scaleDown; QAction *m_resetScale; + QAction *m_printAction; QAction *m_copy; - HelpViewer *m_viewer; - WidgetStyle m_style; + QStackedWidget *m_viewerStack; + QPrinter *m_printer; }; } // Internal |