|
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 __MPENGPRESENCEATTRTRANSACTIONENV_H |
|
19 #define __MPENGPRESENCEATTRTRANSACTIONENV_H |
|
20 |
|
21 |
|
22 //INCLUDES |
|
23 #include <E32Std.h> |
|
24 #include "BamDescA.h" |
|
25 |
|
26 |
|
27 //FORWARD DECLARATIONS |
|
28 class MPEngPresenceAttrModel2; |
|
29 |
|
30 |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 |
|
35 /** |
|
36 * Interface for Presence Attribute Transaction Environment. |
|
37 * |
|
38 * Attribute Transaction Environment manages the list |
|
39 * of subscribed presence attributes |
|
40 * |
|
41 * NOTE!!! Attribute Transaction Environment is reference counted singleton, |
|
42 * so client which has retrieved a instance to it, must also free it |
|
43 * by calling MPEngPresenceAttrTransactionEnv::Close() |
|
44 * |
|
45 * @lib 3.0 |
|
46 */ |
|
47 class MPEngPresenceAttrTransactionEnv |
|
48 { |
|
49 |
|
50 public: //Reference cleanup |
|
51 |
|
52 /** |
|
53 * Attribute Transaction Environment is reference counted |
|
54 * singleton. and clients must free all obtained instances |
|
55 * by calling this to each of them when the Attribute |
|
56 * Transaction Environment isn't anymore needed. |
|
57 * |
|
58 * @since 3.0 |
|
59 */ |
|
60 virtual void Close() = 0; |
|
61 |
|
62 |
|
63 |
|
64 public: //Subscriptions |
|
65 |
|
66 |
|
67 /** |
|
68 * Adds given presence id into list of subscribed users. |
|
69 * |
|
70 * Subscriptions are "reference counted", so one subscribed |
|
71 * user can have several subscriptions active. |
|
72 * If given presence ID is empty, leaves with KErrArgument. |
|
73 * |
|
74 * @since 3.0 |
|
75 * @param aPresenceID The subscribed users presence ID. |
|
76 */ |
|
77 virtual void AddSubscriptionL( const TDesC& aPresenceID ) = 0; |
|
78 |
|
79 |
|
80 /** |
|
81 * Removes given user from attribute librarys list of |
|
82 * subscribed users. |
|
83 |
|
84 * Subscriptions are "reference counted", so one subscribed |
|
85 * user can have several subscriptions active. |
|
86 * ==> Subscribed user must be removed as many times |
|
87 * as it has been added. |
|
88 * |
|
89 * If given presence id is empty, does nothing. |
|
90 * |
|
91 * @since 3.0 |
|
92 * @param aPresenceID The subscribed users presence ID. |
|
93 */ |
|
94 virtual void RemoveSubscriptionL( const TDesC& aPresenceID ) = 0; |
|
95 |
|
96 |
|
97 /** |
|
98 * Gets the list of currently subscribed users. |
|
99 * |
|
100 * @since 3.0 |
|
101 * @return The list if currently subscribed users. |
|
102 */ |
|
103 virtual const MDesCArray& SubscribedPresenceIDs() const = 0; |
|
104 |
|
105 |
|
106 public: //Session attributes |
|
107 |
|
108 |
|
109 /** |
|
110 * Sets session tracing attributes. |
|
111 * Clears previous attributes and sets the new set in use. |
|
112 * |
|
113 * @since 3.0 |
|
114 * @param aAttributeModels Session tracing attributes. |
|
115 * In success, takes the ownership of attributes which |
|
116 * are removed from parameter array. |
|
117 */ |
|
118 virtual void SetSessionTracingAttributesL( |
|
119 RPointerArray< MPEngPresenceAttrModel2 >& aAttributeModels ) = 0; |
|
120 |
|
121 |
|
122 /** |
|
123 * Updates session tracing attributes. If attribute is found |
|
124 * from internal session tracing attributes list and also from |
|
125 * parameter array, takes the attribute from parameter array |
|
126 * away, and replaces the internal attribute object with |
|
127 * parameter one. |
|
128 * |
|
129 * @since 3.0 |
|
130 * @param aAttributeModels New session tracing attributes. |
|
131 * In success, takes the ownership of attributes which |
|
132 * are removed from parameter array. |
|
133 */ |
|
134 virtual void UpdateSessionTracingAttributesL( |
|
135 RPointerArray< MPEngPresenceAttrModel2 >& aAttributeModels ) = 0; |
|
136 |
|
137 |
|
138 /** |
|
139 * Informs held attributes about session state change |
|
140 * and then stores those back to storage. |
|
141 * |
|
142 * @since 3.0 |
|
143 * @param aSessionOpen If ETrue, network presence session |
|
144 * was opened. If EFalse, network presence session was closed. |
|
145 */ |
|
146 virtual void HandleNetworkSessionStateChangeL( TBool aSessionOpen ) = 0; |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 public: //Orphan notifications |
|
152 |
|
153 /** |
|
154 * Adds a presence notification to orphan notification que. |
|
155 * |
|
156 * @since 3.0 |
|
157 * @param aPresenceBlock The orphan notification to que. |
|
158 */ |
|
159 virtual void QueOrphanNotificationL( const TDesC8& aPresenceBlock ) = 0; |
|
160 |
|
161 |
|
162 /** |
|
163 * Processes the qued orphan notifications. |
|
164 * Adds the generated attribute models to given array. |
|
165 * |
|
166 * @since 3.0 |
|
167 * @param aModels The array to add produced attribute models. |
|
168 */ |
|
169 virtual void ProcessOrphanNotificationsL( |
|
170 RPointerArray< MPEngPresenceAttrModel2 >& aModels ) = 0; |
|
171 |
|
172 |
|
173 protected: |
|
174 |
|
175 /** |
|
176 * Protected destructor. |
|
177 * |
|
178 * Concrete Attribute Transaction Environment can't |
|
179 * be deleted through this interface. |
|
180 */ |
|
181 virtual ~MPEngPresenceAttrTransactionEnv() {}; |
|
182 |
|
183 }; |
|
184 |
|
185 #endif // __MPENGPRESENCEATTRTRANSACTIONENV_H |
|
186 |
|
187 // End of File |