|
1 /* |
|
2 * Copyright (c) 2008-2009 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 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 #ifndef MSMMSERVER_H |
|
24 #define MSMMSERVER_H |
|
25 |
|
26 // Include Files |
|
27 #include <e32base.h> // for CPolicyServer |
|
28 #include <ecom/implementationinformation.h> |
|
29 |
|
30 // Project includes |
|
31 #include "srvdef.h" |
|
32 #include "srvpanic.h" |
|
33 #include "srvsec.h" |
|
34 |
|
35 // Forward declaration |
|
36 class CMsmmEngine; |
|
37 class CMsmmTerminator; |
|
38 class CDeviceEventQueue; |
|
39 class CMsmmPolicyPluginBase; |
|
40 |
|
41 // Server side resource container class |
|
42 // Intends to be used by any internal objects (such as sub-command objects) |
|
43 // needs access to engine, policy plugin, MSC or RFs. |
|
44 class MMsmmSrvProxy |
|
45 { |
|
46 public: |
|
47 virtual CMsmmEngine& Engine() const = 0; |
|
48 virtual RFs& FileServerSession() const = 0; |
|
49 virtual CMsmmPolicyPluginBase* PolicyPlugin() const = 0; |
|
50 }; |
|
51 |
|
52 // The MSMM server class |
|
53 NONSHARABLE_CLASS (CMsmmServer) : public CPolicyServer, public MMsmmSrvProxy |
|
54 { |
|
55 public: // Static |
|
56 static TInt ThreadFunction(); |
|
57 static void ThreadFunctionL(); |
|
58 |
|
59 public: |
|
60 |
|
61 // Construction and destruction |
|
62 static CMsmmServer* NewLC(); |
|
63 ~CMsmmServer(); |
|
64 |
|
65 public: |
|
66 // CMsmmServer API |
|
67 virtual CSession2* NewSessionL(const TVersion& aVersion, |
|
68 const RMessage2& aMessage) const; |
|
69 |
|
70 TInt SessionNumber() const; |
|
71 void AddSession(); |
|
72 void RemoveSession(); |
|
73 |
|
74 // From MMsmmSrvProxy |
|
75 inline CMsmmEngine& Engine() const; |
|
76 inline RFs& FileServerSession() const; |
|
77 inline CMsmmPolicyPluginBase* PolicyPlugin() const; |
|
78 |
|
79 private: // CMsmmServer Construction |
|
80 CMsmmServer(TInt aPriority); |
|
81 void ConstructL(); |
|
82 |
|
83 private: // Data members |
|
84 TInt iNumSessions; |
|
85 CMsmmTerminator* iTerminator; // Owned |
|
86 CMsmmEngine* iEngine; // Owned |
|
87 RFs iFs; |
|
88 CMsmmPolicyPluginBase* iPolicyPlugin; // Owned |
|
89 CDeviceEventQueue* iEventQueue; // Owned |
|
90 }; |
|
91 #include "msmmserver.inl" |
|
92 #endif // MSMMSERVER_H |