2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
3 * Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
4 * Copyright (C) 2006 George Staikos <staikos@kde.org>
5 * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2006 Zack Rusin <zack@kde.org>
7 * Copyright (C) 2006 Simon Hausmann <hausmann@kde.org>
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
20 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
21 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
28 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #ifndef launcherwindow_h
34 #define launcherwindow_h
36 #include <QtNetwork/QNetworkRequest>
39 #include <QtOpenGL/QGLWidget>
42 #if !defined(QT_NO_PRINTER)
43 #include <QPrintPreviewDialog>
50 #include <qwebelement.h>
51 #include <qwebframe.h>
52 #include <qwebinspector.h>
53 #include <qwebsettings.h>
55 #include "mainwindow.h"
56 #include "urlloader.h"
58 #include "webinspector.h"
63 class QPropertyAnimation;
70 : useGraphicsView(false)
72 , useCompositing(true)
73 , useTiledBackingStore(false)
75 , useFrameFlattening(false)
77 , showFrameRate(false)
78 , resizesToContents(false)
79 , viewportUpdateMode(QGraphicsView::MinimalViewportUpdate)
80 , useLocalStorage(false)
81 , useOfflineStorageDatabase(false)
82 , useOfflineWebApplicationCache(false)
83 , useDiskCookies(true)
84 , offlineStorageDefaultQuotaSize(0)
86 , useQGLWidgetViewport(false)
88 , printLoadedUrls(false)
89 , startMaximized(false)
96 bool useTiledBackingStore;
98 bool useFrameFlattening;
101 bool resizesToContents;
102 QGraphicsView::ViewportUpdateMode viewportUpdateMode;
103 bool useLocalStorage;
104 bool useOfflineStorageDatabase;
105 bool useOfflineWebApplicationCache;
107 quint64 offlineStorageDefaultQuotaSize;
109 bool useQGLWidgetViewport;
111 bool printLoadedUrls;
113 quint16 remoteInspectorPort;
117 class LauncherWindow : public MainWindow {
121 LauncherWindow(WindowOptions* data = 0, QGraphicsScene* sharedScene = 0);
122 virtual ~LauncherWindow();
124 void sendTouchEvent();
126 bool eventFilter(QObject* obj, QEvent* event);
132 void showLinkHover(const QString &link, const QString &toolTip);
137 void toggleZoomTextOnly(bool on);
138 void zoomAnimationFinished();
143 void setEditable(bool on);
145 /* void dumpPlugins() */
148 void loadURLListFromFile();
150 void setDiskCache(bool enable);
151 void setTouchMocking(bool on);
152 void toggleWebView(bool graphicsBased);
153 void toggleAcceleratedCompositing(bool toggle);
154 void toggleTiledBackingStore(bool toggle);
155 void toggleResizesToContents(bool toggle);
156 void toggleWebGL(bool toggle);
157 void toggleSpatialNavigation(bool b);
158 void toggleFullScreenMode(bool enable);
159 void toggleFrameFlattening(bool toggle);
160 void toggleInterruptingJavaScriptEnabled(bool enable);
161 void toggleJavascriptCanOpenWindows(bool enable);
162 void toggleAutoLoadImages(bool enable);
163 void setUseDiskCookies(bool enable);
165 void togglePlugins(bool enable);
166 void toggleLocalStorage(bool toggle);
167 void toggleOfflineStorageDatabase(bool toggle);
168 void toggleOfflineWebApplicationCache(bool toggle);
169 void setOfflineStorageDefaultQuota();
170 #ifndef QT_NO_LINEEDIT
175 void toggleQGLWidgetViewport(bool enable);
178 void changeViewportUpdateMode(int mode);
180 void animatedYFlip();
181 void selectElements();
182 void showFPS(bool enable);
183 void showUserAgentDialog();
185 void printURL(const QUrl&);
186 #if !defined(QT_NO_FILEDIALOG) && !defined(QT_NO_MESSAGEBOX)
187 void downloadRequest(const QNetworkRequest&);
188 void fileDownloadFinished();
192 LauncherWindow* newWindow();
193 LauncherWindow* cloneWindow();
194 void updateFPS(int fps);
197 void enteredFullScreenMode(bool on);
201 void initializeView();
206 bool isGraphicsBased() const;
209 static QVector<int> m_zoomLevels;
212 UrlLoader* m_urlLoader;
215 WebInspector* m_inspector;
217 WindowOptions m_windowOptions;
219 QAction* m_formatMenuAction;
221 QPropertyAnimation* m_zoomAnimation;
222 #if !defined(QT_NO_FILEDIALOG) && !defined(QT_NO_MESSAGEBOX)
223 QNetworkReply* m_reply;
225 QList<QTouchEvent::TouchPoint> m_touchPoints;
229 #ifndef QT_NO_LINEEDIT
231 QLineEdit* m_lineEdit;
233 static const int s_findNormalFlag = 0;