72
|
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 CNTCOMMLAUNCHERVIEW_H
|
|
19 |
#define CNTCOMMLAUNCHERVIEW_H
|
|
20 |
|
|
21 |
#include "cntcontactcardview.h"
|
|
22 |
|
|
23 |
#include <QObject>
|
|
24 |
#include <QKeyEvent>
|
|
25 |
#include <QGraphicsSceneResizeEvent>
|
|
26 |
#include "cntglobal.h"
|
|
27 |
#include <maptileservice.h>
|
|
28 |
|
|
29 |
class HbView;
|
|
30 |
class HbScrollArea;
|
|
31 |
class CntDocumentLoader;
|
|
32 |
class HbAction;
|
|
33 |
class HbIcon;
|
|
34 |
class QGraphicsWidget;
|
|
35 |
class QGraphicsLinearLayout;
|
|
36 |
class CntThumbnailManager;
|
|
37 |
class CntContactCardDataContainer;
|
|
38 |
class CntContactCardHeadingItem;
|
|
39 |
class CntContactCardDetailItem;
|
|
40 |
class CntContactCardDataItem;
|
|
41 |
class CntImageLabel;
|
|
42 |
class CntActionLauncher;
|
|
43 |
class XQServiceRequest;
|
|
44 |
class ShareUi;
|
|
45 |
class QStandardItemModel;
|
|
46 |
class QModelIndex;
|
|
47 |
class HbSelectionDialog;
|
|
48 |
class CntPresenceListener;
|
|
49 |
class HbLabel;
|
|
50 |
class CntSaveManager;
|
|
51 |
class QTimer;
|
|
52 |
|
|
53 |
QTM_BEGIN_NAMESPACE
|
|
54 |
class QContact;
|
|
55 |
class QContactManager;
|
|
56 |
class QContactDetail;
|
|
57 |
class QContactAction;
|
|
58 |
QTM_END_NAMESPACE
|
|
59 |
|
|
60 |
QTM_USE_NAMESPACE
|
|
61 |
|
|
62 |
//To store the maptile request information
|
|
63 |
class CntContactCardMapTileDetail
|
|
64 |
{
|
|
65 |
public:
|
|
66 |
//Contact id
|
|
67 |
int mContactId;
|
|
68 |
//Address type( preferred, home, work )
|
|
69 |
int mAddressType;
|
|
70 |
//Maptile status
|
|
71 |
int maptileStatus;
|
|
72 |
//Maptile progress icon animation count
|
|
73 |
int mProgressCount;
|
|
74 |
//Detial item containg contact address details
|
|
75 |
CntContactCardDetailItem* mDetailItem;
|
|
76 |
};
|
|
77 |
|
|
78 |
class CntContactCardViewPrivate : public QObject
|
|
79 |
{
|
|
80 |
Q_OBJECT
|
|
81 |
Q_DECLARE_PUBLIC(CntContactCardView)
|
|
82 |
|
|
83 |
public:
|
|
84 |
CntContactCardViewPrivate(bool isTemporary);
|
|
85 |
virtual ~CntContactCardViewPrivate();
|
|
86 |
|
|
87 |
#ifdef PBK_UNIT_TEST
|
|
88 |
public:
|
|
89 |
#else
|
|
90 |
protected:
|
|
91 |
#endif
|
|
92 |
bool eventFilter(QObject *obj, QEvent *event);
|
|
93 |
|
|
94 |
public slots:
|
|
95 |
void onItemActivated();
|
|
96 |
void editContact();
|
|
97 |
void viewHistory();
|
|
98 |
void onLongPressed(const QPointF &aCoords);
|
|
99 |
void setPreferredAction(const QString &aAction, const QContactDetail &aDetail, CntContactCardDetailItem *aDetailItem);
|
|
100 |
void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error);
|
|
101 |
void drawMenu(const QPointF &aCoords);
|
|
102 |
void sendToHs();
|
|
103 |
void onAddedToContacts();
|
|
104 |
void mapTileStatusReceived(int contactid, int addressType, int status);
|
|
105 |
|
|
106 |
private slots:
|
|
107 |
void sendBusinessCard();
|
|
108 |
void addToGroup();
|
|
109 |
void deleteContact();
|
|
110 |
void handleDeleteContact(int action);
|
|
111 |
void setAsFavorite();
|
|
112 |
void removeFromFavorite();
|
|
113 |
void actionExecuted(CntActionLauncher* aAction);
|
|
114 |
void setOrientation(Qt::Orientation orientation);
|
|
115 |
void showPreviousView();
|
|
116 |
void doChangeImage();
|
|
117 |
void doRemoveImage();
|
|
118 |
void showRootView();
|
|
119 |
void handleExtensionAction();
|
|
120 |
|
|
121 |
void handleMenuAction(HbAction* aAction);
|
|
122 |
void handleSendBusinessCard( HbAction* aAction );
|
|
123 |
void executeAction(QContact& aContact, const QContactDetail& aDetail, const QString& aAction);
|
|
124 |
void sendKeyCancelSlot();
|
|
125 |
void contactDeletedFromOtherSource(const QList<QContactLocalId>& contactIds);
|
|
126 |
void contactUpdatedFromOtherSource(const QList<QContactLocalId>& contactIds);
|
|
127 |
|
|
128 |
#ifdef PBK_UNIT_TEST
|
|
129 |
public slots:
|
|
130 |
#else
|
|
131 |
private slots:
|
|
132 |
#endif
|
|
133 |
// Maptile related functions
|
|
134 |
void updateSpinningIndicator();
|
|
135 |
void setMaptileSearchStopIcon( int index );
|
|
136 |
void setMaptileLabel( HbLabel*& mapLabel, const HbIcon& icon );
|
|
137 |
void updateMaptileImage();
|
|
138 |
HbLabel* loadMaptileLabel( int addressType );
|
|
139 |
void populateListItems();
|
|
140 |
|
|
141 |
// Presence related function
|
|
142 |
void updateItemPresence(const QString& accountUri, bool online);
|
|
143 |
|
|
144 |
public:
|
|
145 |
CntContactCardView* q_ptr;
|
|
146 |
void activate(const CntViewParameters aArgs);
|
|
147 |
void deactivate();
|
81
|
148 |
QString externalize(QDataStream &stream);
|
|
149 |
bool internalize(QDataStream &stream, CntViewParameters &viewParameters);
|
72
|
150 |
CntDocumentLoader* document();
|
|
151 |
QContactManager* contactManager();
|
|
152 |
|
|
153 |
signals:
|
|
154 |
void preferredUpdated();
|
|
155 |
void backPressed(int value);
|
|
156 |
void viewActivated(CntAbstractViewManager* aMgr, const CntViewParameters aArgs);
|
|
157 |
void addToContacts();
|
|
158 |
|
|
159 |
#ifdef PBK_UNIT_TEST
|
|
160 |
public:
|
|
161 |
#else
|
|
162 |
private:
|
|
163 |
#endif
|
|
164 |
void connectAction(QString actionName, const char* slot);
|
|
165 |
void executeAction(QContact& aContact, const QContactDetail& aDetail, const QString& aAction, CntContactCardDetailItem* aItem);
|
|
166 |
void executeDynamicAction(QContact& aContact, QContactDetail aDetail, QContactActionDescriptor aActionDescriptor);
|
|
167 |
bool sendKeyPressed();
|
|
168 |
void populateHeadingItem();
|
|
169 |
|
|
170 |
public:
|
|
171 |
CntAbstractViewManager* mViewManager; // not own
|
|
172 |
HbView* mView;
|
|
173 |
HbScrollArea *mScrollArea;
|
|
174 |
QGraphicsLinearLayout *mContainerLayout;
|
|
175 |
QGraphicsWidget* mContainerWidget;
|
|
176 |
QContact *mContact;
|
|
177 |
CntContactCardDataContainer *mDataContainer;
|
|
178 |
CntContactCardHeadingItem *mHeadingItem;
|
|
179 |
CntThumbnailManager *mThumbnailManager;
|
|
180 |
QContactAvatar *mAvatar;
|
|
181 |
QMap<QString, CntContactCardDetailItem*> mPreferredItems;
|
|
182 |
|
|
183 |
/// maps a QContactOnlineAccount (for example "sip:sip@sip.com") to a detail item
|
|
184 |
QMap<QString, CntContactCardDetailItem*> mPresenceItems;
|
|
185 |
CntDocumentLoader *mLoader;
|
|
186 |
HbAction *mBackKey;
|
|
187 |
CntImageLabel *mImageLabel;
|
|
188 |
HbIcon *mVCardIcon;
|
|
189 |
CntViewParameters mArgs;
|
|
190 |
ShareUi *mShareUi;
|
|
191 |
bool mAcceptSendKey;
|
|
192 |
CntPresenceListener* mPresenceListener; // own
|
|
193 |
MapTileService *mMaptile; //own
|
|
194 |
QList <CntContactCardMapTileDetail*> mAddressList;
|
|
195 |
QMap <int, HbLabel*> mMaptileLabelList;
|
|
196 |
bool mIsTemporary;
|
|
197 |
bool mIsExecutingAction;
|
|
198 |
QMap<QString, bool> mInitiialPrecenceData;
|
|
199 |
QContactLocalId mMyCardId;
|
|
200 |
CntSaveManager* mSaveManager; // own
|
|
201 |
CntAbstractEngine* mEngine;
|
|
202 |
QTimer* mProgressTimer; // own
|
|
203 |
int mListPopulationProgress;
|
|
204 |
bool mStopListPopulation;
|
81
|
205 |
bool mFetchAvatar;
|
|
206 |
HbLabel* mSeparatorlabel;
|
|
207 |
|
|
208 |
friend class TestCntContactCardView;
|
72
|
209 |
};
|
|
210 |
|
|
211 |
#endif // CNTCOMMLAUNCHERVIEW_H
|
|
212 |
|
|
213 |
// EOF
|