|
1 /* |
|
2 * Copyright (c) 2009-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 #ifndef NMVIEWERWEBVIEW_H_ |
|
19 #define NMVIEWERWEBVIEW_H_ |
|
20 |
|
21 #include <QGraphicsWebView> |
|
22 |
|
23 #include "nmcommon.h" |
|
24 |
|
25 class NmViewerView; |
|
26 class NmMessage; |
|
27 class QGestureEvent; |
|
28 |
|
29 class NmMailViewerWkContentItem |
|
30 { |
|
31 public: |
|
32 NmMailViewerWkContentItem() |
|
33 : mData(0), mPartId(0), mIsFetched(false) {} |
|
34 NmMailViewerWkContentItem(QVariant data, NmId partId, bool isFetched) |
|
35 : mData(data), mPartId(partId), mIsFetched(isFetched) {} |
|
36 QVariant mData; |
|
37 NmId mPartId; |
|
38 bool mIsFetched; |
|
39 }; |
|
40 |
|
41 class NmMailViewerWK : public QGraphicsWebView |
|
42 { |
|
43 Q_OBJECT |
|
44 public: |
|
45 NmMailViewerWK(); |
|
46 ~NmMailViewerWK(); |
|
47 virtual QVariant loadResource (int type, const QUrl &name, NmId &partId, bool &isFetched); |
|
48 void addContent(QString key, QVariant val, NmId partId, bool isFetched); |
|
49 bool event(QEvent* event); |
|
50 |
|
51 protected: |
|
52 void contextMenuEvent(QGraphicsSceneContextMenuEvent* event); |
|
53 void gestureEvent(QGestureEvent* event); |
|
54 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event); |
|
55 void mouseMoveEvent(QGraphicsSceneMouseEvent* event); |
|
56 void mouseReleaseEvent(QGraphicsSceneMouseEvent* event); |
|
57 |
|
58 private: |
|
59 QMap<QString,NmMailViewerWkContentItem> mContent; |
|
60 bool mSuppressRelease; |
|
61 }; |
|
62 |
|
63 #endif /* NMVIEWERWEBVIEW_H_*/ |