|
1 /* |
|
2 * Copyright (c) 2009 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 HSWIDGETHOSTVISUAL_H |
|
19 #define HSWIDGETHOSTVISUAL_H |
|
20 |
|
21 #include <HbWidget> |
|
22 #include <QMetaMethod> |
|
23 #include <QMetaProperty> |
|
24 |
|
25 #include "hsdomainmodel_global.h" |
|
26 #include "hsdomainmodeldatastructures.h" |
|
27 |
|
28 #include "hstest_global.h" |
|
29 HOMESCREEN_TEST_CLASS(TestHsDomainModel) |
|
30 |
|
31 class QStateMachine; |
|
32 |
|
33 class HsWidgetTouchArea; |
|
34 class HsWidgetComponent; |
|
35 class HsPage; |
|
36 class HsWidgetHost; |
|
37 |
|
38 class HSDOMAINMODEL_EXPORT HsWidgetHostVisual : public HbWidget |
|
39 { |
|
40 Q_OBJECT |
|
41 |
|
42 public: |
|
43 HsWidgetHostVisual(QGraphicsItem *parent = 0); |
|
44 ~HsWidgetHostVisual(); |
|
45 |
|
46 QPainterPath shape() const; |
|
47 void setWidget(QObject *widget); |
|
48 void setVisualModel(HsWidgetHost *model); |
|
49 HsWidgetHost *visualModel() const; |
|
50 signals: |
|
51 void resized(); |
|
52 |
|
53 public slots: |
|
54 void startDragEffect(); |
|
55 void startDropEffect(); |
|
56 |
|
57 protected: |
|
58 bool eventFilter(QObject *watched, QEvent *event); |
|
59 void gestureEvent(QGestureEvent *event); |
|
60 void mousePressEvent(QGraphicsSceneMouseEvent *) {} |
|
61 |
|
62 private: |
|
63 Q_DISABLE_COPY(HsWidgetHostVisual) |
|
64 void setupTouchArea(); |
|
65 void setupEffects(); |
|
66 |
|
67 void setNewSize(const QSizeF &size); |
|
68 |
|
69 |
|
70 private: |
|
71 HsWidgetTouchArea *mTouchArea; |
|
72 HsWidgetHost *mVisualModel; |
|
73 QGraphicsWidget *mWidget; |
|
74 HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel) |
|
75 }; |
|
76 |
|
77 #endif // HSWIDGETHOST_H |