|
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 speed dial attribute unassigner. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2CONTACTSPEEDDIALATTRIBUTEUNASSIGNER_H |
|
20 #define CPBK2CONTACTSPEEDDIALATTRIBUTEUNASSIGNER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "MPbk2ContactAssigner.h" |
|
25 #include <Pbk2ServerAppIPC.h> |
|
26 #include <MVPbkContactAttributeManager.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class MPbk2ContactAssignerObserver; |
|
30 class CVPbkContactManager; |
|
31 class MVPbkContactAttribute; |
|
32 class MVPbkContactOperationBase; |
|
33 class MVPbkStoreContact; |
|
34 class MVPbkStoreContactField; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * Phonebook 2 speed dial attribute unassigner. |
|
40 */ |
|
41 class CPbk2ContactSpeedDialAttributeUnassigner : public CActive, |
|
42 public MPbk2ContactAssigner, |
|
43 public MVPbkSetAttributeObserver |
|
44 { |
|
45 public: // Construction and destruction |
|
46 |
|
47 /** |
|
48 * Creates a new instance of this class. |
|
49 * |
|
50 * @param aObserver Observer. |
|
51 * @param aContactManager Virtual Phonebook contact manager. |
|
52 * @return A new instance of this class. |
|
53 */ |
|
54 static CPbk2ContactSpeedDialAttributeUnassigner* NewL( |
|
55 MPbk2ContactAssignerObserver& aObserver, |
|
56 CVPbkContactManager& aContactManager ); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 ~CPbk2ContactSpeedDialAttributeUnassigner(); |
|
62 |
|
63 public: // From MPbk2ContactAssigner |
|
64 void AssignDataL( |
|
65 MVPbkStoreContact& aStoreContact, |
|
66 MVPbkStoreContactField* aContactField, |
|
67 const MVPbkFieldType* aFieldType, |
|
68 const HBufC* aDataBuffer ); |
|
69 void AssignAttributeL( |
|
70 MVPbkStoreContact& aStoreContact, |
|
71 MVPbkStoreContactField* aContactField, |
|
72 TPbk2AttributeAssignData aAttributeAssignData ); |
|
73 |
|
74 private: // From MVPbkSetAttributeObserver |
|
75 void AttributeOperationComplete( |
|
76 MVPbkContactOperationBase& aOperation); |
|
77 void AttributeOperationFailed( |
|
78 MVPbkContactOperationBase& aOperation, |
|
79 TInt aError ); |
|
80 |
|
81 private: // From CActive |
|
82 void RunL(); |
|
83 void DoCancel(); |
|
84 TInt RunError( |
|
85 TInt aError ); |
|
86 |
|
87 private: // Implementation |
|
88 CPbk2ContactSpeedDialAttributeUnassigner( |
|
89 MPbk2ContactAssignerObserver& aObserver, |
|
90 CVPbkContactManager& aContactManager ); |
|
91 void UnassignAttributeL(); |
|
92 void IssueRequest(); |
|
93 |
|
94 private: // Data |
|
95 /// Ref: Observer |
|
96 MPbk2ContactAssignerObserver& iObserver; |
|
97 /// Own: Attribute data to assign |
|
98 TPbk2AttributeAssignData iAttributeAssignData; |
|
99 /// Ref: Virtual Phonebook contact manager |
|
100 CVPbkContactManager& iContactManager; |
|
101 /// Own: Attribute unassign operation |
|
102 MVPbkContactOperationBase* iUnassignOperation; |
|
103 /// Own: The attribute to operate with |
|
104 MVPbkContactAttribute* iAttribute; |
|
105 /// Own: Store contact field |
|
106 MVPbkStoreContactField* iStoreContactField; |
|
107 }; |
|
108 |
|
109 #endif // CPBK2CONTACTSPEEDDIALATTRIBUTEUNASSIGNER_H |
|
110 |
|
111 // End of File |