|
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 CNTCONTACTCARDDATAITEM_H |
|
19 #define CNTCONTACTCARDDATAITEM_H |
|
20 |
|
21 #include <QObject> |
|
22 #include <qmobilityglobal.h> |
|
23 #include <qtcontacts.h> |
|
24 #include <hbicon.h> |
|
25 |
|
26 class CntUiContactCardExtension; |
|
27 |
|
28 QTM_USE_NAMESPACE |
|
29 |
|
30 class CntContactCardDataItem: public QObject |
|
31 { |
|
32 Q_OBJECT |
|
33 |
|
34 public: |
|
35 |
|
36 enum CntContactCardPosition |
|
37 { |
|
38 |
|
39 // Communication methods >>>>> |
|
40 EInternalServices = 0, |
|
41 ECallMobile = 100, |
|
42 ECallMobileSendMessage, |
|
43 ECallMobileHome, |
|
44 ECallMobileHomeSendMessage, |
|
45 ECallMobileWork, |
|
46 ECallMobileWorkSendMessage, |
|
47 ECallPhone, |
|
48 ECallPhoneHome, |
|
49 ECallPhoneWork, |
|
50 ECallFax, |
|
51 ECallFaxHome, |
|
52 ECallFaxWork, |
|
53 ECallPager, |
|
54 ECallAssistant, |
|
55 ECallCar, |
|
56 EEmail, |
|
57 EEmailHome, |
|
58 EEmailWork, |
|
59 EUrl, |
|
60 EUrlHome, |
|
61 EUrlWork, |
|
62 ECallDynamic, |
|
63 ECallDynamicHome, |
|
64 ECallDynamicWork, |
|
65 EEmailDynamic, |
|
66 EEmailDynamicHome, |
|
67 EEmailDynamicWork, |
|
68 EUrlDynamic, |
|
69 EUrlDynamicHome, |
|
70 EUrlDynamicWork, |
|
71 EInternetDynamic, |
|
72 EInternetDynamicHome, |
|
73 EInternetDynamicWork, |
|
74 EAddressDynamic, |
|
75 EAddressDynamicHome, |
|
76 EAddressDynamicWork, |
|
77 EDynamic, |
|
78 EGenericDynamic, |
|
79 ELastAction = 200, |
|
80 ELastActionHome, |
|
81 ELastActionWork, |
|
82 EExternalServices = 250, |
|
83 ESeparator = 300, |
|
84 // <<<<< Communication methods end here. |
|
85 |
|
86 EInternetTelephone, |
|
87 EInternetTelephoneHome, |
|
88 EInternetTelephoneWork, |
|
89 ESip, |
|
90 EAddress, |
|
91 EAddressHome, |
|
92 EAddressWork, |
|
93 ECompanyDetails, |
|
94 EAssistantName, |
|
95 EBirthday, |
|
96 EAnniversary, |
|
97 ERingtone, |
|
98 ENote, |
|
99 ESpouse, |
|
100 EChildren, |
|
101 EOther = 400, |
|
102 ENotSupported = 1000 |
|
103 }; |
|
104 |
|
105 public: |
|
106 CntContactCardDataItem(const QString& aTitle, int aPosition, bool aIsFocusable); |
|
107 virtual ~CntContactCardDataItem(); |
|
108 |
|
109 public: |
|
110 void setTitleText(const QString& aTitle); |
|
111 void setValueText(const QString& aValueText, Qt::TextElideMode aValueTextElideMode = Qt::ElideNone); |
|
112 void setIcon(HbIcon aIcon); |
|
113 void setSecondaryIcon(HbIcon aSecondaryIcon); |
|
114 void setAction(const QString& aAction); |
|
115 void setContactDetail(QContactDetail aDetail); |
|
116 void setActionDescriptor(const QContactActionDescriptor& aActionDescriptor); |
|
117 void setLongPressText(const QString& aLongPressText); |
|
118 void setContactCardExtensionAndActionIndex( CntUiContactCardExtension& aExtension, int aIndex ); |
|
119 |
|
120 public: |
|
121 QString titleText() const { return mTitle; } |
|
122 QString valueText() const { return mValueText; } |
|
123 HbIcon icon() const { return mIcon; } |
|
124 HbIcon secondaryIcon() const { return mSecondaryIcon; } |
|
125 QString action() const { return mAction; } |
|
126 QContactDetail detail() const { return mDetail; } |
|
127 Qt::TextElideMode elideMode() const { return mValueTextElideMode; } |
|
128 bool isFocusable() const { return mIsFocusable; } |
|
129 QContactActionDescriptor actionDescriptor() const { return mActionDescriptor; } |
|
130 QString longPressText() const { return mLongPressText; } |
|
131 |
|
132 /// Can return NULL which means this item is not from an extension. |
|
133 CntUiContactCardExtension* contactCardExtension() const {return mExtension;} |
|
134 int contactCardExtensionActionIndex() const {return mExtensionActionIndex;} |
|
135 |
|
136 int position() const { return mPosition; } |
|
137 |
|
138 private: |
|
139 HbIcon mIcon; |
|
140 HbIcon mSecondaryIcon; |
|
141 QString mTitle; |
|
142 QString mValueText; |
|
143 QString mAction; |
|
144 QContactActionDescriptor mActionDescriptor; |
|
145 QContactDetail mDetail; |
|
146 Qt::TextElideMode mValueTextElideMode; |
|
147 bool mIsFocusable; |
|
148 QString mLongPressText; |
|
149 CntUiContactCardExtension* mExtension; |
|
150 int mExtensionActionIndex; |
|
151 |
|
152 public: |
|
153 int mPosition; |
|
154 }; |
|
155 |
|
156 #endif /* CNTCONTACTCARDDATAITEM_H */ |