1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights. These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
32 **************************************************************************/
37 #include <extensionsystem/iplugin.h>
38 #include <QtCore/QMap>
39 #include <QtCore/QStringList>
41 QT_FORWARD_DECLARE_CLASS(QAction)
42 QT_FORWARD_DECLARE_CLASS(QComboBox)
43 QT_FORWARD_DECLARE_CLASS(QMenu)
44 QT_FORWARD_DECLARE_CLASS(QToolButton)
45 QT_FORWARD_DECLARE_CLASS(QUrl)
62 class DocSettingsPage;
63 class ExternalHelpWindow;
64 class FilterSettingsPage;
65 class GeneralSettingsPage;
68 class LocalHelpManager;
69 class OpenPagesManager;
72 class HelpPlugin : public ExtensionSystem::IPlugin
78 virtual ~HelpPlugin();
80 bool initialize(const QStringList &arguments, QString *error_message);
81 void extensionsInitialized();
82 ShutdownFlag aboutToShutdown();
85 void showExternalWindow();
86 void modeChanged(Core::IMode *mode, Core::IMode *old);
88 void activateContext();
90 void activateContents();
91 void activateSearch();
92 void activateOpenPages();
93 void activateBookmarks();
96 void updateFilterComboBox();
97 void filterDocumentation(const QString &customFilter);
99 void switchToHelpMode();
100 void switchToHelpMode(const QUrl &source);
101 void slotHideRightPane();
102 void showHideSidebar();
104 void updateSideBarSource();
105 void updateSideBarSource(const QUrl &newUrl);
108 void contextHelpOptionChanged();
110 void updateCloseButton();
111 void setupHelpEngineIfNeeded();
113 void highlightSearchTerms();
114 void handleHelpRequest(const QUrl &url);
116 void slotAboutToShowBackMenu();
117 void slotAboutToShowNextMenu();
118 void slotOpenActionUrl(QAction *action);
120 void openFindToolBar();
122 void scaleRightPaneUp();
123 void scaleRightPaneDown();
124 void resetRightPaneScale();
129 void activateHelpMode();
130 Utils::StyledBar *createWidgetToolBar();
131 Utils::StyledBar *createIconToolBar(bool external);
132 HelpViewer* viewerForContextMode();
133 void createRightPaneContextViewer();
135 void doSetupIfNeeded();
136 int contextHelpOption() const;
137 void connectExternalHelpWindow();
138 void setupNavigationMenus(QAction *back, QAction *next, QWidget *parent);
143 CentralWidget *m_centralWidget;
144 HelpViewer *m_helpViewerForSideBar;
146 Core::SideBarItem *m_contentItem;
147 Core::SideBarItem *m_indexItem;
148 Core::SideBarItem *m_searchItem;
149 Core::SideBarItem *m_bookmarkItem;
150 Core::SideBarItem *m_openPagesItem;
152 DocSettingsPage *m_docSettingsPage;
153 FilterSettingsPage *m_filterSettingsPage;
154 GeneralSettingsPage *m_generalSettingsPage;
156 QComboBox *m_filterComboBox;
157 Core::SideBar *m_sideBar;
159 bool m_firstModeChange;
160 LocalHelpManager *m_helpManager;
161 OpenPagesManager *m_openPagesManager;
162 Core::MiniSplitter *m_splitter;
164 QToolButton *m_closeButton;
166 QString m_oldAttrValue;
167 QString m_styleProperty;
168 QString m_idFromContext;
170 Core::IMode* m_oldMode;
171 bool m_connectWindow;
172 ExternalHelpWindow *m_externalWindow;
176 Utils::StyledBar *m_internalHelpBar;
177 Utils::StyledBar *m_externalHelpBar;
180 } // namespace Internal
183 #endif // HELPPLUGIN_H