|
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: Command for opening MyCard. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2OPENMYCARDCMD_H |
|
20 #define CPBK2OPENMYCARDCMD_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <MPbk2Command.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MPbk2ContactUiControl; |
|
28 class CPbk2FieldPropertyArray; |
|
29 class CPbk2StoreSpecificFieldPropertyArray; |
|
30 class CPbk2PresentationContact; |
|
31 class CPbk2MyCard; |
|
32 class MVPbkContactLink; |
|
33 |
|
34 //Cca |
|
35 class MCCAParameter; |
|
36 class MCCAConnection; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * |
|
42 */ |
|
43 class CPbk2OpenMyCardCmd : public CActive, |
|
44 public MPbk2Command |
|
45 { |
|
46 public: // Construction and destruction |
|
47 |
|
48 /** |
|
49 * Creates a new instance of this class. |
|
50 * |
|
51 * @param a reference to a pointer to CCA client connection object |
|
52 * @param Pbk2 Contact Ui control |
|
53 * @return A new instance of this class. |
|
54 */ |
|
55 static CPbk2OpenMyCardCmd* NewL( |
|
56 MCCAConnection*& aCCAConnection, |
|
57 CPbk2MyCard* aMyCard, |
|
58 MPbk2ContactUiControl* aUiControl = NULL ); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 ~CPbk2OpenMyCardCmd(); |
|
64 |
|
65 public: // Interface |
|
66 void SetViewUid( TUid aViewUid ); |
|
67 |
|
68 public: //From MPbk2Command |
|
69 void ExecuteLD(); |
|
70 void ResetUiControl( MPbk2ContactUiControl& aUiControl ); |
|
71 void AddObserver( MPbk2CommandObserver& aObserver ); |
|
72 |
|
73 private: //Construction |
|
74 CPbk2OpenMyCardCmd( |
|
75 MPbk2ContactUiControl* aUiControl, |
|
76 CPbk2MyCard* aMyCard, |
|
77 MCCAConnection*& aCCAConnection ); |
|
78 void ConstructL(); |
|
79 |
|
80 private: // Implementation |
|
81 |
|
82 /** |
|
83 * Set contact launch data (launch mycard from link) |
|
84 */ |
|
85 void SetContactDataL( MCCAParameter& aParam, MVPbkContactLink* aLink ); |
|
86 |
|
87 /** |
|
88 * Set contact launch data (launch mycard from data model) |
|
89 * If aContact is not provided then empty model will be delivered. |
|
90 * Empty model means that mycard does not exist and needs to be created. |
|
91 */ |
|
92 void SetContactDataL( MCCAParameter& aParam, CPbk2PresentationContact* aContact = NULL ); |
|
93 |
|
94 void LaunchCcaL(); // Sync |
|
95 void IssueRequest(); |
|
96 |
|
97 /** |
|
98 * Create presentation contact from mycard. |
|
99 */ |
|
100 CPbk2PresentationContact* PresentationContactL(); |
|
101 |
|
102 private: // From CActive |
|
103 void RunL(); |
|
104 void DoCancel(); |
|
105 TInt RunError(TInt aError); |
|
106 |
|
107 private: // Data structures |
|
108 /// Process states |
|
109 enum TProcessState |
|
110 { |
|
111 ELaunching, |
|
112 ERunning |
|
113 }; |
|
114 |
|
115 private: // Data |
|
116 |
|
117 //Ref, not owned |
|
118 MPbk2CommandObserver* iCommandObserver; |
|
119 //Ref, not owned |
|
120 MPbk2ContactUiControl *iUiControl; |
|
121 /// Ref to ptr: for CCA, not owned |
|
122 MCCAConnection*& iConnectionRef; |
|
123 // Own: The internal state of the command |
|
124 TProcessState iState; |
|
125 /// Requested view uid for CCA |
|
126 TUid iViewUid; |
|
127 /// Not own. My card instance |
|
128 CPbk2MyCard* iMyCard; |
|
129 /// Own. Field properties for presentation contact |
|
130 CPbk2FieldPropertyArray* iFieldProperties; |
|
131 /// Own. Field properties for presentation contact |
|
132 CPbk2StoreSpecificFieldPropertyArray* iSpecificFieldProperties; |
|
133 /// Own. Presentation contact of mycard |
|
134 CPbk2PresentationContact* iPresentationContact; |
|
135 }; |
|
136 |
|
137 #endif // CPBK2OPENMYCARDCMD_H |
|
138 |
|
139 // End of File |