1 /* |
|
2 * Copyright (c) 2007 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: Server class in client/server paradigm of symbian.* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __CCRSERVER_H |
|
21 #define __CCRSERVER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 // CONSTANTS |
|
27 // None |
|
28 |
|
29 // MACROS |
|
30 // None |
|
31 |
|
32 // DATA TYPES |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CCREngine; |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * Server class. |
|
41 * |
|
42 * @lib CommonRecordingEngine.lib |
|
43 * @since Series 60 3.0 |
|
44 */ |
|
45 class CCRServer : public CPolicyServer |
|
46 { |
|
47 |
|
48 public: // Constructors and destructor |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 * @param aSemaphore a void pointer to semaphore. |
|
53 */ |
|
54 static CCRServer* NewLC(); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 virtual ~CCRServer(); |
|
60 |
|
61 public: // New functions |
|
62 |
|
63 /** |
|
64 * Thread function, creates cleanup stack for the thread. |
|
65 * @since Series 60 3.0 |
|
66 * @return KErrNone |
|
67 */ |
|
68 static TInt ThreadFunction( ); |
|
69 |
|
70 /** |
|
71 * Thread function, the active scheduler is installed and started. |
|
72 * @since Series 60 3.0 |
|
73 * @return None. |
|
74 */ |
|
75 static void ThreadFunctionL( ); |
|
76 |
|
77 /** |
|
78 * Signals client that server is started. |
|
79 * @since Series 60 3.0 |
|
80 * @return None. |
|
81 */ |
|
82 static void SignalClientL(); |
|
83 |
|
84 /** |
|
85 * Panics server. |
|
86 * @since Series 60 3.0 |
|
87 * @param aPanic panic code. |
|
88 * @return None. |
|
89 */ |
|
90 static void PanicServer( TInt aPanic ); |
|
91 |
|
92 /** |
|
93 * Starts the server thread. |
|
94 * @since Series 60 3.0 |
|
95 * @return None. |
|
96 */ |
|
97 static TInt StartThread(); |
|
98 |
|
99 /** |
|
100 * Dec |
|
101 * @since Series 60 3.0 |
|
102 * @return None. |
|
103 */ |
|
104 void Dec(); |
|
105 |
|
106 /** |
|
107 * Inc |
|
108 * @since Series 60 3.0 |
|
109 * @return None. |
|
110 */ |
|
111 void Inc(); |
|
112 |
|
113 /** |
|
114 * Create new Session. |
|
115 * @since Series 60 3.0 |
|
116 * @param aVersion server version number. |
|
117 * @return CSharableSession pointer to new created session. |
|
118 */ |
|
119 CSession2* NewSessionL( const TVersion &aVersion, |
|
120 const RMessage2& aMessage ) const; |
|
121 |
|
122 /** |
|
123 * Gets engine object. |
|
124 * @since Series 60 3.0 |
|
125 * @return CCREngine pointer. |
|
126 */ |
|
127 CCREngine* GetEngineObjectL(); |
|
128 |
|
129 protected: |
|
130 |
|
131 // From CPolicyServer |
|
132 |
|
133 /** |
|
134 * Called by framework to perform custom security check for any |
|
135 * client messages. |
|
136 * |
|
137 * @param aMsg Message. |
|
138 * @param aAction Action. |
|
139 * @param aMissing Security info. |
|
140 * @return Result of security check. |
|
141 */ |
|
142 TCustomResult CustomSecurityCheckL( |
|
143 const RMessage2 &aMsg, |
|
144 TInt &aAction, |
|
145 TSecurityInfo &aMissing ); |
|
146 |
|
147 private: // Constructors and destructor |
|
148 |
|
149 /** |
|
150 * C++ default constructor. |
|
151 */ |
|
152 CCRServer(); |
|
153 |
|
154 /** |
|
155 * By default Symbian 2nd phase constructor is private. |
|
156 */ |
|
157 void ConstructL( ); |
|
158 |
|
159 private: // Methods from base classes |
|
160 |
|
161 /** |
|
162 * Stops the server thread. |
|
163 * @since Series 60 3.0 |
|
164 * @return None. |
|
165 */ |
|
166 void StopServer(); |
|
167 |
|
168 private: // New methods |
|
169 |
|
170 /** |
|
171 * Deletes CR engine. |
|
172 * @since Series 60 3.0 |
|
173 * @return None. |
|
174 */ |
|
175 void DeleteRtpEngine(); |
|
176 |
|
177 private: // Data |
|
178 |
|
179 /** |
|
180 * Object container index. |
|
181 */ |
|
182 CObjectConIx* iContainerIx; |
|
183 |
|
184 /** |
|
185 * Object container. |
|
186 */ |
|
187 CObjectCon* iObjectCon; |
|
188 |
|
189 /** |
|
190 * CR engine object. |
|
191 */ |
|
192 CCREngine* iEngine; |
|
193 |
|
194 /** |
|
195 * Number of sessions. |
|
196 */ |
|
197 TInt iSessionCount; |
|
198 |
|
199 }; |
|
200 |
|
201 #endif // __CCRSERVER_H |
|
202 |
|
203 // End of File |
|