|
1 /* |
|
2 * Copyright (c) 2009-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: Implementation of MyCard plugin |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CCAPPMYCARDPLUGIN_H |
|
19 #define CCAPPMYCARDPLUGIN_H |
|
20 |
|
21 #include <ccappviewpluginbase.h> |
|
22 #include <mccappviewpluginbase2.h> |
|
23 #include <coeutils.h> |
|
24 #include <eikmobs.h> |
|
25 |
|
26 // Forward declaration |
|
27 class CCCAppMyCard; |
|
28 class CAiwServiceHandler; |
|
29 class CCCAppMyCardContainer; |
|
30 class CPbk2CommandHandler; |
|
31 |
|
32 |
|
33 /** |
|
34 * Class implementing CCCAppViewPluginBase interface. This is |
|
35 * the main class and controlling the other classes of the plugin. |
|
36 * |
|
37 * |
|
38 * @lib ccappmycardplugin.dll |
|
39 * @since S60 9.2 |
|
40 */ |
|
41 NONSHARABLE_CLASS( CCCAppMyCardPlugin ) : |
|
42 public CCCAppViewPluginBase, |
|
43 public MCCAppViewPluginBase2 |
|
44 { |
|
45 // for testing |
|
46 friend class CUT_CCAppMyCardPlugin; |
|
47 |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 */ |
|
53 static CCCAppMyCardPlugin* NewL(); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 ~CCCAppMyCardPlugin(); |
|
59 |
|
60 public: // New methods |
|
61 |
|
62 /** |
|
63 * Get access to MyCard instance |
|
64 * |
|
65 * @return MyCard |
|
66 */ |
|
67 CCCAppMyCard& MyCard(); |
|
68 |
|
69 /* |
|
70 * Edit my card fields |
|
71 * |
|
72 * @param aFocusedFieldIndex field to be focused in editor |
|
73 */ |
|
74 void EditL( TInt aFocusedFieldIndex ); |
|
75 |
|
76 public: |
|
77 |
|
78 // from base class CCCAppViewPluginBase |
|
79 |
|
80 /** |
|
81 * From CCCAppViewPluginBase |
|
82 */ |
|
83 void PreparePluginViewL( |
|
84 MCCAppPluginParameter& aPluginParameter ); |
|
85 |
|
86 /** |
|
87 * From CCCAppViewPluginBase |
|
88 */ |
|
89 void ProvideBitmapL( |
|
90 TCCAppIconType aIconType, |
|
91 CAknIcon& aIcon ); |
|
92 |
|
93 /** |
|
94 * From CCCAppViewPluginBase |
|
95 */ |
|
96 TAny* CCCAppViewPluginBaseExtension( TUid aExtensionUid ); |
|
97 |
|
98 // from base class CAknView |
|
99 |
|
100 /** |
|
101 * From CAknView |
|
102 */ |
|
103 void DynInitMenuPaneL( |
|
104 TInt aResourceId, |
|
105 CEikMenuPane* aMenuPane ); |
|
106 |
|
107 /** |
|
108 * From CAknView |
|
109 */ |
|
110 void HandleCommandL( |
|
111 TInt aCommand ); |
|
112 |
|
113 /** |
|
114 * From CAknView |
|
115 */ |
|
116 void DoActivateL( |
|
117 const TVwsViewId& aPrevViewId, |
|
118 TUid aCustomMessageId, |
|
119 const TDesC8& aCustomMessage ); |
|
120 |
|
121 /** |
|
122 * From CAknView |
|
123 */ |
|
124 void DoDeactivate(); |
|
125 |
|
126 /** |
|
127 * From CAknView |
|
128 */ |
|
129 TUid Id() const; |
|
130 |
|
131 // from base class CCCAppViewPluginAknView |
|
132 |
|
133 /** |
|
134 * From CCCAppViewPluginAknView |
|
135 */ |
|
136 void PrepareViewResourcesL(); |
|
137 |
|
138 /** |
|
139 * From CCCAppViewPluginAknView |
|
140 */ |
|
141 void NewContainerL(); |
|
142 |
|
143 |
|
144 public: //From MCCAppViewPluginBase2 |
|
145 |
|
146 /** |
|
147 * From MCCAppViewPluginBase2 |
|
148 */ |
|
149 TBool PluginBusy(); |
|
150 |
|
151 public: // MEikMenuObserver |
|
152 void ProcessCommandL(TInt aCommandId); |
|
153 |
|
154 private: |
|
155 |
|
156 /* |
|
157 * Send business card created from my card |
|
158 */ |
|
159 void SendBusinessCardL(); |
|
160 |
|
161 /* |
|
162 * Removes the MyCard image |
|
163 */ |
|
164 void RemoveImageCmdL(); |
|
165 |
|
166 /* |
|
167 * Add image to MyCard |
|
168 */ |
|
169 void AddImageCmdL(); |
|
170 |
|
171 /* |
|
172 * Change MyCard image |
|
173 */ |
|
174 void ChangeImageCmdL(); |
|
175 |
|
176 /* |
|
177 * View MyCard image |
|
178 */ |
|
179 void ViewImageCmdL(); |
|
180 |
|
181 /* |
|
182 * Creates command handler if not created, and returns pointer to it. |
|
183 */ |
|
184 CPbk2CommandHandler* CommandHandlerL(); |
|
185 |
|
186 |
|
187 private: // constructors |
|
188 |
|
189 /** |
|
190 * Constructor |
|
191 */ |
|
192 CCCAppMyCardPlugin(); |
|
193 |
|
194 /** |
|
195 * Constructor |
|
196 */ |
|
197 void ConstructL(); |
|
198 |
|
199 private: // data |
|
200 |
|
201 /// Own. Contact card manager |
|
202 CCCAppMyCard* iMyCard; |
|
203 |
|
204 /// Own. Phonebook 2 UIControls dll resource file |
|
205 RCoeResourceLoader iPbk2UiControlResource; |
|
206 |
|
207 /// Own: Phonebook 2 common UI dll resource file |
|
208 RCoeResourceLoader iCommonUiResourceFile; |
|
209 |
|
210 /// Own: Phonebook 2 commands dll resource file |
|
211 RCoeResourceLoader iCommandsResourceFile; |
|
212 |
|
213 /// Not own. Reference to own container. Owned in base class. |
|
214 CCCAppMyCardContainer* iOwnContainer; |
|
215 |
|
216 // Own. Command handler |
|
217 CPbk2CommandHandler* iCommandHandler; |
|
218 }; |
|
219 |
|
220 #endif // CCAPPMYCARDPLUGIN_H |
|
221 |
|
222 // End of File |