|
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: Presence attribute transaction environment. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CPENGPRESENCEATTRTRANSACTIONENV_H |
|
19 #define CPENGPRESENCEATTRTRANSACTIONENV_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <E32Base.h> |
|
23 |
|
24 #include "CPEngSessionSlotObject.h" |
|
25 #include "MPEngPresenceAttrTransactionEnv.h" |
|
26 |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CPEngOrphanNotificationQue; |
|
30 class CPEngSubscribedUsers; |
|
31 class CPEngSubscribedUser; |
|
32 class CPEngSessionSlotId; |
|
33 class MPEngPresenceAttrManager; |
|
34 |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * Presence attribute transaction environment. |
|
40 * |
|
41 * @since 3.0 |
|
42 */ |
|
43 NONSHARABLE_CLASS( CPEngPresenceAttrTransactionEnv ) : public CPEngSessionSlotObject, |
|
44 public MPEngPresenceAttrTransactionEnv |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 */ |
|
51 static CPEngPresenceAttrTransactionEnv* NewL( const CPEngSessionSlotId& aSlotId, |
|
52 MPEngPresenceAttrManager& aAttrMan ); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 ~CPEngPresenceAttrTransactionEnv(); |
|
58 |
|
59 private: |
|
60 |
|
61 /** |
|
62 * By default Symbian OS constructor is private. |
|
63 */ |
|
64 void ConstructL( const CPEngSessionSlotId& aSlotId ); |
|
65 |
|
66 /** |
|
67 * C++ default constructor. |
|
68 */ |
|
69 CPEngPresenceAttrTransactionEnv( MPEngPresenceAttrManager& aAttrMan ); |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 public: // Functions from MPEngPresenceAttrTransactionEnv |
|
75 |
|
76 |
|
77 /** |
|
78 * From MPEngPresenceAttrTransactionEnv. |
|
79 * @since 3.0 |
|
80 */ |
|
81 void Close(); |
|
82 void AddSubscriptionL( const TDesC& aPresenceID ); |
|
83 void RemoveSubscriptionL( const TDesC& aPresenceID ); |
|
84 const MDesCArray& SubscribedPresenceIDs() const; |
|
85 |
|
86 |
|
87 void SetSessionTracingAttributesL( |
|
88 RPointerArray< MPEngPresenceAttrModel2 >& aAttributeModels ); |
|
89 |
|
90 void UpdateSessionTracingAttributesL( |
|
91 RPointerArray< MPEngPresenceAttrModel2 >& aAttributeModels ); |
|
92 |
|
93 void HandleNetworkSessionStateChangeL( TBool aSessionOpen ); |
|
94 |
|
95 |
|
96 void QueOrphanNotificationL( const TDesC8& aPresenceBlock ); |
|
97 void ProcessOrphanNotificationsL( |
|
98 RPointerArray< MPEngPresenceAttrModel2 >& aModels ); |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 private: // Helpers |
|
104 |
|
105 |
|
106 /** |
|
107 * Initializes user's attributes to presence cache. |
|
108 * |
|
109 * @since 3.0 |
|
110 * @param aPresenceID The user which attributes to initialize. |
|
111 */ |
|
112 void DoInitializeAttributesToCacheL( const TDesC& aPresenceID ); |
|
113 |
|
114 |
|
115 /** |
|
116 * Clears user's attributes from cache. |
|
117 * |
|
118 * @since 3.0 |
|
119 * @param aPresenceID The user which attributes to clear. |
|
120 */ |
|
121 void DoClearAttributesFromCacheL( const TDesC& aPresenceID ); |
|
122 |
|
123 |
|
124 /** |
|
125 * Processes buffered orphan notifications and |
|
126 * stores generated attribute models to presence cache. |
|
127 * |
|
128 * @since 3.0 |
|
129 */ |
|
130 void DoProcessAndStoreOrphanNotificationsL(); |
|
131 |
|
132 |
|
133 |
|
134 private: // Data |
|
135 |
|
136 //OWN: Transaction domain |
|
137 HBufC16* iDomain; |
|
138 |
|
139 //OWN: Subscribed users |
|
140 CPEngSubscribedUsers* iSubscribedUsers; |
|
141 |
|
142 |
|
143 //OWN: Que for orphan notifications |
|
144 CPEngOrphanNotificationQue* iOrphanNotifications; |
|
145 |
|
146 |
|
147 //OWN: Attribute Manager |
|
148 MPEngPresenceAttrManager& iAttributeManager; |
|
149 |
|
150 |
|
151 //OWN: Flag is the above Attribute Manager owned or not |
|
152 TBool iAttributeManagerOwned; |
|
153 |
|
154 |
|
155 //OWN: Session tracing attributes |
|
156 RPointerArray< MPEngPresenceAttrModel2 > iSessTracingAttribs; |
|
157 |
|
158 }; |
|
159 |
|
160 #endif // CPENGPRESENCEATTRTRANSACTIONENV_H |
|
161 |
|
162 // End of File |
|
163 |