|
1 /* |
|
2 * Copyright (c) 2008 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: Haptics server side session interface. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_HWRMHAPTICSSESSION_H |
|
20 #define C_HWRMHAPTICSSESSION_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class CHWRMHapticsServer; |
|
25 class CHWRMHapticsService; |
|
26 |
|
27 /** |
|
28 * Represents a session for a client thread on the server-side. |
|
29 * A session acts as a channel of communication between the client |
|
30 * and the server. |
|
31 */ |
|
32 class CHWRMHapticsSession : public CSession2 |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * Two-phased constructor. |
|
38 * |
|
39 * @return Instance of this class. |
|
40 */ |
|
41 static CHWRMHapticsSession* NewL(); |
|
42 |
|
43 /** |
|
44 * Destructor. |
|
45 */ |
|
46 virtual ~CHWRMHapticsSession(); |
|
47 |
|
48 /** |
|
49 * From CSession2. |
|
50 * |
|
51 * @param aMessage The message containing the client request |
|
52 */ |
|
53 virtual void ServiceL( const RMessage2& aMessage ); |
|
54 |
|
55 /** |
|
56 * From CSession2 |
|
57 */ |
|
58 virtual void CreateL(); |
|
59 |
|
60 /** |
|
61 * From CSession2 |
|
62 */ |
|
63 void Disconnect(const RMessage2& aMessage); |
|
64 |
|
65 private: |
|
66 |
|
67 /** |
|
68 * C++ default constructor. |
|
69 */ |
|
70 CHWRMHapticsSession(); |
|
71 |
|
72 /** |
|
73 * Symbian 2nd phase constructor. |
|
74 */ |
|
75 void ConstructL(); |
|
76 |
|
77 /** |
|
78 * Handles commands from client. |
|
79 * |
|
80 * @param aMessage The message containing the client request |
|
81 */ |
|
82 void DispatchMessageL( const RMessage2& aMessage ); |
|
83 |
|
84 /** |
|
85 * Method for getting the Server object to which this session |
|
86 * belongs to. |
|
87 */ |
|
88 CHWRMHapticsServer& MyServer(); |
|
89 |
|
90 private: |
|
91 |
|
92 /** |
|
93 * Pointer to the service object. |
|
94 */ |
|
95 CHWRMHapticsService* iService; |
|
96 |
|
97 /** |
|
98 * A flag to indicate if message completion is needed in ServiceL. |
|
99 * Async and plugin calls set this to false. |
|
100 */ |
|
101 TBool iCompletionNeeded; |
|
102 }; |
|
103 |
|
104 #endif // C_HWRMHAPTICSSESSION_H |
|
105 |
|
106 // End of File |