|
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 CNTEDITVIEW_P_H_ |
|
19 #define CNTEDITVIEW_P_H_ |
|
20 |
|
21 #include <QObject> |
|
22 |
|
23 #include "cnteditview.h" |
|
24 #include "cntglobal.h" |
|
25 #include <qtcontacts.h> |
|
26 #include <cnteditviewitemcallback.h> |
|
27 #include <xqappmgr.h> |
|
28 #include <qabstractitemmodel.h> |
|
29 |
|
30 class CntAbstractViewManager; |
|
31 class CntEditViewListModel; |
|
32 class CntEditViewHeadingItem; |
|
33 class CntEditViewItem; |
|
34 class CntImageLabel; |
|
35 |
|
36 class CntThumbnailManager; |
|
37 class QModelIndex; |
|
38 class HbDocumentLoader; |
|
39 class HbAbstractViewItem; |
|
40 class HbListView; |
|
41 class HbView; |
|
42 class HbAction; |
|
43 class QAction; |
|
44 class HbMenu; |
|
45 class XQAiwRequest; |
|
46 class CntSaveManager; |
|
47 class CntAbstractEngine; |
|
48 |
|
49 QTM_BEGIN_NAMESPACE |
|
50 class QContact; |
|
51 class QContactDetail; |
|
52 class QContactId; |
|
53 QTM_END_NAMESPACE |
|
54 QTM_USE_NAMESPACE |
|
55 |
|
56 class CntEditViewPrivate : public QObject, public CntEditViewItemCallback |
|
57 { |
|
58 Q_OBJECT |
|
59 |
|
60 public: |
|
61 CntEditViewPrivate(); |
|
62 ~CntEditViewPrivate(); |
|
63 |
|
64 void activate( const CntViewParameters aArgs ); |
|
65 void deactivate(); |
|
66 |
|
67 public: // From CntEditViewItemCallback |
|
68 void openView(CntViewParameters& viewParams); |
|
69 void requestRefresh(); |
|
70 |
|
71 public: |
|
72 CntEditView* q_ptr; |
|
73 |
|
74 private slots: |
|
75 void showPreviousView(); |
|
76 void activated( const QModelIndex& aIndex ); |
|
77 void longPressed( HbAbstractViewItem *item, const QPointF &coords ); |
|
78 |
|
79 void addDetailItem(); |
|
80 void handleAddDetailItem(HbAction *aAction); |
|
81 void deleteContact(); |
|
82 void handleDeleteContact(int action); |
|
83 void discardChanges(); |
|
84 bool saveChanges(); |
|
85 void showRootView(); |
|
86 |
|
87 void openNameEditor(); |
|
88 void openImageEditor(); |
|
89 void thumbnailReady( const QPixmap& pixmap, void *data, int id, int error ); |
|
90 void setOrientation(Qt::Orientation aOrientation); |
|
91 void handleMenuAction( HbAction* aAction ); |
|
92 void setScrollPosition(); |
|
93 void ringToneFetchHandleError(int errorCode, const QString& errorMessage); |
|
94 void ringToneFetchHandleOk(const QVariant &result); |
|
95 void contactDeletedFromOtherSource(const QList<QContactLocalId>& contactIds); |
|
96 |
|
97 private: |
|
98 void loadAvatar(); |
|
99 HbMenu* createPopup( const QModelIndex aIndex, CntEditViewItem* aDetail ); |
|
100 void addDetail( CntEditViewItem* aDetail ); |
|
101 void editDetail( CntEditViewItem* aDetail ); |
|
102 void removeDetail( CntEditViewItem* aDetail, const QModelIndex& aIndex ); |
|
103 void setSelectedContact( QContact aContact ); |
|
104 void fetchTone(); |
|
105 void changeEditorView(); |
|
106 |
|
107 public: |
|
108 HbView* mView; |
|
109 HbListView* mListView; |
|
110 CntEditViewListModel* mModel; |
|
111 CntEditViewHeadingItem* mHeading; |
|
112 CntImageLabel *mImageLabel; |
|
113 CntViewParameters mArgs; |
|
114 HbDocumentLoader* mDocument; |
|
115 CntThumbnailManager* mThumbnailManager; |
|
116 QContact* mContact; // own |
|
117 CntAbstractViewManager* mMgr; // not owned |
|
118 CntAbstractEngine* mEngine; // now owned |
|
119 bool mIsMyCard; |
|
120 |
|
121 HbAction* mSoftkey; |
|
122 HbAction* mDiscard; |
|
123 HbAction* mDelete; |
|
124 HbAction* mSave; |
|
125 QModelIndex mIndex; |
|
126 |
|
127 private: |
|
128 Q_DECLARE_PUBLIC(CntEditView) |
|
129 friend class TestCntEditView; |
|
130 |
|
131 private: |
|
132 XQAiwRequest* mReq; |
|
133 XQApplicationManager mAppMgr; |
|
134 HbMenu *mMenu; |
|
135 CntSaveManager* mSaveManager; // own |
|
136 |
|
137 }; |
|
138 #endif /* CNTEDITVIEW_P_H_ */ |