|
1 /* |
|
2 * Copyright (c) 2009 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: The header file of the CClkSrvMain class. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CLOCKSERVER_H__ |
|
19 #define __CLOCKSERVER_H__ |
|
20 |
|
21 // System includes |
|
22 #include <e32base.h> |
|
23 |
|
24 // User includes |
|
25 #include "clocktimesourceinterface.hrh" |
|
26 |
|
27 // Forward declarations |
|
28 class CClkSrvSession; |
|
29 class CClkSrvImpl; |
|
30 |
|
31 // Class declaration |
|
32 /** |
|
33 * @class CClkSrvMain |
|
34 * @brief ClockServer server side module. |
|
35 */ |
|
36 class CClkSrvMain : public CServer2 |
|
37 { |
|
38 public: // New functions |
|
39 |
|
40 /** |
|
41 * @brief Two phased constructor |
|
42 * @return CClkSrvMain* Pointer to an object of CClkSrvMain |
|
43 */ |
|
44 static CClkSrvMain* NewL(); |
|
45 |
|
46 /** |
|
47 * @brief The destructor |
|
48 */ |
|
49 ~CClkSrvMain(); |
|
50 |
|
51 public: // New functions |
|
52 |
|
53 /** |
|
54 * @brief Returns a reference to iSessionQue. |
|
55 * @return TDblQue<CClkNitzSession>& |
|
56 */ |
|
57 TDblQue< CClkSrvSession >& SessionQue(); |
|
58 |
|
59 /** |
|
60 * @brief Asks the session to notify the client about change in data. |
|
61 * @param aWhatChanged This indicates what was changed. |
|
62 * @param aWhoChanged The entity which caused the change. Will usually be the plug-in id. |
|
63 * @param aNotification KErrNone if there was no error. |
|
64 */ |
|
65 void NotifyAboutChange( TChangedComponent aWhatChanged, TInt aWhoChanged, TInt aNotification ); |
|
66 |
|
67 /** |
|
68 * @brief Returns the id of the currently loaded plugin. |
|
69 * @param aPluginId This will be filled with the id of the active plugin read from cenrep. |
|
70 * @return TInt An error code. |
|
71 */ |
|
72 TInt GetActivePluginL( TInt& aPluginId ) const; |
|
73 |
|
74 /** |
|
75 * @brief Updates the id of the currently loaded plugin. |
|
76 * @param aPluginId The id of the plugin with which the cenrep should be updated. |
|
77 * @return TInt An error code. |
|
78 */ |
|
79 TInt SetActivePluginL( TInt aPluginId ); |
|
80 |
|
81 public: // From base classes |
|
82 |
|
83 /** |
|
84 * @brief From CServer2, returns a new session for communication. |
|
85 * @param aVersion The version object having the version info of the server |
|
86 * @param aMessage of type RMessage |
|
87 * @return CSession2* a Pointer to a CSession2 object. |
|
88 */ |
|
89 CSession2* NewSessionL( const TVersion& aVersion, const RMessage2& aMessage ) const; |
|
90 |
|
91 private: // New functions |
|
92 |
|
93 /** |
|
94 * @brief Performs the second phase of construction |
|
95 */ |
|
96 void ConstructL(); |
|
97 |
|
98 /** |
|
99 * @brief The C++ default constructor |
|
100 */ |
|
101 CClkSrvMain( TInt aPriority ); |
|
102 |
|
103 /** |
|
104 * @brief Performs the restoration operations like activating plugins that were previously activated and so on. |
|
105 */ |
|
106 void RestoreStateL(); |
|
107 |
|
108 private: // Data |
|
109 |
|
110 /** |
|
111 * @var iSessionQue |
|
112 * @brief Is a doubly linked list of type CClkSrvSession |
|
113 */ |
|
114 TDblQue< CClkSrvSession > iSessionQue; |
|
115 |
|
116 /** |
|
117 * @var iClkSrvImpl |
|
118 * @brief Is a pointer to an object of CClkSrvImpl. Only one instance, used by all the sessions. |
|
119 */ |
|
120 CClkSrvImpl* iClkSrvImpl; |
|
121 }; |
|
122 |
|
123 #endif // __CLOCKSERVER_H__ |
|
124 |
|
125 // End of file |