|
1 /* |
|
2 * Copyright (c) 2002-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 the License "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: Session class is required by the Client/Server architecture |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef WLMSESSION_H |
|
20 #define WLMSESSION_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include "wlmclientserver.h" |
|
24 |
|
25 class CWlmServer; |
|
26 class CSessionNotification; |
|
27 |
|
28 /** |
|
29 * Server side counterpart for client's RWlmServer class. |
|
30 * Each client connection has its own session in server. |
|
31 * |
|
32 * @lib wlmserversrv.lib |
|
33 * @since Series 60 3.0 |
|
34 */ |
|
35 NONSHARABLE_CLASS(CWlmSession) : public CSession2 |
|
36 { |
|
37 |
|
38 struct TNotification |
|
39 { |
|
40 TInt id; |
|
41 TBuf8<KMaxNotificationLength> data; |
|
42 }; |
|
43 |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 */ |
|
49 static CWlmSession* NewL( |
|
50 CWlmServer& aServer ); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 virtual ~CWlmSession(); |
|
56 |
|
57 public: // New functions |
|
58 |
|
59 /** |
|
60 * AddNotification |
|
61 * @since Series 60 3.0 |
|
62 * @param ?arg1 ?description |
|
63 */ |
|
64 void AddNotification( |
|
65 TInt aNotification, |
|
66 const TDesC8& aData ); |
|
67 |
|
68 public: // Functions from base classes |
|
69 |
|
70 /** |
|
71 * From CSession2 |
|
72 * ServiceL is called by client/server infrastructure, |
|
73 * and it takes care of one service request |
|
74 * @since Series 60 3.0 |
|
75 * @param aMessage containing the service request |
|
76 */ |
|
77 virtual void ServiceL( |
|
78 const RMessage2& aMessage ); |
|
79 |
|
80 private: |
|
81 |
|
82 /** |
|
83 * C++ default constructor. |
|
84 */ |
|
85 CWlmSession( |
|
86 CWlmServer& aServer ); |
|
87 |
|
88 /** |
|
89 * By default Symbian 2nd phase constructor is private. |
|
90 */ |
|
91 void ConstructL(); |
|
92 |
|
93 /** |
|
94 * ?member_description. |
|
95 * @since Series 60 3.0 |
|
96 * @param ?arg1 ?description |
|
97 * @return ?description |
|
98 */ |
|
99 void HandleNotification(); |
|
100 |
|
101 /** |
|
102 * ?member_description. |
|
103 * @since Series 60 3.0 |
|
104 * @param ?arg1 ?description |
|
105 * @return ?description |
|
106 */ |
|
107 void HandleOrderNotifications( |
|
108 const RMessage2& aMessage ); |
|
109 |
|
110 /** |
|
111 * ?member_description. |
|
112 * @since Series 60 3.0 |
|
113 * @param ?arg1 ?description |
|
114 * @return ?description |
|
115 */ |
|
116 void HandleCancelNotifications( |
|
117 const RMessage2& aMessage ); |
|
118 |
|
119 private: // Data |
|
120 |
|
121 /** ID of the session. */ |
|
122 TUint iId; |
|
123 |
|
124 /** Handle to the WLAN server. */ |
|
125 CWlmServer& iWlmServer; |
|
126 |
|
127 /** List of pending (not sent) notifications. */ |
|
128 RArray<TNotification> iPendingNotifications; |
|
129 |
|
130 /** The request from the client pending for a notification. */ |
|
131 RMessagePtr2 iPendingNotificationRequest; |
|
132 |
|
133 /** Is there a pending request from the client. */ |
|
134 TBool iIsNotificationRequestPending; |
|
135 |
|
136 /** Handle to remove notification. */ |
|
137 CSessionNotification* iNotificationHandle; |
|
138 }; |
|
139 |
|
140 #endif // WLMSESSION_H |
|
141 |
|
142 // End of File |