author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 20:54:53 +0300 | |
branch | RCL_3 |
changeset 21 | 9da50d567e3c |
parent 20 | f4a778e096c2 |
permissions | -rw-r--r-- |
20 | 1 |
/* |
2 |
* Copyright (c) 2008 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: Phonebook2 command execution handler |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef C_CCCAPPCOMMLAUNCHERPBKCMD_H |
|
20 |
#define C_CCCAPPCOMMLAUNCHERPBKCMD_H |
|
21 |
||
22 |
#include <e32base.h> |
|
23 |
||
24 |
#include <RPbk2LocalizedResourceFile.h> |
|
25 |
#include <MVPbkSingleContactOperationObserver.h> |
|
26 |
#include <MVPbkContactStoreObserver.h> |
|
27 |
#include <MPbk2ContactUiControl.h> |
|
28 |
#include <MPbk2ContactUiControl2.h> |
|
29 |
#include <MPbk2MenuCommandObserver.h> |
|
30 |
#include <Pbk2Commands.hrh> |
|
31 |
||
32 |
class CPbk2CommandHandler; |
|
33 |
class CPbk2ApplicationServices; |
|
34 |
class MVPbkContactOperationBase; |
|
35 |
class MVPbkContactLinkArray; |
|
36 |
class MVPbkBaseContactField; |
|
37 |
class MVPbkContactLink; |
|
38 |
class MPbk2Command; |
|
39 |
class CCCAppCommLauncherPlugin; |
|
40 |
||
41 |
/** |
|
42 |
* Class to use Phonebook2 command implementations from out an external application. |
|
43 |
* ?more_complete_description |
|
44 |
* |
|
45 |
* @code |
|
46 |
* ?good_class_usage_example(s) |
|
47 |
* @endcode |
|
48 |
* |
|
49 |
* @lib ccappcommlauncherplugin.dll |
|
50 |
* @since S60 v3.2 |
|
51 |
*/ |
|
52 |
class CCCAppCommLauncherPbkCmd : |
|
53 |
public CBase, |
|
54 |
public MVPbkContactStoreObserver, |
|
55 |
public MVPbkSingleContactOperationObserver, |
|
56 |
public MPbk2ContactUiControl, |
|
57 |
public MPbk2ContactUiControl2, |
|
58 |
private MPbk2MenuCommandObserver |
|
59 |
{ |
|
60 |
public: |
|
61 |
||
62 |
static CCCAppCommLauncherPbkCmd* NewL( CCCAppCommLauncherPlugin& aPlugin ); |
|
63 |
static CCCAppCommLauncherPbkCmd* NewLC( CCCAppCommLauncherPlugin& aPlugin ); |
|
64 |
||
65 |
/** |
|
66 |
* Destructor. |
|
67 |
*/ |
|
68 |
virtual ~CCCAppCommLauncherPbkCmd(); |
|
69 |
||
70 |
public: // new |
|
71 |
void ExecutePbk2CmdAssignDefaultL( const TDesC8& aContact ); |
|
72 |
void ExecutePbk2CmdShowMapL( const HBufC8* aContact, TPbk2CommandId aCommandId ); |
|
73 |
void ExecutePbk2CmdViewImageL( const TDesC8& aContact ); |
|
74 |
void ExecutePbk2CmdChangeImageL( const TDesC8& aContact ); |
|
75 |
void ExecutePbk2CmdRemoveImageL( const TDesC8& aContact ); |
|
76 |
void ExecutePbk2CmdAddImageL( const TDesC8& aContact ); |
|
77 |
void ExecutePbk2CmdDeleteL( const TDesC8& aContact ); |
|
78 |
TBool IsPbk2CommandRunning(); |
|
21
9da50d567e3c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
20
diff
changeset
|
79 |
//Close all the pending pbk2commands launched from CCA |
9da50d567e3c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
20
diff
changeset
|
80 |
void DeleteAllRunningCmd(); |
20 | 81 |
|
82 |
public: // from MVPbkContactStoreObserver |
|
83 |
||
84 |
void StoreReady( |
|
85 |
MVPbkContactStore& aContactStore); |
|
86 |
||
87 |
void StoreUnavailable( |
|
88 |
MVPbkContactStore& aContactStore, |
|
89 |
TInt aReason); |
|
90 |
||
91 |
void HandleStoreEventL( |
|
92 |
MVPbkContactStore& aContactStore, |
|
93 |
TVPbkContactStoreEvent aStoreEvent ); |
|
94 |
||
95 |
public: // from MVPbkSingleContactOperationObserver |
|
96 |
||
97 |
void VPbkSingleContactOperationComplete( |
|
98 |
MVPbkContactOperationBase& aOperation, |
|
99 |
MVPbkStoreContact* aContact ); |
|
100 |
||
101 |
void VPbkSingleContactOperationFailed( |
|
102 |
MVPbkContactOperationBase& aOperation, |
|
103 |
TInt aError ); |
|
104 |
||
105 |
public: // From MPbk2ContactUiControl |
|
106 |
||
107 |
MPbk2ContactUiControl* ParentControl() const; |
|
108 |
TInt NumberOfContacts() const; |
|
109 |
const MVPbkBaseContact* FocusedContactL() const; |
|
110 |
const MVPbkViewContact* FocusedViewContactL() const; |
|
111 |
const MVPbkStoreContact* FocusedStoreContact() const; |
|
112 |
void SetFocusedContactL( |
|
113 |
const MVPbkBaseContact& aContact ); |
|
114 |
void SetFocusedContactL( |
|
115 |
const MVPbkContactBookmark& aContactBookmark ); |
|
116 |
void SetFocusedContactL( |
|
117 |
const MVPbkContactLink& aContactLink ); |
|
118 |
TInt FocusedContactIndex() const; |
|
119 |
void SetFocusedContactIndexL( |
|
120 |
TInt aIndex ); |
|
121 |
TInt NumberOfContactFields() const; |
|
122 |
const MVPbkBaseContactField* FocusedField() const; |
|
123 |
TInt FocusedFieldIndex() const; |
|
124 |
void SetFocusedFieldIndex( |
|
125 |
TInt aIndex ); |
|
126 |
TBool ContactsMarked() const; |
|
127 |
MVPbkContactLinkArray* SelectedContactsL() const; |
|
128 |
MVPbkContactLinkArray* SelectedContactsOrFocusedContactL() const; |
|
129 |
MPbk2ContactLinkIterator* SelectedContactsIteratorL() const; |
|
130 |
CArrayPtr<MVPbkContactStore>* SelectedContactStoresL() const; |
|
131 |
void ClearMarks(); |
|
132 |
void SetSelectedContactL( |
|
133 |
TInt aIndex, |
|
134 |
TBool aSelected ); |
|
135 |
void SetSelectedContactL( |
|
136 |
const MVPbkContactBookmark& aContactBookmark, |
|
137 |
TBool aSelected ); |
|
138 |
void SetSelectedContactL( |
|
139 |
const MVPbkContactLink& aContactLink, |
|
140 |
TBool aSelected ); |
|
141 |
||
142 |
void DynInitMenuPaneL( |
|
143 |
TInt aResourceId, |
|
144 |
CEikMenuPane* aMenuPane ) const; |
|
145 |
void ProcessCommandL( |
|
146 |
TInt aCommandId ) const; |
|
147 |
void UpdateAfterCommandExecution(); |
|
148 |
TInt GetMenuFilteringFlagsL() const; |
|
149 |
CPbk2ViewState* ControlStateL() const; |
|
150 |
void RestoreControlStateL( |
|
151 |
CPbk2ViewState* aState ); |
|
152 |
const TDesC& FindTextL(); |
|
153 |
void ResetFindL(); |
|
154 |
void ShowThumbnail(); |
|
155 |
void HideThumbnail(); |
|
156 |
void SetBlank( |
|
157 |
TBool aBlank ); |
|
158 |
void RegisterCommand( |
|
159 |
MPbk2Command* aCommand ); |
|
160 |
void SetTextL( |
|
161 |
const TDesC& aText ); |
|
162 |
TAny* ContactUiControlExtension(TUid aExtensionUid ); |
|
163 |
||
164 |
public: // From MPbk2ContactUiControl2 |
|
165 |
TInt CommandItemCount() const; |
|
166 |
const MPbk2UiControlCmdItem& CommandItemAt( TInt aIndex ) const; |
|
167 |
const MPbk2UiControlCmdItem* FocusedCommandItem() const; |
|
168 |
void DeleteCommandItemL( TInt aIndex ); |
|
169 |
void AddCommandItemL(MPbk2UiControlCmdItem* /*aCommand*/, TInt /*aIndex*/); |
|
170 |
||
171 |
private: // From MPbk2MenuCommandObserver |
|
172 |
void PreCommandExecutionL( const MPbk2Command& /*aCommand*/ ) {} |
|
173 |
void PostCommandExecutionL( const MPbk2Command& aCommand ); |
|
174 |
||
175 |
private: |
|
176 |
||
177 |
void ConstructL(); |
|
178 |
CCCAppCommLauncherPbkCmd( CCCAppCommLauncherPlugin& aPlugin ); |
|
179 |
||
180 |
private: |
|
181 |
||
182 |
void PreparePbk2ApplicationServicesL(); |
|
183 |
void HandleError( TInt aError ); |
|
184 |
||
185 |
public: |
|
186 |
/* |
|
187 |
* API reponsible for returning reference to |
|
188 |
* Phonebook 2 application services. |
|
189 |
* CPbk2ApplicationServices is Responsible for owning and delivering commonly |
|
190 |
* used shared objects and providing some common application level services. |
|
191 |
* @return - Pointer to Application services |
|
192 |
*/ |
|
193 |
CPbk2ApplicationServices& ApplicationServices() const; |
|
194 |
private: |
|
195 |
/** |
|
196 |
* Pointer to Pbk2 command handler. |
|
197 |
* Own. |
|
198 |
*/ |
|
199 |
CPbk2CommandHandler* iCommandHandler; |
|
200 |
||
201 |
/** |
|
202 |
* Pointer to Application services. |
|
203 |
* Own. |
|
204 |
*/ |
|
205 |
CPbk2ApplicationServices* iAppServices; |
|
206 |
||
207 |
/// Own: Phonebook 2 commands dll resource file |
|
208 |
RPbk2LocalizedResourceFile iCommandsResourceFile; |
|
209 |
||
210 |
/// Own: Phonebook 2 UI controls dll resource file |
|
211 |
RPbk2LocalizedResourceFile iUiControlsResourceFile; |
|
212 |
||
213 |
/// Own: Phonebook 2 common UI dll resource file |
|
214 |
RPbk2LocalizedResourceFile iCommonUiResourceFile; |
|
215 |
||
216 |
/// Own: MVPbkStoreContact |
|
217 |
MVPbkStoreContact* iStoreContact; |
|
218 |
||
219 |
/// Own: MVPbkContactOperationBase |
|
220 |
MVPbkContactOperationBase* iOperation; |
|
221 |
||
222 |
/// Own: MVPbkContactLinkArray |
|
223 |
MVPbkContactLinkArray* iLinks; |
|
224 |
||
225 |
/// Ref: command in execution |
|
226 |
MPbk2Command* iCommand; |
|
227 |
||
228 |
/// Own: TPbk2CommandId |
|
229 |
TPbk2CommandId iPbk2CommandId; |
|
230 |
||
231 |
CCCAppCommLauncherPlugin& iPlugin; |
|
232 |
||
233 |
/// Own: contact store in use, has to be closed when done |
|
234 |
MVPbkContactStore* iContactStore; |
|
235 |
}; |
|
236 |
||
237 |
#endif // C_CCCAPPCOMMLAUNCHERPBKCMD_H |