|
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: Phonebook 2 group rename command. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPGURENAMEGROUPCMD_H |
|
20 #define CPGURENAMEGROUPCMD_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "MPbk2Command.h" |
|
24 #include <e32base.h> |
|
25 #include <MVPbkContactObserver.h> |
|
26 #include <MVPbkSingleContactOperationObserver.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class MVPbkContactGroup; |
|
30 class MPbk2ContactUiControl; |
|
31 class MVPbkContactStore; |
|
32 class MVPbkContactLink; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Phonebook 2 group rename command. |
|
38 */ |
|
39 class CPguRenameGroupCmd : public CActive, |
|
40 public MPbk2Command, |
|
41 private MVPbkContactObserver, |
|
42 private MVPbkSingleContactOperationObserver |
|
43 { |
|
44 public: // Construction and destruction |
|
45 |
|
46 /** |
|
47 * Creates a new instance of this class. |
|
48 * |
|
49 * @param aUiControl UI control |
|
50 * @return A new instance of this class. |
|
51 */ |
|
52 static CPguRenameGroupCmd* NewL( |
|
53 MPbk2ContactUiControl& aUiControl ); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 ~CPguRenameGroupCmd(); |
|
59 |
|
60 public: // From MPbk2Command |
|
61 void ExecuteLD(); |
|
62 void AddObserver( |
|
63 MPbk2CommandObserver& aObserver ); |
|
64 void ResetUiControl( |
|
65 MPbk2ContactUiControl& aUiControl ); |
|
66 |
|
67 private: // From CActive |
|
68 void RunL(); |
|
69 void DoCancel(); |
|
70 TInt RunError( |
|
71 TInt aError ); |
|
72 |
|
73 private: // From MVPbkContactObserver |
|
74 void ContactOperationCompleted( |
|
75 TContactOpResult aResult ); |
|
76 void ContactOperationFailed( |
|
77 TContactOp aOpCode, |
|
78 TInt aErrorCode, |
|
79 TBool aErrorNotified ); |
|
80 |
|
81 private: // From MVPbkSingleContactOperationObserver |
|
82 void VPbkSingleContactOperationComplete( |
|
83 MVPbkContactOperationBase& aOperation, |
|
84 MVPbkStoreContact* aContact ); |
|
85 void VPbkSingleContactOperationFailed( |
|
86 MVPbkContactOperationBase& aOperation, |
|
87 TInt aError ); |
|
88 |
|
89 private: // Data structures |
|
90 |
|
91 /// Process states |
|
92 enum TProcessState |
|
93 { |
|
94 ELauchQuery, |
|
95 EFinishCommand |
|
96 }; |
|
97 |
|
98 private: // Implementation |
|
99 CPguRenameGroupCmd( |
|
100 MPbk2ContactUiControl& aUiControl ); |
|
101 void ConstructL(); |
|
102 void QueryGroupNameL(); |
|
103 void CleanupCommand(); |
|
104 void IssueRequest( |
|
105 TProcessState aState ); |
|
106 |
|
107 private: // Data |
|
108 /// Ref: Ui control |
|
109 MPbk2ContactUiControl* iUiControl; |
|
110 /// Ref: Target store |
|
111 MVPbkContactStore* iTargetStore; |
|
112 /// Ref: command observer |
|
113 MPbk2CommandObserver* iCommandObserver; |
|
114 /// Own: Link to contact to edit |
|
115 MVPbkContactLink* iGroupLink; |
|
116 /// Own: Contact operation |
|
117 MVPbkContactOperationBase* iContactOperation; |
|
118 /// Own: Contact group |
|
119 MVPbkContactGroup* iContactGroup; |
|
120 /// Own: current state of process |
|
121 TProcessState iState; |
|
122 }; |
|
123 |
|
124 #endif // CPGURENAMEGROUPCMD_H |
|
125 |
|
126 // End of File |