|
1 /* |
|
2 * Copyright (c) 2005-2007 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: Phonebook 2 send contact command. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2SENDCONTACTCMD_H |
|
20 #define CPBK2SENDCONTACTCMD_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <MPbk2Command.h> |
|
25 #include <MVPbkSingleContactOperationObserver.h> |
|
26 #include "MPbk2vCardConverterObserver.h" |
|
27 #include <MPbk2ProcessDecorator.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CIdle; |
|
31 class MVPbkStoreContactField; |
|
32 class CPbk2vCardConverter; |
|
33 class CEikonEnv; |
|
34 class MVPbkBaseContactField; |
|
35 class MVPbkContactLinkArray; |
|
36 class MPbk2CommandObserver; |
|
37 class CVPbkVCardEng; |
|
38 class MVPbkStoreContact; |
|
39 class CPbk2vCardConverter; |
|
40 class CAknWaitDialog; |
|
41 class MVPbkFieldType; |
|
42 class MPbk2ContactUiControl; |
|
43 class MVPbkContactOperationBase; |
|
44 class MVPbkFieldTypeList; |
|
45 class TPbk2SendingParams; |
|
46 class MVPbkContactLink; |
|
47 class CMessageData; |
|
48 class MPbk2ProcessDecorator; |
|
49 class MPbk2ContactLinkIterator; |
|
50 class CPbk2ApplicationServices; |
|
51 class CSendUi; |
|
52 |
|
53 // CLASS DECLARATION |
|
54 |
|
55 /** |
|
56 * Phonebook 2 send contact command. |
|
57 */ |
|
58 NONSHARABLE_CLASS(CPbk2SendContactCmd) : |
|
59 public CActive, |
|
60 public MPbk2Command, |
|
61 public MPbk2vCardConverterObserver, |
|
62 public MVPbkSingleContactOperationObserver, |
|
63 private MPbk2ProcessDecoratorObserver |
|
64 { |
|
65 public: // Construction and destruction |
|
66 /** |
|
67 * Creates a new instance of this class. |
|
68 * |
|
69 * @return A new instance of this class. |
|
70 */ |
|
71 static CPbk2SendContactCmd* NewL( |
|
72 MPbk2ContactUiControl& aUiControl ); |
|
73 |
|
74 /** |
|
75 * Destructor. |
|
76 */ |
|
77 virtual ~CPbk2SendContactCmd(); |
|
78 |
|
79 public: // From MPbk2Command |
|
80 void ExecuteLD(); |
|
81 void AddObserver( |
|
82 MPbk2CommandObserver& aObserver ); |
|
83 void ResetUiControl(MPbk2ContactUiControl& aUiControl); |
|
84 |
|
85 private: // From CActive |
|
86 void RunL(); |
|
87 TInt RunError( |
|
88 TInt aError ); |
|
89 void DoCancel(); |
|
90 |
|
91 private: // From MPbk2vCardConverterObserver |
|
92 void ConversionDone( |
|
93 TInt aCount ); |
|
94 void ConversionError( |
|
95 TInt aError ); |
|
96 |
|
97 private: // From MVPbkSingleContactOperationObserver |
|
98 void VPbkSingleContactOperationComplete( |
|
99 MVPbkContactOperationBase& aOperation, |
|
100 MVPbkStoreContact* aContact ); |
|
101 void VPbkSingleContactOperationFailed( |
|
102 MVPbkContactOperationBase& aOperation, |
|
103 TInt aError ); |
|
104 |
|
105 public: // From MPbk2ProcessDecoratorObserver |
|
106 void ProcessDismissed( |
|
107 TInt aCancelCode ); |
|
108 |
|
109 private: // Implementation |
|
110 CPbk2SendContactCmd( |
|
111 MPbk2ContactUiControl& aUiControl ); |
|
112 void ConstructL(); |
|
113 void SendvCardsLD(); |
|
114 static TInt SendvCardsLD( |
|
115 TAny* aThis ); |
|
116 TBool AnyThumbnailsL() const; |
|
117 TInt SelectionListL() const; |
|
118 void MapSelection( |
|
119 TInt& aSelection, |
|
120 TInt aShownMenu ); |
|
121 void ProcessDone( |
|
122 TInt aCancelCode ); |
|
123 TInt SelectSentDataL(); |
|
124 TUid ShowSendQueryL(); |
|
125 TPbk2SendingParams CreateParamsLC(); |
|
126 void ConvertContactL( |
|
127 TInt aSelectionIndex ); |
|
128 void RetrieveContactL( |
|
129 const MVPbkContactLink& aLink ); |
|
130 TInt FilterErrors( |
|
131 TInt aErrorCode); |
|
132 void IssueRequest(); |
|
133 void IssueStopRequest(); |
|
134 void SendMsgUsingSendUI( |
|
135 CMessageData* aMsgData ); |
|
136 TBool IsMoreThanOneContact(); |
|
137 |
|
138 private: // Data structures |
|
139 /// Process states |
|
140 enum TState |
|
141 { |
|
142 EShowingSendQuery = 0, |
|
143 ERetrievingContact, |
|
144 ESelectingSentData, |
|
145 EStopping, |
|
146 ECancelling |
|
147 }; |
|
148 |
|
149 private: // Data |
|
150 /// Ref: UI control |
|
151 MPbk2ContactUiControl* iUiControl; |
|
152 /// Ref: Command observer |
|
153 MPbk2CommandObserver* iCommandObserver; |
|
154 /// Own: Selected contacts |
|
155 MVPbkContactLinkArray* iSelectedContacts; |
|
156 /// Ref: Focused field |
|
157 const MVPbkBaseContactField* iFocusedField; |
|
158 /// Own: Send command's service uid |
|
159 TUid iMtmUid; |
|
160 /// Own: vCard engine |
|
161 CVPbkVCardEng* iVCardEngine; |
|
162 /// Own: vCard converter |
|
163 CPbk2vCardConverter* iConverter; |
|
164 /// Ref: Eikon enviroment |
|
165 CEikonEnv* iEikEnv; |
|
166 /// Own: vCard sender |
|
167 CIdle* iVCardSender; |
|
168 /// Own: Indicates whether this object is under destruction |
|
169 TBool iUnderDestruction; |
|
170 /// Own: Store contact array |
|
171 RPointerArray<MVPbkStoreContact> iStoreContacts; |
|
172 /// Own: Contact retrieve operation |
|
173 MVPbkContactOperationBase* iRetrieveOperation; |
|
174 /// Ref: Thumbnail field type |
|
175 const MVPbkFieldType* iThumbnailFieldType; |
|
176 /// Own: Decorator for the wait note process |
|
177 MPbk2ProcessDecorator* iDecorator; |
|
178 /// Own: Current index of the contact in an array |
|
179 TInt iCurrentContactLinkIndex; |
|
180 /// Own: State of the process |
|
181 TState iState; |
|
182 /// Own: contact iterator |
|
183 MPbk2ContactLinkIterator* iCntIterator; |
|
184 /// Own: Application Services pointer |
|
185 CPbk2ApplicationServices* iAppServices; |
|
186 /// Own: Send UI |
|
187 CSendUi* iSendUi; |
|
188 }; |
|
189 |
|
190 #endif // CPBK2SENDCONTACTCMD_H |
|
191 |
|
192 // End of File |