source: branches/vendor/trolltech/qt/current/tools/assistant/tools/assistant/mainwindow.h @ 2

Last change on this file since 2 was 2, checked in by Dmitry A. Kuminov, 13 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 5.1 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4** Contact: Qt Software Information (qt-info@nokia.com)
5**
6** This file is part of the Qt Assistant of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial Usage
10** Licensees holding valid Qt Commercial licenses may use this file in
11** accordance with the Qt Commercial License Agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Nokia.
14**
15** GNU Lesser General Public License Usage
16** Alternatively, this file may be used under the terms of the GNU Lesser
17** General Public License version 2.1 as published by the Free Software
18** Foundation and appearing in the file LICENSE.LGPL included in the
19** packaging of this file.  Please review the following information to
20** ensure the GNU Lesser General Public License version 2.1 requirements
21** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22**
23** In addition, as a special exception, Nokia gives you certain
24** additional rights. These rights are described in the Nokia Qt LGPL
25** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
26** package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file.  Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you are unsure which license is appropriate for your use, please
37** contact the sales department at qt-sales@nokia.com.
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef MAINWINDOW_H
43#define MAINWINDOW_H
44
45#include <QtCore/QUrl>
46#include <QtGui/QMainWindow>
47
48QT_BEGIN_NAMESPACE
49
50class QAction;
51class QLineEdit;
52class QComboBox;
53class QMenu;
54
55class IndexWindow;
56class QHelpEngineCore;
57class QHelpEngine;
58class CentralWidget;
59class ContentWindow;
60class BookmarkManager;
61class BookmarkWidget;
62class CmdLineParser;
63class QtDocInstaller;
64
65class SearchWidget;
66
67class MainWindow : public QMainWindow
68{
69    Q_OBJECT
70
71public:
72    MainWindow(CmdLineParser *cmdLine, QWidget *parent = 0);
73    ~MainWindow();
74
75    static void activateCurrentBrowser();
76    static QString collectionFileDirectory(bool createDir = false,
77        const QString &cacheDir = QString());
78    static QString defaultHelpCollectionFileName();
79
80public:
81    void hideContents();
82    void hideIndex();
83    void hideBookmarks();
84    void hideSearch();
85    void setIndexString(const QString &str);
86    void expandTOC(int depth);
87    bool usesDefaultCollection() const;
88
89signals:
90    void initDone();
91
92public slots:
93    void showContents();
94    void showIndex();
95    void showBookmarks();
96    void showSearch();
97    void syncContents();
98    void activateCurrentCentralWidgetTab();
99
100private slots:
101    void insertLastPages();
102    void addBookmark();
103    void gotoAddress();
104    void showPreferences();
105    void showNewAddress();
106    void showAboutDialog();
107    void copyAvailable(bool yes);
108    void updateNavigationItems();
109    void showNewAddress(const QUrl &url);
110    void addNewBookmark(const QString &title, const QString &url);
111    void showTopicChooser(const QMap<QString, QUrl> &links, const QString &keyword);
112    void updateApplicationFont();
113    void filterDocumentation(const QString &customFilter);
114    void setupFilterCombo();
115    void lookForNewQtDocumentation();
116    void indexingStarted();
117    void indexingFinished();
118    void displayInstallationError(const QString &errorMessage);
119    void qtDocumentationInstalled(bool newDocsInstalled);
120    void checkInitState();
121
122private:
123    bool initHelpDB();
124    void setupActions();
125    void closeEvent(QCloseEvent *e);
126    void activateDockWidget(QWidget *w);
127    void updateAboutMenuText();
128    void setupFilterToolbar();
129    void setupAddressToolbar();
130    QMenu *toolBarMenu();
131    QWidget *setupBookmarkWidget();
132
133    QHelpEngine *m_helpEngine;
134    CentralWidget *m_centralWidget;
135    IndexWindow *m_indexWindow;
136    ContentWindow *m_contentWindow;
137    BookmarkWidget *m_bookmarkWidget;
138    BookmarkManager *m_bookmarkManager;
139    QLineEdit *m_addressLineEdit;
140    QComboBox *m_filterCombo;
141
142    QAction *m_backAction;
143    QAction *m_nextAction;
144    QAction *m_homeAction;
145    QAction *m_syncAction;
146    QAction *m_copyAction;
147    QAction *m_findAction;
148    QAction *m_printAction;
149    QAction *m_printPreviewAction;
150    QAction *m_pageSetupAction;
151    QAction *m_zoomInAction;
152    QAction *m_zoomOutAction;
153    QAction *m_resetZoomAction;
154    QAction *m_aboutAction;
155    QAction *m_closeTabAction;
156    QAction *m_newTabAction;
157
158    QMenu *m_viewMenu;
159    QMenu *m_toolBarMenu;
160
161    CmdLineParser *m_cmdLine;
162    SearchWidget *m_searchWidget;
163
164    QWidget *m_progressWidget;
165    QtDocInstaller *m_qtDocInstaller;
166
167    bool m_connectedInitSignals;
168};
169
170QT_END_NAMESPACE
171
172#endif // MAINWINDOW_H
Note: See TracBrowser for help on using the repository browser.