1 /* |
1 /* |
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
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 * |
4 * |
9 * Initial Contributors: |
5 * This program is free software: you can redistribute it and/or modify |
10 * Nokia Corporation - initial contribution. |
6 * it under the terms of the GNU Lesser General Public License as published by |
|
7 * the Free Software Foundation, version 2.1 of the License. |
11 * |
8 * |
12 * Contributors: |
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU Lesser General Public License for more details. |
13 * |
13 * |
14 * Description: |
14 * You should have received a copy of the GNU Lesser General Public License |
|
15 * along with this program. If not, |
|
16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". |
|
17 * |
|
18 * Description: |
15 * |
19 * |
16 */ |
20 */ |
17 |
|
18 |
21 |
19 #ifndef __GINEBRA_WEBCHROMEITEM_H__ |
22 #ifndef __GINEBRA_WEBCHROMEITEM_H__ |
20 #define __GINEBRA_WEBCHROMEITEM_H__ |
23 #define __GINEBRA_WEBCHROMEITEM_H__ |
21 |
24 |
22 #include <QtGui> |
25 #include <QtGui> |
23 #include <QWebElement> |
26 #include <QWebElement> |
24 #include "CachedHandler.h" |
27 #include "CachedHandler.h" |
|
28 #include "ChromeItem.h" |
25 |
29 |
26 namespace GVA { |
30 namespace GVA { |
27 |
31 |
28 class ChromeWidget; |
32 class ChromeWidget; |
29 class ChromeRenderer; |
33 class ChromeRenderer; |
30 class WebChromeSnippet; |
34 class WebChromeSnippet; |
31 |
35 |
32 class WebChromeItem : public QGraphicsWidget |
36 class WebChromeItem : public ChromeItem |
33 { |
37 { |
34 Q_OBJECT |
38 Q_OBJECT |
35 public: |
39 public: |
36 WebChromeItem(const QRectF& ownerArea, ChromeWidget* chrome, const QWebElement & element, QGraphicsItem* parent=0); |
40 WebChromeItem(const QRectF& ownerArea, ChromeWidget* chrome, const QWebElement & element, QGraphicsItem* parent=0); |
37 virtual ~WebChromeItem(); |
41 virtual ~WebChromeItem(); |
46 bool event(QEvent* event); |
50 bool event(QEvent* event); |
47 ChromeWidget * chrome() { return m_chrome; } |
51 ChromeWidget * chrome() { return m_chrome; } |
48 QWebElement element() { return m_element; } |
52 QWebElement element() { return m_element; } |
49 inline bool isPainting() { return m_painting; } |
53 inline bool isPainting() { return m_painting; } |
50 public slots: |
54 public slots: |
51 void repaintFromChrome(const QRectF& rect = QRectF()); |
|
52 //inline void setCacheMode(bool mode) {m_cacheMode = mode;}; |
55 //inline void setCacheMode(bool mode) {m_cacheMode = mode;}; |
53 signals: |
56 signals: |
54 void contextMenu(QGraphicsSceneContextMenuEvent * ev); |
57 void contextMenu(QGraphicsSceneContextMenuEvent * ev); |
55 void mouseEvent(QEvent::Type type); |
|
56 protected: |
58 protected: |
57 void contextMenuEvent(QGraphicsSceneContextMenuEvent * ev); |
59 void contextMenuEvent(QGraphicsSceneContextMenuEvent * ev); |
58 void mousePressEvent(QGraphicsSceneMouseEvent * ev); |
60 void mousePressEvent(QGraphicsSceneMouseEvent * ev); |
59 void mouseReleaseEvent(QGraphicsSceneMouseEvent * ev); |
61 void mouseReleaseEvent(QGraphicsSceneMouseEvent * ev); |
60 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *ev); |
62 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *ev); |