1 /****************************************************************************
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the demonstration applications of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** No Commercial Usage
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
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 as published by the Free Software
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 ** packaging of this file. Please review the following information to
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 ** In addition, as a special exception, Nokia gives you certain additional
25 ** rights. These rights are described in the Nokia Qt LGPL Exception
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
40 ****************************************************************************/
42 #ifndef BROWSERMAINWINDOW_H
43 #define BROWSERMAINWINDOW_H
45 #include <QtGui/QMainWindow>
46 #include <QtGui/QIcon>
47 #include <QtCore/QUrl>
50 class BookmarksToolBar
;
58 The MainWindow of the Browser Application.
60 Handles the tab widget and all the actions
62 class BrowserMainWindow
: public QMainWindow
{
66 BrowserMainWindow(QWidget
*parent
= 0, Qt::WindowFlags flags
= 0);
68 QSize
sizeHint() const;
71 TabWidget
*tabWidget() const;
72 WebView
*currentTab() const;
73 QByteArray
saveState(bool withTabs
= true) const;
74 bool restoreState(const QByteArray
&state
);
77 void loadPage(const QString
&url
);
81 void closeEvent(QCloseEvent
*event
);
86 void slotLoadProgress(int);
87 void slotUpdateStatusbar(const QString
&string
);
88 void slotUpdateWindowTitle(const QString
&title
= QString());
90 void loadUrl(const QUrl
&url
);
91 void slotPreferences();
95 void slotFilePrintPreview();
97 void slotPrivateBrowsing();
98 void slotFileSaveAs();
100 void slotEditFindNext();
101 void slotEditFindPrevious();
102 void slotShowBookmarksDialog();
103 void slotAddBookmark();
104 void slotViewZoomIn();
105 void slotViewZoomOut();
106 void slotViewResetZoom();
107 void slotViewZoomTextOnly(bool enable
);
108 void slotViewToolbar();
109 void slotViewBookmarksBar();
110 void slotViewStatusbar();
111 void slotViewPageSource();
112 void slotViewFullScreen(bool enable
);
114 void slotWebSearch();
115 void slotToggleInspector(bool enable
);
116 void slotAboutApplication();
117 void slotDownloadManager();
118 void slotSelectLineEdit();
120 void slotAboutToShowBackMenu();
121 void slotAboutToShowForwardMenu();
122 void slotAboutToShowWindowMenu();
123 void slotOpenActionUrl(QAction
*action
);
124 void slotShowWindow();
125 void slotSwapFocus();
127 void printRequested(QWebFrame
*frame
);
128 void geometryChangeRequested(const QRect
&geometry
);
129 void updateToolbarActionText(bool visible
);
130 void updateBookmarksToolbarActionText(bool visible
);
133 void loadDefaultState();
136 void updateStatusbarActionText(bool visible
);
139 QToolBar
*m_navigationBar
;
140 ToolbarSearch
*m_toolbarSearch
;
141 BookmarksToolBar
*m_bookmarksToolbar
;
142 ChaseWidget
*m_chaseWidget
;
143 TabWidget
*m_tabWidget
;
144 AutoSaver
*m_autoSaver
;
146 QAction
*m_historyBack
;
147 QMenu
*m_historyBackMenu
;
148 QAction
*m_historyForward
;
149 QMenu
*m_historyForwardMenu
;
154 QAction
*m_stopReload
;
155 QAction
*m_viewToolbar
;
156 QAction
*m_viewBookmarkBar
;
157 QAction
*m_viewStatusbar
;
158 QAction
*m_restoreLastSession
;
159 QAction
*m_addBookmark
;
164 QString m_lastSearch
;
167 #endif // BROWSERMAINWINDOW_H