1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __GINEBRA_APPCONTENTVIEW_H__ |
|
20 #define __GINEBRA_APPCONTENTVIEW_H__ |
|
21 |
|
22 #include "ContentViewDelegate.h" |
|
23 #include <QGraphicsWebView> |
|
24 #include <QNetworkAccessManager> |
|
25 |
|
26 class QTimeLine; |
|
27 |
|
28 namespace GVA { |
|
29 |
|
30 class AppContentView : public ContentViewDelegate |
|
31 { |
|
32 Q_OBJECT |
|
33 public: |
|
34 AppContentView(ChromeWidget * chrome, QObject * parent = 0); |
|
35 virtual ~AppContentView(); |
|
36 QGraphicsWidget * view() {return static_cast<QGraphicsWidget*>(m_view);} |
|
37 QWebPage * page() {return m_page;} |
|
38 #ifndef NO_QSTM_GESTURE |
|
39 bool eventFilter(QObject* object, QEvent* event); |
|
40 #endif |
|
41 void addJSObjectToWindow(QObject *object); |
|
42 public slots: |
|
43 void load(const QString& url); |
|
44 void setHtml(const QString& html); |
|
45 void triggerAction(const QString & action); |
|
46 void stop(); |
|
47 void back(); |
|
48 void forward(); |
|
49 void reload(); |
|
50 void zoomBy(qreal delta); |
|
51 void zoom(bool in); |
|
52 void toggleZoom(); |
|
53 void stopZoom(); |
|
54 void scrollBy(int deltaX, int deltaY); |
|
55 int scrollX(); |
|
56 int scrollY(); |
|
57 int contentWidth(); |
|
58 int contentHeight(); |
|
59 void onUrlChanged(const QUrl & url); |
|
60 private slots: |
|
61 void updateZoom(qreal delta); |
|
62 signals: |
|
63 void iconChanged(); |
|
64 void loadFinished(bool ok); |
|
65 void loadProgress(int progress); |
|
66 void loadStarted(); |
|
67 void statusBarMessage(const QString & text); |
|
68 void titleChanged(const QString & title); |
|
69 void urlChanged(const QString & url); |
|
70 void javaScriptWindowObjectCleared(); |
|
71 private: |
|
72 QGraphicsWebView * m_view; |
|
73 QWebPage * m_page; |
|
74 QTimeLine * m_timeLine; |
|
75 bool m_zoomIn; |
|
76 }; |
|
77 |
|
78 } // end of namespace GVA |
|
79 |
|
80 #endif // __GINEBRA_APPCONTENTVIEW_H__ |
|