ginebra2/ContentViews/WebView.h
author hgs
Fri, 15 Oct 2010 17:30:59 -0400
changeset 16 3c88a81ff781
parent 3 0954f5dd2cd0
permissions -rw-r--r--
201041
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
*
hgs
parents:
diff changeset
     5
* This program is free software: you can redistribute it and/or modify
hgs
parents:
diff changeset
     6
* it under the terms of the GNU Lesser General Public License as published by
hgs
parents:
diff changeset
     7
* the Free Software Foundation, version 2.1 of the License.
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* This program is distributed in the hope that it will be useful,
hgs
parents:
diff changeset
    10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
hgs
parents:
diff changeset
    11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
hgs
parents:
diff changeset
    12
* GNU Lesser General Public License for more details.
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* You should have received a copy of the GNU Lesser General Public License
hgs
parents:
diff changeset
    15
* along with this program.  If not,
hgs
parents:
diff changeset
    16
* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
hgs
parents:
diff changeset
    17
*
hgs
parents:
diff changeset
    18
* Description:
hgs
parents:
diff changeset
    19
*
hgs
parents:
diff changeset
    20
*/
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
#ifndef WebView_h
hgs
parents:
diff changeset
    23
#define WebView_h
hgs
parents:
diff changeset
    24
hgs
parents:
diff changeset
    25
#include <QGraphicsWebView>
hgs
parents:
diff changeset
    26
16
hgs
parents: 3
diff changeset
    27
#ifdef OWN_BACKING_STORE
hgs
parents: 3
diff changeset
    28
#include "TiledWebView.h"
hgs
parents: 3
diff changeset
    29
#endif // OWN_BACKING_STORE
hgs
parents: 3
diff changeset
    30
3
hgs
parents:
diff changeset
    31
class QWebPage;
hgs
parents:
diff changeset
    32
hgs
parents:
diff changeset
    33
namespace GVA {
hgs
parents:
diff changeset
    34
16
hgs
parents: 3
diff changeset
    35
#ifdef OWN_BACKING_STORE
hgs
parents: 3
diff changeset
    36
typedef TiledWebView WebViewParent;
hgs
parents: 3
diff changeset
    37
#else
hgs
parents: 3
diff changeset
    38
typedef QGraphicsWebView WebViewParent;
hgs
parents: 3
diff changeset
    39
#endif // OWN_BACKING_STORE
hgs
parents: 3
diff changeset
    40
hgs
parents: 3
diff changeset
    41
class WebView :public WebViewParent {
3
hgs
parents:
diff changeset
    42
    Q_OBJECT
hgs
parents:
diff changeset
    43
    Q_PROPERTY(QWebPage* page READ page WRITE setPage)
hgs
parents:
diff changeset
    44
public:
hgs
parents:
diff changeset
    45
    WebView();
hgs
parents:
diff changeset
    46
    ~WebView();
hgs
parents:
diff changeset
    47
hgs
parents:
diff changeset
    48
    QWebPage* page()const;
hgs
parents:
diff changeset
    49
    void setPage(QWebPage* page);
16
hgs
parents: 3
diff changeset
    50
    bool event(QEvent * e);
hgs
parents: 3
diff changeset
    51
    bool eventFilter(QObject* o, QEvent* e);
hgs
parents: 3
diff changeset
    52
    bool sceneEvent(QEvent* event);
hgs
parents: 3
diff changeset
    53
    
3
hgs
parents:
diff changeset
    54
protected:
hgs
parents:
diff changeset
    55
    QWebPage* createWebPage();
hgs
parents:
diff changeset
    56
hgs
parents:
diff changeset
    57
private:
hgs
parents:
diff changeset
    58
    QWebPage* m_webPage;
hgs
parents:
diff changeset
    59
hgs
parents:
diff changeset
    60
};//WebView
hgs
parents:
diff changeset
    61
}//namespace GVA
hgs
parents:
diff changeset
    62
hgs
parents:
diff changeset
    63
#endif //WebView_h