|
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 #ifndef CHARVESTERSERVER_H |
|
19 #define CHARVESTERSERVER_H |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include <e32base.h> |
|
23 #include "HarvesterServer.pan" |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CIndexingManager; |
|
27 |
|
28 // CLASS DECLARATION |
|
29 /** |
|
30 * CHarvesterServer |
|
31 */ |
|
32 class CHarvesterServer : public CServer2 |
|
33 { |
|
34 public : // Constructors and destructors |
|
35 |
|
36 /** |
|
37 * NewL. |
|
38 * Two-phased constructor. |
|
39 * @return Pointer to created CHarvesterServer object. |
|
40 */ |
|
41 static CHarvesterServer* NewL(); |
|
42 |
|
43 /** |
|
44 * NewLC. |
|
45 * Two-phased constructor. |
|
46 * @return Pointer to created CHarvesterServer object. |
|
47 */ |
|
48 static CHarvesterServer* NewLC(); |
|
49 |
|
50 /** |
|
51 * ~CHarvesterServer. |
|
52 * Destructor. |
|
53 */ |
|
54 virtual ~CHarvesterServer(); |
|
55 |
|
56 public: // New functions |
|
57 |
|
58 /** |
|
59 * ThreadFunction. |
|
60 * Main function for the server thread. |
|
61 * @return Error code. |
|
62 */ |
|
63 static void ThreadFunction(); |
|
64 |
|
65 /** |
|
66 * IndexingManager |
|
67 * @return Current instance of CIndexingManager |
|
68 */ |
|
69 CIndexingManager& IndexingManager() { return *iIndexingManager; } |
|
70 |
|
71 private: // Constructors and destructors |
|
72 |
|
73 /** |
|
74 * CHarvesterServer. |
|
75 * C++ default constructor. |
|
76 * @param aPriority priority for this thread. |
|
77 */ |
|
78 CHarvesterServer( TInt aPriority ); |
|
79 |
|
80 /** |
|
81 * ConstructL. |
|
82 * 2nd phase constructor. |
|
83 */ |
|
84 void ConstructL(); |
|
85 |
|
86 private: // New methods |
|
87 |
|
88 /** |
|
89 * PanicClient. |
|
90 * Panics the client. |
|
91 * @param aMessage The message channel to the client. |
|
92 * @param aReason The reason code for the panic. |
|
93 */ |
|
94 static void PanicClient( const RMessage2& aMessage, |
|
95 THarvesterServerPanic aReason ); |
|
96 |
|
97 /** |
|
98 * PanicServer. |
|
99 * Panics the server. |
|
100 * @param aPanic The panic code. |
|
101 */ |
|
102 static void PanicServer( THarvesterServerPanic aPanic ); |
|
103 |
|
104 /** |
|
105 * ThreadFunctionL. |
|
106 * Second stage startup for the server thread. |
|
107 */ |
|
108 static void ThreadFunctionL(); |
|
109 |
|
110 private: // Functions from base classes |
|
111 |
|
112 /** |
|
113 * From CServer, NewSessionL. |
|
114 * Creates a time server session. |
|
115 * @param aVersion The client version. |
|
116 * @param aMessage Message from client. |
|
117 * @return Pointer to new session. |
|
118 */ |
|
119 CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const; |
|
120 |
|
121 private: // Data |
|
122 |
|
123 /* |
|
124 * iGlue is Symbian wrapper for CPix OpenC search API. |
|
125 */ |
|
126 //CSearchGlue* iGlue; |
|
127 |
|
128 /** |
|
129 * iIndexingManager, the indexing manager object |
|
130 */ |
|
131 CIndexingManager* iIndexingManager; |
|
132 }; |
|
133 |
|
134 #endif // CHARVESTERSERVER_H |
|
135 |
|
136 // End of File |