|
1 /* |
|
2 * Copyright (c) 2005 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: See class description below. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __CPENGSTORAGESESSION_H__ |
|
20 #define __CPENGSTORAGESESSION_H__ |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32def.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class MPEngStorageServer; |
|
27 class RPEngMessage; |
|
28 class CPEngStorageSubSession; |
|
29 class CPEngAdminSubSession; |
|
30 |
|
31 /** |
|
32 * Main session class of the storage server |
|
33 * @since 3.0 |
|
34 */ |
|
35 class CPEngStorageSession |
|
36 : public CSession2 |
|
37 { |
|
38 |
|
39 public: // Constructors and destructors |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 */ |
|
43 static CPEngStorageSession* NewL( MPEngStorageServer& aServer ); |
|
44 |
|
45 /** |
|
46 * Two-phased constructor. |
|
47 */ |
|
48 static CPEngStorageSession* NewLC( MPEngStorageServer& aServer ); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 virtual ~CPEngStorageSession(); |
|
54 |
|
55 protected: // Constructors and destructors |
|
56 |
|
57 /** |
|
58 * C++ default constructor. |
|
59 */ |
|
60 CPEngStorageSession( MPEngStorageServer& aServer ); |
|
61 |
|
62 /** |
|
63 * By default Symbian 2nd phase constructor is private. |
|
64 */ |
|
65 void ConstructL(); |
|
66 |
|
67 private: // New methods |
|
68 |
|
69 /** |
|
70 * Handles the message |
|
71 * @since 3.0 |
|
72 * @param aMessage is received message. |
|
73 */ |
|
74 void DispatchMessageL( const RPEngMessage& aMessage ); |
|
75 |
|
76 /** |
|
77 * Create new Folder sub-session |
|
78 * @since 3.0 |
|
79 * @param aMessage, message to write back handle of the new Sub session |
|
80 */ |
|
81 void CreateNewFolderSubSessionL( const RPEngMessage& aMessage ); |
|
82 |
|
83 /** |
|
84 * Create new Admin sub-session |
|
85 * @since 3.0 |
|
86 * @param aMessage, message to write back handle of the new Sub session |
|
87 */ |
|
88 void CreateNewAdminSubSessionL( const RPEngMessage& aMessage ); |
|
89 |
|
90 |
|
91 /** |
|
92 * Remove sub-session |
|
93 * @since 3.0 |
|
94 * @param aHandle handle of the sub-session |
|
95 * Function leaves if there is no such a sub-session |
|
96 */ |
|
97 void RemoveSubSessionL( TUint aHandle ); |
|
98 |
|
99 /** |
|
100 * Find Folder Sub-session |
|
101 * @since 3.0 |
|
102 * @param aHandle handle of the sub-session to find |
|
103 * @return Folder sub-session |
|
104 */ |
|
105 CPEngStorageSubSession* FindFolderSubSessionL( |
|
106 TUint aHandle ); |
|
107 |
|
108 /** |
|
109 * Find Admin Sub-session |
|
110 * |
|
111 * @since 3.0 |
|
112 * @param aHandle handle of the sub-session to find |
|
113 * @return Admin sub-session |
|
114 */ |
|
115 CPEngAdminSubSession* FindAdminSubSessionL( |
|
116 TUint aHandle ); |
|
117 |
|
118 /* |
|
119 * Client is panicked using this method. |
|
120 * @since 3.0 |
|
121 * @param aMessage clients message |
|
122 * @param aPanic panic reason |
|
123 */ |
|
124 void PanicClient( const RPEngMessage& aMessage, const TInt aPanic ) const; |
|
125 |
|
126 public: // Methods derived from CSession |
|
127 |
|
128 /** |
|
129 * Handles the servicing of client requests to the server. |
|
130 * @since 3.0 |
|
131 * @param aMessage is received message. |
|
132 */ |
|
133 void ServiceL( const RMessage2 &aMessage ); |
|
134 |
|
135 /** |
|
136 * Handles the servicing of the error case |
|
137 * @since 3.0 |
|
138 * @param aMessage is received message. |
|
139 * @param aError error |
|
140 */ |
|
141 void ServiceError( const RMessage2& aMessage, TInt aError ); |
|
142 |
|
143 private: // Data |
|
144 |
|
145 /// OWN: Admin container indx |
|
146 CObjectIx* iSubSessions; |
|
147 |
|
148 /// REF: Storage server |
|
149 MPEngStorageServer& iStorageServer; |
|
150 |
|
151 /// OWN: Is procesed message completed |
|
152 TBool iCompleteMessage; |
|
153 |
|
154 }; |
|
155 |
|
156 #endif // __CPENGSTORAGESESSION_H__ |