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>
47 #include <QtUiTools/QUiLoader>
54 #include <qwebelement.h>
55 #include <qwebframe.h>
56 #include <qwebinspector.h>
57 #include <qwebsettings.h>
59 #include "DumpRenderTreeSupportQt.h"
60 #include "mainwindow.h"
61 #include "urlloader.h"
63 #include "webinspector.h"
67 class QPropertyAnimation;
72 : useGraphicsView(false)
74 , useCompositing(true)
75 , useTiledBackingStore(false)
77 , useFrameFlattening(false)
79 , showFrameRate(false)
80 , resizesToContents(false)
81 , viewportUpdateMode(QGraphicsView::MinimalViewportUpdate)
82 , useLocalStorage(false)
83 , useOfflineStorageDatabase(false)
84 , useOfflineWebApplicationCache(false)
85 , useDiskCookies(true)
86 , offlineStorageDefaultQuotaSize(0)
88 , useQGLWidgetViewport(false)
93 , printLoadedUrls(false)
94 , startMaximized(false)
101 bool useTiledBackingStore;
103 bool useFrameFlattening;
106 bool resizesToContents;
107 QGraphicsView::ViewportUpdateMode viewportUpdateMode;
108 bool useLocalStorage;
109 bool useOfflineStorageDatabase;
110 bool useOfflineWebApplicationCache;
112 quint64 offlineStorageDefaultQuotaSize;
114 bool useQGLWidgetViewport;
116 #if defined(Q_WS_X11)
119 bool printLoadedUrls;
121 quint16 remoteInspectorPort;
125 class LauncherWindow : public MainWindow {
129 LauncherWindow(WindowOptions* data = 0, QGraphicsScene* sharedScene = 0);
130 virtual ~LauncherWindow();
132 void sendTouchEvent();
134 bool eventFilter(QObject* obj, QEvent* event);
140 void showLinkHover(const QString &link, const QString &toolTip);
145 void toggleZoomTextOnly(bool on);
146 void zoomAnimationFinished();
151 void setEditable(bool on);
153 /* void dumpPlugins() */
156 void loadURLListFromFile();
158 void setDiskCache(bool enable);
159 void setTouchMocking(bool on);
160 void toggleWebView(bool graphicsBased);
161 void toggleAcceleratedCompositing(bool toggle);
162 void toggleTiledBackingStore(bool toggle);
163 void toggleResizesToContents(bool toggle);
164 void toggleWebGL(bool toggle);
165 void toggleSpatialNavigation(bool b);
166 void toggleFullScreenMode(bool enable);
167 void toggleFrameFlattening(bool toggle);
168 void toggleInterruptingJavaScriptEnabled(bool enable);
169 void toggleJavascriptCanOpenWindows(bool enable);
170 void toggleAutoLoadImages(bool enable);
171 void setUseDiskCookies(bool enable);
173 void togglePlugins(bool enable);
174 void toggleLocalStorage(bool toggle);
175 void toggleOfflineStorageDatabase(bool toggle);
176 void toggleOfflineWebApplicationCache(bool toggle);
177 void setOfflineStorageDefaultQuota();
178 #ifndef QT_NO_LINEEDIT
183 void toggleQGLWidgetViewport(bool enable);
186 void changeViewportUpdateMode(int mode);
188 void animatedYFlip();
189 void selectElements();
190 void showFPS(bool enable);
191 void showUserAgentDialog();
193 void printURL(const QUrl&);
194 #if !defined(QT_NO_FILEDIALOG) && !defined(QT_NO_MESSAGEBOX)
195 void downloadRequest(const QNetworkRequest&);
196 void fileDownloadFinished();
200 LauncherWindow* newWindow();
201 LauncherWindow* cloneWindow();
202 void updateFPS(int fps);
205 void enteredFullScreenMode(bool on);
209 void initializeView();
214 bool isGraphicsBased() const;
217 static QVector<int> m_zoomLevels;
220 UrlLoader* m_urlLoader;
223 WebInspector* m_inspector;
225 WindowOptions m_windowOptions;
227 QAction* m_formatMenuAction;
229 QPropertyAnimation* m_zoomAnimation;
230 #if !defined(QT_NO_FILEDIALOG) && !defined(QT_NO_MESSAGEBOX)
231 QNetworkReply* m_reply;
233 QList<QTouchEvent::TouchPoint> m_touchPoints;
237 #ifndef QT_NO_LINEEDIT
239 QLineEdit* m_lineEdit;
241 static const int s_findNormalFlag = 0;