|
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 CNTCOMMLAUNCHERLISTMODEL_H_ |
|
19 #define CNTCOMMLAUNCHERLISTMODEL_H_ |
|
20 |
|
21 #include <QSharedData> |
|
22 #include <qtcontacts.h> |
|
23 |
|
24 #include "cntstringmapper.h" |
|
25 |
|
26 class CntContactCardDataItem; |
|
27 class MapTileService; |
|
28 class CntExtensionManager; |
|
29 |
|
30 class CntContactCardDataContainer: public QObject |
|
31 { |
|
32 Q_OBJECT |
|
33 |
|
34 public: |
|
35 CntContactCardDataContainer( |
|
36 MapTileService* maptile, |
|
37 CntExtensionManager& aExtensionManager, |
|
38 Qt::Orientations orientation = Qt::Vertical, |
|
39 QObject *parent = 0); |
|
40 virtual ~CntContactCardDataContainer(); |
|
41 |
|
42 public: |
|
43 CntContactCardDataItem* dataItem(int index) const; |
|
44 int itemCount() const; |
|
45 void setContactData(QContact* contact, bool aMyCard = false); |
|
46 void clearContactData(); |
|
47 |
|
48 #ifdef PBK_UNIT_TEST |
|
49 public: |
|
50 #else |
|
51 private: |
|
52 #endif |
|
53 void initializeActionsData(bool myCard); |
|
54 void initialiseExtensionActions(bool aMyCard); |
|
55 void initializeGroupData(); |
|
56 void initializeDetailsData(); |
|
57 QList<QContactDetail> actionDetails(const QString &actionName, const QContact &contact); |
|
58 bool supportsDetail(const QString &actionName, const QContactDetail &contactDetail); |
|
59 void addSeparator(int index); |
|
60 void sortDataItems(); |
|
61 int getPosition(const QString& aId, const QString& aContext, bool dynamicAction = false); |
|
62 |
|
63 #ifdef PBK_UNIT_TEST |
|
64 public: |
|
65 #else |
|
66 private: |
|
67 #endif |
|
68 QContact* mContact; |
|
69 QContactAction* mCallAction; |
|
70 QContactAction* mMessageAction; |
|
71 QList<CntContactCardDataItem*> mDataItemList; |
|
72 int mSeparatorIndex; |
|
73 CntStringMapper mStringMapper; |
|
74 bool mLocationFeatureEnabled; |
|
75 MapTileService* mMaptileInterface; |
|
76 Qt::Orientations mOrientation; |
|
77 CntExtensionManager* mExtensionManager; |
|
78 }; |
|
79 |
|
80 #endif /* CNTCOMMLAUNCHERLISTMODEL_H_ */ |