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/centralwidget.h | |
parent | 85ac96511632c7037fc7720299b31d33681b4c88 (diff) |
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/centralwidget.h')
-rw-r--r-- | src/plugins/help/centralwidget.h | 70 |
1 files changed, 6 insertions, 64 deletions
diff --git a/src/plugins/help/centralwidget.h b/src/plugins/help/centralwidget.h index 8fa96d0e19f..37d310459e6 100644 --- a/src/plugins/help/centralwidget.h +++ b/src/plugins/help/centralwidget.h @@ -30,90 +30,32 @@ #ifndef CENTRALWIDGET_H #define CENTRALWIDGET_H -#include <coreplugin/find/ifindsupport.h> - -#include <QWidget> +#include "helpwidget.h" -QT_FORWARD_DECLARE_CLASS(QEvent) -QT_FORWARD_DECLARE_CLASS(QAction) -QT_FORWARD_DECLARE_CLASS(QStackedWidget) -QT_FORWARD_DECLARE_CLASS(QFocusEvent) -QT_FORWARD_DECLARE_CLASS(QPrinter) +#include <coreplugin/find/ifindsupport.h> namespace Help { - namespace Internal { +namespace Internal { class HelpViewer; class PrintHelper; -class CentralWidget : public QWidget +class CentralWidget : public HelpWidget { Q_OBJECT public: - CentralWidget(QWidget *parent = 0); + CentralWidget(const Core::Context &context, QWidget *parent = 0); ~CentralWidget(); static CentralWidget *instance(); - bool isForwardAvailable() const; - bool isBackwardAvailable() const; - - HelpViewer *viewerAt(int index) const; - HelpViewer *currentHelpViewer() const; - - void addPage(HelpViewer *page, bool fromSearch = false); - void removePage(int index); - - int currentIndex() const; - void setCurrentPage(HelpViewer *page); - - bool find(const QString &txt, Core::FindFlags findFlags, - bool incremental, bool *wrapped = 0); - public slots: - void copy(); - void home(); - - void zoomIn(); - void zoomOut(); - void resetZoom(); - - void forward(); - void backward(); - - void print(); - void pageSetup(); - void printPreview(); - - void setSource(const QUrl &url); - void setSourceFromSearch(const QUrl &url); void showTopicChooser(const QMap<QString, QUrl> &links, const QString &key); -protected: - void focusInEvent(QFocusEvent *event); - -signals: - void sourceChanged(const QUrl &url); - void forwardAvailable(bool available); - void backwardAvailable(bool available); - -private slots: - void highlightSearchTerms(); - void printPreview(QPrinter *printer); - void handleSourceChanged(const QUrl &url); - -private: - void initPrinter(); - void connectSignals(HelpViewer *page); - bool eventFilter(QObject *object, QEvent *e); - -private: - QPrinter *printer; - QStackedWidget *m_stackedWidget; }; - } // namespace Internal +} // namespace Internal } // namespace Help #endif // CENTRALWIDGET_H |