|
1 /* |
|
2 * Copyright (c) 2004 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: this class is an operation handler for fetching attributes from network. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPENGATTRIBUTEFETCHOP_H |
|
20 #define CPENGATTRIBUTEFETCHOP_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "CPEngAsyncOperation.h" |
|
24 #include <E32Base.h> |
|
25 #include <BaMDesCa.h> |
|
26 |
|
27 |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class MPEngAttributeTransactionObserver2; |
|
31 class CPEngAttributeTransaction2; |
|
32 class MPEngPresenceAttrManager; |
|
33 class MPEngPresenceAttrModel2; |
|
34 |
|
35 |
|
36 /** |
|
37 * Operation handler for fetching attributes from network. |
|
38 * |
|
39 * @lib |
|
40 * @since 3.0 |
|
41 */ |
|
42 NONSHARABLE_CLASS( CPEngAttributeFetchOp ) : public CPEngAsyncOperation |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 */ |
|
49 static CPEngAttributeFetchOp* NewL( TInt aPriority, |
|
50 CPEngAttributeTransaction2& aInterface, |
|
51 CPEngNWSessionSlotStorageProxy& aUsedSlot, |
|
52 TBool aResultAsLocalObjects, |
|
53 const MDesCArray& aPresenceIDs, |
|
54 const TArray<TUint32>& aTypes, |
|
55 MPEngAttributeTransactionObserver2& aObserver, |
|
56 RPEngManagerClient& aServer ); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 virtual ~CPEngAttributeFetchOp(); |
|
62 |
|
63 |
|
64 private: |
|
65 |
|
66 /** |
|
67 * C++ default constructor. |
|
68 */ |
|
69 CPEngAttributeFetchOp( TInt aPriority, |
|
70 CPEngAttributeTransaction2& aInterface, |
|
71 MPEngAttributeTransactionObserver2& aObserver, |
|
72 RPEngManagerClient& aServer ); |
|
73 |
|
74 /** |
|
75 * Symbian OS constructor. |
|
76 */ |
|
77 void ConstructL( CPEngNWSessionSlotStorageProxy& aUsedSlot, |
|
78 const MDesCArray& aPresenceIDs, |
|
79 const TArray<TUint32>& aTypes, |
|
80 TBool aResultAsLocalObjects ); |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 public: //New services |
|
86 |
|
87 |
|
88 /** |
|
89 * Starts the fetch operation |
|
90 * |
|
91 * @since 3.0 |
|
92 */ |
|
93 void Fetch(); |
|
94 |
|
95 |
|
96 /** |
|
97 * |
|
98 * |
|
99 * @since 3.0 |
|
100 */ |
|
101 TInt GetFetchedAttributes( |
|
102 RPointerArray< MPEngPresenceAttrModel2>& aModels ); |
|
103 |
|
104 |
|
105 |
|
106 private: //Template method from base |
|
107 |
|
108 /** |
|
109 * Notifies from operation complete. |
|
110 */ |
|
111 void DoHandleOpSuccessL( MPEngAdvTransactionStatus2& aStatus, |
|
112 TInt aTransactionOperation ); |
|
113 |
|
114 void DoHandleOpFailure( MPEngAdvTransactionStatus2& aStatus, |
|
115 TInt aTransactionOperation ); |
|
116 |
|
117 TPEngAsyncOpResult DoNotifyObserver( MPEngAdvTransactionStatus2& aStatus, |
|
118 TInt aTransactionOperation ); |
|
119 |
|
120 |
|
121 |
|
122 private: //Data |
|
123 |
|
124 //REF: The implemented interface |
|
125 CPEngAttributeTransaction2& iInterface; |
|
126 |
|
127 //REF: The observer |
|
128 MPEngAttributeTransactionObserver2& iObserver; |
|
129 |
|
130 //OWN: Attribute manager |
|
131 MPEngPresenceAttrManager* iAttrManager; |
|
132 |
|
133 //OWN: Result models |
|
134 RPointerArray<MPEngPresenceAttrModel2> iResultModels; |
|
135 }; |
|
136 |
|
137 #endif // CPENGATTRIBUTEFETCHOP_H |
|
138 |
|
139 |
|
140 |
|
141 |