|
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 server app assign select single property phase. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2SELECTSINGLEPROPERTYPHASE_H |
|
20 #define CPBK2SELECTSINGLEPROPERTYPHASE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <MVPbkSingleContactOperationObserver.h> |
|
25 #include <MPbk2ExitCallback.h> |
|
26 #include "MPbk2ServicePhase.h" |
|
27 #include <MVPbkContactObserver.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CVPbkContactLinkArray; |
|
31 class MPbk2ServicePhaseObserver; |
|
32 class MVPbkContactLinkArray; |
|
33 class MVPbkContactOperationBase; |
|
34 class MPbk2SelectFieldProperty; |
|
35 class MPbk2DialogEliminator; |
|
36 class MVPbkStoreContact; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * Phonebook 2 server app assign select single property phase. |
|
42 * Responsible for selecting single assign property. |
|
43 */ |
|
44 class CPbk2SelectSinglePropertyPhase : |
|
45 public CBase, |
|
46 public MPbk2ServicePhase, |
|
47 private MVPbkSingleContactOperationObserver, |
|
48 private MPbk2ExitCallback, |
|
49 private MVPbkContactObserver |
|
50 { |
|
51 public: // Construction |
|
52 |
|
53 /** |
|
54 * Creates a new instance of this class. |
|
55 * |
|
56 * @param aObserver Observer. |
|
57 * @param aContactLinks Contacts to operate with. |
|
58 * @param aFilterBuffer Address select filter buffer. |
|
59 * @param aSelectFieldProperty Select field property. |
|
60 * @param aResult Selection result. |
|
61 * @return A new instance of this class. |
|
62 */ |
|
63 static CPbk2SelectSinglePropertyPhase* NewL( |
|
64 MPbk2ServicePhaseObserver& aObserver, |
|
65 MVPbkContactLinkArray* aContactLinks, |
|
66 HBufC8* aFilterBuffer, |
|
67 MPbk2SelectFieldProperty*& aSelectFieldProperty, |
|
68 TInt& aResult ); |
|
69 |
|
70 /** |
|
71 * Destructor. |
|
72 */ |
|
73 ~CPbk2SelectSinglePropertyPhase(); |
|
74 |
|
75 public: // From MPbk2ServicePhase |
|
76 void LaunchServicePhaseL(); |
|
77 void CancelServicePhase(); |
|
78 void RequestCancelL( |
|
79 TInt aExitCommandId ); |
|
80 void AcceptDelayedL( |
|
81 const TDesC8& aContactLinkBuffer ); |
|
82 void DenyDelayedL( |
|
83 const TDesC8& aContactLinkBuffer ); |
|
84 MVPbkContactLinkArray* Results() const; |
|
85 TInt ExtraResultData() const; |
|
86 MVPbkStoreContact* TakeStoreContact(); |
|
87 HBufC* FieldContent() const; |
|
88 |
|
89 public: // From MVPbkSingleContactOperationObserver |
|
90 void VPbkSingleContactOperationComplete( |
|
91 MVPbkContactOperationBase& aOperation, |
|
92 MVPbkStoreContact* aContact ); |
|
93 void VPbkSingleContactOperationFailed( |
|
94 MVPbkContactOperationBase& aOperation, |
|
95 TInt aError ); |
|
96 |
|
97 public: // From MPbk2ExitCallback |
|
98 TBool OkToExitL( |
|
99 TInt aCommandId ); |
|
100 |
|
101 private: // Implementation |
|
102 CPbk2SelectSinglePropertyPhase( |
|
103 MPbk2ServicePhaseObserver& aObserver, |
|
104 HBufC8* aFilterBuffer, |
|
105 MPbk2SelectFieldProperty*& aSelectFieldProperty, |
|
106 TInt& aResult ); |
|
107 void ConstructL( |
|
108 MVPbkContactLinkArray* aContactLinks ); |
|
109 void RetrieveContactL(); |
|
110 void SelectFieldL(); |
|
111 |
|
112 private: // From MVPbkContactObserver |
|
113 void ContactOperationCompleted( |
|
114 TContactOpResult aResult ); |
|
115 void ContactOperationFailed( |
|
116 TContactOp aOpCode, |
|
117 TInt aErrorCode, |
|
118 TBool aErrorNotified ); |
|
119 |
|
120 private: // Data |
|
121 /// Ref: Observer |
|
122 MPbk2ServicePhaseObserver& iObserver; |
|
123 /// Own: Store contact |
|
124 MVPbkStoreContact* iStoreContact; |
|
125 /// Own: Contact links |
|
126 CVPbkContactLinkArray* iContactLinks; |
|
127 /// Own: To check is this destroyed |
|
128 TBool* iDestroyedPtr; |
|
129 /// Own: Contact retrieve operation |
|
130 MVPbkContactOperationBase* iRetrieveOperation; |
|
131 /// Ref: Select field dialog eliminator |
|
132 MPbk2DialogEliminator* iSelectFieldDialogEliminator; |
|
133 /// Ref: Address select filter buffer |
|
134 HBufC8* iFilterBuffer; |
|
135 /// Ref: Select field property |
|
136 MPbk2SelectFieldProperty*& iSelectFieldProperty; |
|
137 /// Ref: Selected field index |
|
138 TInt& iResult; |
|
139 }; |
|
140 |
|
141 #endif // CPBK2SELECTSINGLEPROPERTYPHASE_H |
|
142 |
|
143 // End of File |