|
1 /* |
|
2 * Copyright (c) 2005 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: |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __CMSSESSION_H__ |
|
21 #define __CMSSESSION_H__ |
|
22 |
|
23 // FORWARD DECLARATIONS |
|
24 class CCmsServer; |
|
25 class CCmsPhoneBookProxy; |
|
26 class MCmsContactInterface; |
|
27 |
|
28 /** |
|
29 * CCmsServerSession represents a session for a client thread on the |
|
30 * server side. |
|
31 */ |
|
32 NONSHARABLE_CLASS( CCmsServerSession ) : public CSession2 |
|
33 { |
|
34 public: // Constructors and destructor |
|
35 |
|
36 /** |
|
37 * Creates new server session |
|
38 * |
|
39 * @param CCmsServer* The main server object |
|
40 * @return CCmsSession* New session |
|
41 */ |
|
42 static CCmsServerSession* NewL( CCmsServer* aServer ); |
|
43 |
|
44 /** |
|
45 * Service an incoming request |
|
46 * @param RMessage2& Kernel message with client's data |
|
47 * |
|
48 * @return void |
|
49 */ |
|
50 void ServiceL( const RMessage2& aMessage ); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 ~CCmsServerSession(); |
|
56 |
|
57 public: // Public methods |
|
58 |
|
59 /** |
|
60 * Notifies session that stores open is complete. |
|
61 */ |
|
62 void StoreOpenComplete(); |
|
63 |
|
64 /** |
|
65 * Notifies session that contact retrieving is done. |
|
66 * |
|
67 * @param aError Operation completion status |
|
68 */ |
|
69 void CmsSingleContactOperationComplete( TInt aError ); |
|
70 |
|
71 private: |
|
72 |
|
73 /** |
|
74 * Symbian OS second-phase constructor |
|
75 */ |
|
76 void ConstructL(); |
|
77 |
|
78 /** |
|
79 * C++ default constructor is private. |
|
80 * |
|
81 * @param CCmsServer* The main server object |
|
82 */ |
|
83 CCmsServerSession( CCmsServer* aServer ); |
|
84 |
|
85 /** |
|
86 * Panic the client |
|
87 * |
|
88 * @param TInt Panic code |
|
89 */ |
|
90 void PanicClient( TInt aPanic ); |
|
91 |
|
92 /** |
|
93 * Creates new CCmsServerContact and fetches contact info |
|
94 * |
|
95 * @param aMessage Kernel message with client's data |
|
96 */ |
|
97 void CreateContactL( const RMessage2& aMessage ); |
|
98 |
|
99 /** |
|
100 * Fetches list of enabled (i.e. with some content) fields |
|
101 * |
|
102 * @param aMessage Kernel message with client's data |
|
103 */ |
|
104 void EnabledFieldsL( const RMessage2& aMessage ); |
|
105 |
|
106 /** |
|
107 * Fetches contact field |
|
108 * |
|
109 * @param aMessage Kernel message with client's data |
|
110 */ |
|
111 void FetchDataL( const RMessage2& aMessage ); |
|
112 |
|
113 /** |
|
114 * Fetches contact identifier (ID) |
|
115 * |
|
116 * @param aMessage Kernel message with client's data |
|
117 */ |
|
118 void FetchContactIdentifierL( const RMessage2& aMessage ); |
|
119 |
|
120 /** |
|
121 * Cancels ongoing async operation |
|
122 * |
|
123 * @param aMessage Kernel message with client's data |
|
124 */ |
|
125 void CancelOperation( const RMessage2& aMessage ); |
|
126 |
|
127 /** |
|
128 * Activates notifications |
|
129 * |
|
130 * @param aMessage Kernel message with client's data |
|
131 * @param aAskMore If ETrue, returns current presence status imemdiately |
|
132 * from the presence cache and notify later about any changes |
|
133 */ |
|
134 void OrderNotifyL( const RMessage2& aMessage, TBool aAskMore ); |
|
135 |
|
136 /** |
|
137 * Cancels notifications |
|
138 * |
|
139 * @param aMessage Kernel message with client's data |
|
140 */ |
|
141 void CompleteNotify( const RMessage2& aMessage ); |
|
142 |
|
143 /** |
|
144 * Finds services (IM, Voip, etc) availability |
|
145 * |
|
146 * @param aMessage Kernel message with client's data |
|
147 * @return 0 if not available, 1 otherwise |
|
148 */ |
|
149 TInt FindServiceAvailabilityL( const RMessage2& aMessage ); |
|
150 |
|
151 /** |
|
152 * Returns current contact's store |
|
153 * |
|
154 * @param aMessage Kernel message with client's data |
|
155 * @return Contact store, see TCmsContactStore from CCmsServerContact |
|
156 */ |
|
157 TInt FindParentStoreL( const RMessage2& aMessage ); |
|
158 |
|
159 /** |
|
160 * Finds a contact from xSP store |
|
161 * |
|
162 * @param aMessage Kernel message with client's data |
|
163 */ |
|
164 void FindXSPContactL( const RMessage2& aMessage ); |
|
165 |
|
166 /** |
|
167 * Cancels xSP contact search |
|
168 * |
|
169 * @param aMessage Kernel message with client's data |
|
170 */ |
|
171 void CancelXSPContactFindL( const RMessage2& aMessage ); |
|
172 |
|
173 /** |
|
174 * Fetches contact information |
|
175 * |
|
176 * @param aMessage Kernel message with client's data |
|
177 * @param aContactInterface Observer to be notified about |
|
178 * operation completion |
|
179 */ |
|
180 void FetchContactL( const RMessage2& aMessage, |
|
181 MCmsContactInterface* aContactInterface ); |
|
182 |
|
183 /** |
|
184 * Gets contact action field count. |
|
185 */ |
|
186 TInt GetContacActionFieldCountL( const RMessage2& aMessage ); |
|
187 |
|
188 /** |
|
189 * Handles clients requests |
|
190 * |
|
191 * @param aMessage Kernel message with client's data |
|
192 */ |
|
193 void DoServiceL( const RMessage2& aMessage ); |
|
194 |
|
195 /** |
|
196 * Checks whether the Current contact is top contact. |
|
197 * |
|
198 * @param aMessage Kernel message with client's data |
|
199 */ |
|
200 void IsTopContactL( const RMessage2& aMessage ); |
|
201 |
|
202 private: //Data |
|
203 |
|
204 /// CMS server instance. Not owned. |
|
205 CCmsServer* iCmsServer; |
|
206 |
|
207 // CCmsServerContact instance. Owned. |
|
208 CCmsServerContact* iServerContact; |
|
209 |
|
210 /// Service message to fetch a contact. Completed when contact |
|
211 /// retrieving operation is done. |
|
212 RMessage2 iCmsContactRetrieveMessage; |
|
213 |
|
214 /// Pointer for delayed processing if stores are not opened yet. |
|
215 /// Must be pointer, Message status is not updated if a copy is done ! |
|
216 const RMessage2* iServiceMessage; |
|
217 |
|
218 /// ETrue, if FeatureManager library was initialized. |
|
219 TBool iFeatureManagerInitialized; |
|
220 }; |
|
221 |
|
222 |
|
223 #endif |
|
224 |
|
225 // End of File |