|
1 /* |
|
2 * Copyright (c) 2006-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 "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: CObexSM class definition |
|
15 definitions. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef OBEXSM_H |
|
22 #define OBEXSM_H |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 #include <e32svr.h> |
|
27 #include "obexserviceman.h" |
|
28 #include "SrcsServiceManager.h" |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 |
|
32 |
|
33 /** |
|
34 * CSrcs server core class |
|
35 * |
|
36 */ |
|
37 class CObexSM : public CPolicyServer |
|
38 { |
|
39 |
|
40 public: |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 */ |
|
45 static CObexSM* NewL(); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 ~CObexSM(); |
|
51 |
|
52 public: // New functions |
|
53 |
|
54 /** |
|
55 * Initializes all server database classes |
|
56 * |
|
57 * @since s60 3.2 |
|
58 */ |
|
59 void InitialiseServerL(); |
|
60 |
|
61 /** |
|
62 * Manages Services that are handled by SRCS |
|
63 * |
|
64 * @since s60 3.2 |
|
65 * @param aTransport the used transport media |
|
66 * @param aState Boolean ON/OFF |
|
67 * @param aObserver the request completing observer |
|
68 * @param aMessage the message to be completed |
|
69 * @return TInt indicating the success of call. |
|
70 */ |
|
71 TInt ManageServices(TSrcsTransport aTransport,TBool aState, MObexSMRequestObserver* aObserver, |
|
72 const RMessage2& aMessage); |
|
73 |
|
74 |
|
75 |
|
76 public: // Functions from base classes |
|
77 |
|
78 |
|
79 /** |
|
80 * From CServer NewSessionL. |
|
81 * |
|
82 * @since s60 3.2 |
|
83 * @param aVersion version number |
|
84 * @param aMessage the connect message |
|
85 * @return Pointer to session |
|
86 */ |
|
87 CSession2* NewSessionL( const TVersion& aVersion, const RMessage2& aMessage ) const; |
|
88 |
|
89 /** |
|
90 * Increase session count |
|
91 * |
|
92 * @since s60 3.2 |
|
93 */ |
|
94 void IncSessionCount(); |
|
95 |
|
96 /** |
|
97 * Decrese session count and shutdown server when all session are closed. |
|
98 * |
|
99 * @since s60 3.2 |
|
100 */ |
|
101 void DecSessionCount(); |
|
102 |
|
103 private: |
|
104 |
|
105 /** |
|
106 * Default constructor |
|
107 */ |
|
108 CObexSM( TInt aPriority ); |
|
109 |
|
110 /** |
|
111 * Two-Phase constructor |
|
112 */ |
|
113 void ConstructL(); |
|
114 |
|
115 private: // Data |
|
116 CSrcsServiceManager* iServiceHandler; // Service Handler |
|
117 TInt iSessionCount; |
|
118 }; |
|
119 |
|
120 #endif // OBEXSM_H |
|
121 |
|
122 // End of File |