|
1 /* |
|
2 * Copyright (c) 2010 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: Declaration of server session class. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef POSINDICATORSERVERSESSION_H |
|
19 #define POSINDICATORSERVERSESSION_H |
|
20 |
|
21 #include <e32base.h> |
|
22 |
|
23 // Forward declaration |
|
24 class CPosIndicatorServerCore; |
|
25 class CPosIndicatorSubSessionRegistry; |
|
26 |
|
27 class CPosIndicatorServerSession : public CSession2 |
|
28 { |
|
29 public: |
|
30 /** |
|
31 * Instantiates a new object of CPosIndicatorServerSession |
|
32 * |
|
33 */ |
|
34 static CPosIndicatorServerSession* NewL( const |
|
35 CPosIndicatorServerCore& aServerCore ); |
|
36 |
|
37 public: // From CSession2 |
|
38 /** |
|
39 * Handles the servicing of a client request that |
|
40 * has been passed to the server via this session. |
|
41 * |
|
42 * @param[in] aMessage The message containing the details of |
|
43 * the client request |
|
44 * |
|
45 */ |
|
46 virtual void ServiceL(const RMessage2 &aMessage); |
|
47 |
|
48 /** |
|
49 * Handles error cases when the ServiceL method leaves. |
|
50 * |
|
51 * @param[in] aMessage The message containing the details of |
|
52 * the client request |
|
53 * @param[in] aError The error code that the serviceL method |
|
54 * leaves with |
|
55 */ |
|
56 virtual void ServiceError(const RMessage2& aMessage,TInt aError); |
|
57 |
|
58 /** |
|
59 * Handles session closure when the client panics. |
|
60 * |
|
61 * @param[in] aMessage The message containing the details of |
|
62 * the client request |
|
63 * @param[in] aError The error code that the serviceL method |
|
64 * leaves with |
|
65 */ |
|
66 virtual void Disconnect(const RMessage2& aMessage); |
|
67 |
|
68 private: |
|
69 /** |
|
70 * Default C++ Constructor |
|
71 * |
|
72 * @param[in] aSecureId the secure Id of the client application |
|
73 * which has created this session object. |
|
74 * |
|
75 */ |
|
76 CPosIndicatorServerSession( const CPosIndicatorServerCore& aServerCore ); |
|
77 |
|
78 /** |
|
79 * Destructor |
|
80 * |
|
81 */ |
|
82 ~CPosIndicatorServerSession(); |
|
83 |
|
84 /** |
|
85 * 2nd phase constructor for instantiating |
|
86 * member variables |
|
87 * |
|
88 * @param[in] aSecureId the secure Id of the client application |
|
89 * which has created this session object. |
|
90 */ |
|
91 void ConstructL(); |
|
92 |
|
93 /** |
|
94 * Create a sub-session object |
|
95 * |
|
96 */ |
|
97 void CreateSubSessionL(const RMessage2 &aMessage); |
|
98 |
|
99 /** |
|
100 * Forwards client request to sub-session |
|
101 * |
|
102 * @aMessage[in] The message containing the details of |
|
103 * the client request |
|
104 * |
|
105 */ |
|
106 void ForwardToSubSessionL(const RMessage2& aMessage); |
|
107 |
|
108 |
|
109 private: //Data |
|
110 |
|
111 /** |
|
112 * Reference to the server object |
|
113 */ |
|
114 const CPosIndicatorServerCore& iServerCore; |
|
115 |
|
116 /** |
|
117 * Pointer to the sub-session registry |
|
118 * Own |
|
119 */ |
|
120 CPosIndicatorSubSessionRegistry* iSubSessionRegistry; |
|
121 }; |
|
122 |
|
123 #endif /* POSINDICATORSERVERSESSION_H */ |