63
|
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 |
class CSpbContactDataModel;
|
|
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 |
* MyCard's contact data model
|
|
71 |
*/
|
|
72 |
CSpbContactDataModel& Model();
|
|
73 |
|
|
74 |
/*
|
|
75 |
* Edit my card fields
|
|
76 |
*
|
|
77 |
* @param aFocusedFieldIndex field to be focused in editor
|
|
78 |
*/
|
|
79 |
void EditL( TInt aFocusedFieldIndex );
|
|
80 |
|
|
81 |
/*
|
|
82 |
* Handle error code
|
|
83 |
* @aError System wide error code
|
|
84 |
*/
|
|
85 |
void HandleError( TInt aError );
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Enables or disables Left Soft Key
|
|
89 |
*
|
|
90 |
* @param aEnable enable/disable LSK
|
|
91 |
*/
|
|
92 |
void EnableOptionsMenu( TBool aEnable );
|
|
93 |
|
|
94 |
public:
|
|
95 |
|
|
96 |
// from base class CCCAppViewPluginBase
|
|
97 |
|
|
98 |
/**
|
|
99 |
* From CCCAppViewPluginBase
|
|
100 |
*/
|
|
101 |
void PreparePluginViewL(
|
|
102 |
MCCAppPluginParameter& aPluginParameter );
|
|
103 |
|
|
104 |
/**
|
|
105 |
* From CCCAppViewPluginBase
|
|
106 |
*/
|
|
107 |
void ProvideBitmapL(
|
|
108 |
TCCAppIconType aIconType,
|
|
109 |
CAknIcon& aIcon );
|
|
110 |
|
|
111 |
/**
|
|
112 |
* From CCCAppViewPluginBase
|
|
113 |
*/
|
|
114 |
TAny* CCCAppViewPluginBaseExtension( TUid aExtensionUid );
|
|
115 |
|
|
116 |
// from base class CAknView
|
|
117 |
|
|
118 |
/**
|
|
119 |
* From CAknView
|
|
120 |
*/
|
|
121 |
void HandleCommandL(
|
|
122 |
TInt aCommand );
|
|
123 |
|
|
124 |
/**
|
|
125 |
* From CAknView
|
|
126 |
*/
|
|
127 |
void DoActivateL(
|
|
128 |
const TVwsViewId& aPrevViewId,
|
|
129 |
TUid aCustomMessageId,
|
|
130 |
const TDesC8& aCustomMessage );
|
|
131 |
|
|
132 |
/**
|
|
133 |
* From CAknView
|
|
134 |
*/
|
|
135 |
void DoDeactivate();
|
|
136 |
|
|
137 |
/**
|
|
138 |
* From CAknView
|
|
139 |
*/
|
|
140 |
TUid Id() const;
|
|
141 |
|
|
142 |
// from base class CCCAppViewPluginAknView
|
|
143 |
|
|
144 |
/**
|
|
145 |
* From CCCAppViewPluginAknView
|
|
146 |
*/
|
|
147 |
void PrepareViewResourcesL();
|
|
148 |
|
|
149 |
/**
|
|
150 |
* From CCCAppViewPluginAknView
|
|
151 |
*/
|
|
152 |
void NewContainerL();
|
|
153 |
|
|
154 |
|
|
155 |
public: //From MCCAppViewPluginBase2
|
|
156 |
|
|
157 |
/**
|
|
158 |
* From MCCAppViewPluginBase2
|
|
159 |
*/
|
|
160 |
TBool PluginBusy();
|
|
161 |
|
|
162 |
public: // MEikMenuObserver
|
|
163 |
void ProcessCommandL(TInt aCommandId);
|
|
164 |
|
|
165 |
private:
|
|
166 |
|
|
167 |
/*
|
|
168 |
* Send business card created from my card
|
|
169 |
*/
|
|
170 |
void SendBusinessCardL();
|
|
171 |
|
|
172 |
/*
|
|
173 |
* Removes the MyCard image
|
|
174 |
*/
|
|
175 |
void RemoveImageCmdL();
|
|
176 |
|
|
177 |
/*
|
|
178 |
* Add image to MyCard
|
|
179 |
*/
|
|
180 |
void AddImageCmdL();
|
|
181 |
|
|
182 |
/*
|
|
183 |
* Change MyCard image
|
|
184 |
*/
|
|
185 |
void ChangeImageCmdL();
|
|
186 |
|
|
187 |
/*
|
|
188 |
* View MyCard image
|
|
189 |
*/
|
|
190 |
void ViewImageCmdL();
|
|
191 |
|
|
192 |
/*
|
|
193 |
* Copy detail to clipboard
|
|
194 |
*/
|
|
195 |
void CopyDetailL();
|
|
196 |
|
|
197 |
/*
|
|
198 |
* Creates command handler if not created, and returns pointer to it.
|
|
199 |
*/
|
|
200 |
CPbk2CommandHandler* CommandHandlerL();
|
|
201 |
|
|
202 |
private: // constructors
|
|
203 |
|
|
204 |
/**
|
|
205 |
* Constructor
|
|
206 |
*/
|
|
207 |
CCCAppMyCardPlugin();
|
|
208 |
|
|
209 |
/**
|
|
210 |
* Constructor
|
|
211 |
*/
|
|
212 |
void ConstructL();
|
|
213 |
|
|
214 |
private: // data
|
|
215 |
|
|
216 |
/// Own. Contact card manager
|
|
217 |
CCCAppMyCard* iMyCard;
|
|
218 |
|
|
219 |
/// Own. Phonebook 2 UIControls dll resource file
|
|
220 |
RCoeResourceLoader iPbk2UiControlResource;
|
|
221 |
|
|
222 |
/// Own: Phonebook 2 common UI dll resource file
|
|
223 |
RCoeResourceLoader iCommonUiResourceFile;
|
|
224 |
|
|
225 |
/// Own: Phonebook 2 commands dll resource file
|
|
226 |
RCoeResourceLoader iCommandsResourceFile;
|
|
227 |
|
|
228 |
/// Not own. Reference to own container. Owned in base class.
|
|
229 |
CCCAppMyCardContainer* iOwnContainer;
|
|
230 |
|
|
231 |
// Own. Command handler
|
|
232 |
CPbk2CommandHandler* iCommandHandler;
|
|
233 |
|
|
234 |
// Own. MyCard contact model
|
|
235 |
CSpbContactDataModel* iModel;
|
|
236 |
};
|
|
237 |
|
|
238 |
#endif // CCAPPMYCARDPLUGIN_H
|
|
239 |
|
|
240 |
// End of File
|