|
1 /* |
|
2 * Copyright (c) 2008 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 for CClkUiModelBase class. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CLKUIMDL_BASE_H__ |
|
19 #define __CLKUIMDL_BASE_H__ |
|
20 |
|
21 // System includes |
|
22 #include <e32base.h> |
|
23 #include <e32def.h> |
|
24 |
|
25 // Forward declarations |
|
26 class CClkUiMdlListenerBase; |
|
27 class MClkModelObserver; |
|
28 |
|
29 // Class declaration |
|
30 /** |
|
31 * @class CClkUiModelBase |
|
32 * @brief The Base class for all the model classes (alarm and clockserver). |
|
33 * @dll clkuimodel.dll |
|
34 */ |
|
35 class CClkUiModelBase : public CBase |
|
36 { |
|
37 public: // Constructor and destructor |
|
38 |
|
39 /** |
|
40 * @brief C++ default constructor |
|
41 */ |
|
42 IMPORT_C CClkUiModelBase(); |
|
43 |
|
44 /** |
|
45 * @brief Destructor |
|
46 */ |
|
47 IMPORT_C virtual ~CClkUiModelBase(); |
|
48 |
|
49 public: // New functions |
|
50 |
|
51 /** |
|
52 * @brief Starts the listener. |
|
53 */ |
|
54 IMPORT_C void Start(); |
|
55 |
|
56 /** |
|
57 * @brief Stops the listener. |
|
58 */ |
|
59 IMPORT_C void Stop(); |
|
60 |
|
61 /** |
|
62 * @brief Registers the observer for notification. |
|
63 * @param aObserver of type MClkUiModelObserver. |
|
64 */ |
|
65 IMPORT_C void SetModelObserver( MClkModelObserver* aObserver ); |
|
66 |
|
67 /** |
|
68 * @brief Interpret listener status. |
|
69 * @param aStatus of type TInt. |
|
70 */ |
|
71 virtual void ProcessListenerL( TInt aStatus ) = 0; |
|
72 |
|
73 protected: // New functions |
|
74 |
|
75 /** |
|
76 * @brief Funnel for all calls to the notifier. |
|
77 * @param aReason The cause for the notification. |
|
78 */ |
|
79 IMPORT_C void NotifyL( TInt aReason ); |
|
80 |
|
81 /** |
|
82 * @brief Set the engine's listener as active. |
|
83 * @param aListern That has to be made active. |
|
84 */ |
|
85 IMPORT_C void SetListenerActive( CClkUiMdlListenerBase* aListener ); |
|
86 |
|
87 private: // New functions |
|
88 |
|
89 /** |
|
90 * @brief A single function that actually calls the view's notify. |
|
91 * @param aReason The cause for the notification. |
|
92 */ |
|
93 void DoObserverNotifyL( TInt aReason ); |
|
94 |
|
95 private: // Data |
|
96 |
|
97 /** |
|
98 * @var iListener |
|
99 * @brief Pointer to the listener object. |
|
100 */ |
|
101 CClkUiMdlListenerBase* iListener; |
|
102 |
|
103 /** |
|
104 * @var iObserver |
|
105 * @brief The model observer. |
|
106 */ |
|
107 MClkModelObserver* iObserver; |
|
108 |
|
109 /** |
|
110 * @var iNotifying |
|
111 * @brief Will be ETrue if the Observer is being notified. |
|
112 */ |
|
113 TBool iNotifying; |
|
114 |
|
115 }; |
|
116 |
|
117 #endif // __CLKUIMDL_BASE_H__ |
|
118 |
|
119 // End of file |