|
1 /* |
|
2 * Copyright (c) 2010 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 #ifndef __CSEARCHSESSION_H__ |
|
20 #define __CSEARCHSESSION_H__ |
|
21 |
|
22 // INCLUDE FILES |
|
23 #include <e32base.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CSearchServerSubSession; |
|
27 class CSearchServer; |
|
28 |
|
29 // CLASS DECLARATION |
|
30 /** |
|
31 * CSearchServerSession. |
|
32 * An instance of class CSearchServerSession is created for each client. |
|
33 */ |
|
34 class CSearchServerSession : public CSession2 |
|
35 { |
|
36 public: // Constructors and destructors |
|
37 |
|
38 /** |
|
39 * NewL. |
|
40 * Two-phased constructor. |
|
41 * @return Pointer to created CSearchServerSession object. |
|
42 */ |
|
43 static CSearchServerSession* NewL(); |
|
44 |
|
45 /** |
|
46 * NewLC. |
|
47 * Two-phased constructor. |
|
48 * @return Pointer to created CSearchServerSession object. |
|
49 */ |
|
50 static CSearchServerSession* NewLC(); |
|
51 |
|
52 /** |
|
53 * ~CSearchServerSession. |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CSearchServerSession(); |
|
57 |
|
58 public: // Functions from base classes |
|
59 |
|
60 |
|
61 /** |
|
62 * From CSession, ServiceL. |
|
63 * Service request from client. |
|
64 * @param aMessage Message from client |
|
65 * (containing requested operation and any data). |
|
66 */ |
|
67 void ServiceL(const RMessage2& aMessage); |
|
68 |
|
69 /** |
|
70 * CreateL() |
|
71 * Called by client/server framework after |
|
72 * session has been successfully created |
|
73 */ |
|
74 void CreateL(); |
|
75 |
|
76 /** |
|
77 * NewSubSessionL(); |
|
78 * Creates new subsession |
|
79 */ |
|
80 void NewSubSessionL(const RMessage2& aMessage); |
|
81 |
|
82 /** |
|
83 * CloseSession(); |
|
84 * Closes the session |
|
85 */ |
|
86 void CloseSession(const RMessage2& aMessage); |
|
87 |
|
88 /** |
|
89 * NewSubSessionL(); |
|
90 * Delete the subsession object through its handle. |
|
91 */ |
|
92 void DeleteCounter(TInt aHandle); |
|
93 |
|
94 /** |
|
95 * SubSessionFromHandle(); |
|
96 * Utility to return the CSearchServerSubSession (subsession) object |
|
97 */ |
|
98 CSearchServerSubSession* SubSessionFromHandle(const RMessage2& aMessage,TInt aHandle); |
|
99 |
|
100 /** |
|
101 * Stop housekeeping |
|
102 */ |
|
103 void StopHouseKeeping(const RMessage2& aMessage); |
|
104 |
|
105 /** |
|
106 * Continue housekeeping |
|
107 */ |
|
108 void ContinueHouseKeeping(const RMessage2& aMessage); |
|
109 |
|
110 /** |
|
111 * Force housekeeping |
|
112 */ |
|
113 void ForceHouseKeeping(const RMessage2& aMessage); |
|
114 |
|
115 private: // Constructors and destructors |
|
116 |
|
117 |
|
118 /** |
|
119 * CSearchServerSession. |
|
120 * C++ default constructor. |
|
121 * @param aServer The server. |
|
122 */ |
|
123 CSearchServerSession(); |
|
124 |
|
125 /** |
|
126 * ConstructL. |
|
127 * 2nd phase constructor. |
|
128 */ |
|
129 void ConstructL(); |
|
130 |
|
131 /** |
|
132 * DefineVolumeL. |
|
133 * Define a specific volume identified by aQualifiedBaseAppClass |
|
134 * @param aMessage contains parameter containing qualified base AppClass to be |
|
135 * defined. |
|
136 */ |
|
137 void DefineVolumeL(const RMessage2& aMessage); |
|
138 |
|
139 void DefineVolumeL(const TDesC& aQualifiedBaseAppClass, |
|
140 const TDesC& aIndexDbPath); |
|
141 |
|
142 /** |
|
143 * UnDefineVolumeL. |
|
144 * Undefine a specific volume identified by aQualifiedBaseAppClass |
|
145 * @param aMessage contains parameter containing qualified base AppClass to be |
|
146 * undefined. |
|
147 */ |
|
148 void UnDefineVolumeL(const RMessage2& aMessage); |
|
149 |
|
150 void UnDefineVolumeL(const TDesC& aBaseAppClass); |
|
151 |
|
152 public: |
|
153 |
|
154 /** |
|
155 * PanicClient. |
|
156 * Causes the client thread to panic. |
|
157 * @param aMessage Message from client. |
|
158 * @param aPanic Panic code. |
|
159 */ |
|
160 void PanicClient(const RMessage2& aMessage, TInt aPanic) const; |
|
161 |
|
162 private: // Data |
|
163 |
|
164 // Subsession members |
|
165 CObjectCon *iContainer; |
|
166 CObjectIx* iCountersObjectIndex; |
|
167 TInt iResourceCount; |
|
168 }; |
|
169 |
|
170 #endif // __CSEARCHSESSION_H__ |
|
171 |
|
172 // End of File |