|
1 /* |
|
2 * Copyright (c) 2007-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: Takes a command and executes it if predefined |
|
15 * condition is met |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CPBK2COMMANDACTIVATOR_H |
|
21 #define CPBK2COMMANDACTIVATOR_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <MPbk2Command.h> |
|
26 #include <MPbk2CommandObserver.h> |
|
27 #include <MPbk2StoreStateCheckerObserver.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class MPbk2ContactUiControl; |
|
31 class CPbk2StoreStateChecker; |
|
32 |
|
33 // CLASS DECLARATIONS |
|
34 /** |
|
35 * Phonebook 2 executes given command if predefined condition is met |
|
36 */ |
|
37 class CPbk2CommandActivator : |
|
38 public CBase, |
|
39 public MPbk2Command, |
|
40 private MPbk2CommandObserver, |
|
41 private MPbk2StoreStateCheckerObserver |
|
42 { |
|
43 public: // Constructor and destructor |
|
44 IMPORT_C static CPbk2CommandActivator* NewL( MPbk2Command* aCommand, |
|
45 const MPbk2ContactUiControl& aUiControl ); |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 IMPORT_C ~CPbk2CommandActivator(); |
|
50 |
|
51 public: // From MPbk2Command |
|
52 void ExecuteLD(); |
|
53 void ResetUiControl(MPbk2ContactUiControl& aUiControl); |
|
54 void AddObserver( MPbk2CommandObserver& aObserver ); |
|
55 TAny* CommandExtension(TUid /*aExtensionUid*/); |
|
56 private: // MPbk2CommandObserver |
|
57 void CommandFinished( const MPbk2Command& aCommand ); |
|
58 |
|
59 private: // MPbk2StoreStateCheckerObserver |
|
60 void StoreState( |
|
61 MPbk2StoreStateCheckerObserver::TState aState ); |
|
62 |
|
63 private: // Implementation |
|
64 CPbk2CommandActivator( MPbk2Command* aCommand, |
|
65 const MPbk2ContactUiControl& aUiControl ); |
|
66 |
|
67 private: // Data |
|
68 /// Own: Commant to be executed |
|
69 MPbk2Command* iCommand; |
|
70 /// Not Owned: UiControl which has information about the environment |
|
71 /// where that command was launched. |
|
72 const MPbk2ContactUiControl& iUiControl; |
|
73 /// Not Own: Command Observer |
|
74 MPbk2CommandObserver* iObserver; |
|
75 /// Own: Store state checker |
|
76 CPbk2StoreStateChecker* iStoreStateChecker; |
|
77 }; |
|
78 |
|
79 #endif // CPBK2COMMANDACTIVATOR_H |
|
80 |
|
81 // End of File |