|
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 #include "WebViewEventContext.h" |
|
20 #include <QWebHitTestResult> |
|
21 #include <QWebElement> |
|
22 |
|
23 static const QString s_ObjectName = "webEventViewContext"; |
|
24 |
|
25 WebViewEventContext::WebViewEventContext() |
|
26 { |
|
27 setObjectName(s_ObjectName); |
|
28 } |
|
29 |
|
30 WebViewEventContext::WebViewEventContext(const QString &viewType, const QWebHitTestResult &hitTest) |
|
31 : ViewEventContext(viewType, hitTest.pos()), |
|
32 m_linkText(hitTest.linkText()), |
|
33 m_linkUrl(hitTest.linkUrl().toString()), |
|
34 m_linkTitle(hitTest.linkTitle().toString()), |
|
35 m_elementId(hitTest.element().attribute("id")), |
|
36 m_frameName(hitTest.frame() ? hitTest.frame()->frameName() : QString::null), |
|
37 m_imageUrl(hitTest.imageUrl().toString()), |
|
38 m_isContentSelected(hitTest.isContentSelected()), |
|
39 m_linkElementId(hitTest.linkElement().attribute("id")), |
|
40 m_linkFrameName(hitTest.linkTargetFrame() ? hitTest.linkTargetFrame()->frameName() : QString::null) |
|
41 { |
|
42 setObjectName(s_ObjectName); |
|
43 } |
|
44 |
|
45 |
|
46 WebViewEventContext::WebViewEventContext(const WebViewEventContext &o) |
|
47 : ViewEventContext(o.getViewType(), o.getPosition()), |
|
48 m_linkText(o.getLinkText()), |
|
49 m_linkUrl(o.getLinkUrl()), |
|
50 m_linkTitle(o.getLinkTitle()), |
|
51 m_elementId(o.getElementId()), |
|
52 m_frameName(o.getFrameName()), |
|
53 m_imageUrl(o.getImageUrl()), |
|
54 m_isContentSelected(o.getIsContentSelected()), |
|
55 m_linkElementId(o.getLinkFrameName()), |
|
56 m_linkFrameName(o.getLinkFrameName()) |
|
57 { |
|
58 m_viewType = o.getViewType(); |
|
59 setObjectName(o.objectName()); |
|
60 } |
|
61 |