|
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 CNTEDITVIEWHEADINGITEM_H |
|
19 #define CNTEDITVIEWHEADINGITEM_H |
|
20 |
|
21 #include <QObject> |
|
22 #include <hbwidget.h> |
|
23 #include <qmobilityglobal.h> |
|
24 |
|
25 class HbIconItem; |
|
26 class HbTextItem; |
|
27 class HbFrameItem; |
|
28 class HbTouchArea; |
|
29 |
|
30 QTM_BEGIN_NAMESPACE |
|
31 class QContact; |
|
32 QTM_END_NAMESPACE |
|
33 |
|
34 QTM_USE_NAMESPACE |
|
35 |
|
36 class CntEditViewHeadingItem : public HbWidget |
|
37 { |
|
38 Q_OBJECT |
|
39 Q_PROPERTY( QString text READ getText ) |
|
40 Q_PROPERTY( QString second_text READ getSecond_text ) |
|
41 Q_PROPERTY( HbIcon icon READ getIcon WRITE setIcon ) |
|
42 |
|
43 public: |
|
44 CntEditViewHeadingItem(QGraphicsItem *parent = 0); |
|
45 ~CntEditViewHeadingItem(); |
|
46 |
|
47 protected: |
|
48 void mousePressEvent(QGraphicsSceneMouseEvent *event); |
|
49 void mouseMoveEvent(QGraphicsSceneMouseEvent *event); |
|
50 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); |
|
51 |
|
52 signals: |
|
53 void iconClicked(); |
|
54 void textClicked(); |
|
55 |
|
56 public: |
|
57 void createPrimitives(); |
|
58 void recreatePrimitives(); |
|
59 void updatePrimitives(); |
|
60 void setDetails(const QContact* contact); |
|
61 |
|
62 QString getText() const { return text; } |
|
63 QString getSecond_text() const { return second_text; } |
|
64 HbIcon getIcon() const { return icon; } |
|
65 |
|
66 void setIcon(const HbIcon newIcon); |
|
67 |
|
68 #ifdef PBK_UNIT_TEST |
|
69 public: |
|
70 #else |
|
71 private: |
|
72 #endif |
|
73 HbIconItem *mIcon; |
|
74 HbTextItem *mLabel; |
|
75 HbTextItem *mSecondLabel; |
|
76 HbFrameItem *mFrameItem; |
|
77 HbTouchArea *mIconTouchArea; |
|
78 |
|
79 bool mIconFocused; |
|
80 bool mTextFocused; |
|
81 |
|
82 QString text; |
|
83 QString second_text; |
|
84 HbIcon icon; |
|
85 }; |
|
86 |
|
87 #endif // CNTEDITVIEWHEADINGITEM_H |