|
1 /* |
|
2 * Copyright (c) 2002 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: Admin Sub-session class of the Storage Server |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __CPENGADMINSUBSESSION_H__ |
|
21 #define __CPENGADMINSUBSESSION_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <badesca.h> |
|
26 |
|
27 #include "TPEngStorageServerMessages.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class MPEngStorageServer; |
|
31 class RPEngMessage; |
|
32 class CPEngStorageFolder; |
|
33 |
|
34 |
|
35 /** |
|
36 * Admin Subsession of the Storage Server |
|
37 * @since 3.0 |
|
38 */ |
|
39 class CPEngAdminSubSession : public CObject |
|
40 { |
|
41 public: // Constructors and destructor |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 */ |
|
46 static CPEngAdminSubSession* NewL( MPEngStorageServer& aServer, |
|
47 const RPEngMessage& aMessage, |
|
48 TInt32 aSessionId ); |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 */ |
|
53 static CPEngAdminSubSession* NewLC( MPEngStorageServer& aServer, |
|
54 const RPEngMessage& aMessage, |
|
55 TInt32 aSessionId ); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 virtual ~CPEngAdminSubSession(); |
|
61 |
|
62 public: // Function for handling of the clients requests |
|
63 |
|
64 /** |
|
65 * Dispatch message from the Sub Session |
|
66 * |
|
67 * @since 3.0 |
|
68 * @param aMessage is received message. |
|
69 * @return ETrue if message should be completed |
|
70 */ |
|
71 TBool DispatchMessageL( const RPEngMessage& aMessage, |
|
72 TInt aRequest ); |
|
73 |
|
74 /** |
|
75 * Set Sub-session handle ID for the Session |
|
76 * |
|
77 * @since 3.0 |
|
78 * @param aHandle Sub-session handle |
|
79 */ |
|
80 void SetSubSesionHandle( TInt aHandle ); |
|
81 |
|
82 private: // Functions from base classes |
|
83 |
|
84 /* |
|
85 * Client is panicked using this method. |
|
86 * |
|
87 * @since 3.0 |
|
88 * @param aMessage clients message |
|
89 * @param aPanic panic reason |
|
90 */ |
|
91 void PanicClient( const RPEngMessage& aMessage, |
|
92 const TInt aPanic ) const; |
|
93 |
|
94 /** |
|
95 * Notify about new global event |
|
96 * |
|
97 * @since 3.0 |
|
98 * @param aMessage clients message |
|
99 */ |
|
100 inline void NotifyGlobalEventL( const RPEngMessage& aMessage ); |
|
101 |
|
102 /** |
|
103 * Notify Error to listeners |
|
104 * |
|
105 * @since 3.0 |
|
106 * @param aMessage |
|
107 */ |
|
108 inline void NotifyError( const RPEngMessage& aMessage ); |
|
109 |
|
110 /** |
|
111 * Check application registration |
|
112 * |
|
113 * @since 3.0 |
|
114 * @param aMessage request message |
|
115 */ |
|
116 inline void CheckAppIdRegistrationL( const RPEngMessage& aMessage ); |
|
117 |
|
118 /** |
|
119 * Notify Global Session slot close |
|
120 * |
|
121 * @since 3.0 |
|
122 */ |
|
123 inline void NotifySessionSlotCloseL(); |
|
124 |
|
125 private: |
|
126 |
|
127 /** |
|
128 * C++ default constructor. |
|
129 */ |
|
130 CPEngAdminSubSession( MPEngStorageServer& aServer, TInt32 aSessionId ); |
|
131 |
|
132 /** |
|
133 * Symbian 2nd phase constructor |
|
134 */ |
|
135 void ConstructL( const RPEngMessage& aMessage ); |
|
136 |
|
137 private: // Data |
|
138 |
|
139 /// REF: Storage Cage |
|
140 CPEngStorageFolder* iStorageFolder; |
|
141 |
|
142 /// OWN: Sub Session Handle |
|
143 TInt iHandle; |
|
144 |
|
145 /// OWN: Session Id |
|
146 const TInt32 iSessionId; |
|
147 |
|
148 /// REF: Server reference |
|
149 MPEngStorageServer& iServer; |
|
150 |
|
151 }; |
|
152 |
|
153 #endif // __CPENGADMINSUBSESSION_H__ |
|
154 |
|
155 // End of File |