1 /* |
|
2 * Copyright (c) 2006-2007 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: Base class for voice ui states |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef VUICSTATE_H |
|
20 #define VUICSTATE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CDataStorage; |
|
27 class CUiModel; |
|
28 |
|
29 // CLASS DECLARATION |
|
30 /** |
|
31 * Abstract base class for different states |
|
32 * |
|
33 */ |
|
34 NONSHARABLE_CLASS( CState ) : public CBase |
|
35 { |
|
36 public: // Constructors and destructor |
|
37 |
|
38 /** |
|
39 * Destructor. |
|
40 */ |
|
41 virtual ~CState(); |
|
42 |
|
43 public: // New functions |
|
44 |
|
45 /** |
|
46 * Handles received event |
|
47 * @param Event to be handled |
|
48 */ |
|
49 virtual void HandleEventL( TInt aEvent ) = 0; |
|
50 |
|
51 /** |
|
52 * Executes the state functionality |
|
53 */ |
|
54 virtual void ExecuteL() = 0; |
|
55 |
|
56 protected: // New functions |
|
57 |
|
58 /** |
|
59 * C++ default constructor. |
|
60 */ |
|
61 CState( CDataStorage& aDataStorage, CUiModel& aUiModel ); |
|
62 |
|
63 /** |
|
64 * Symbian OS 2nd phase constructor. |
|
65 */ |
|
66 virtual void ConstructL(); |
|
67 |
|
68 /** |
|
69 * Returns the data storage |
|
70 * @return Reference to DataStorage |
|
71 */ |
|
72 CDataStorage& DataStorage() const; |
|
73 |
|
74 /** |
|
75 * Returns the ui model |
|
76 * @return Reference to UiModel |
|
77 */ |
|
78 CUiModel& UiModel() const; |
|
79 |
|
80 /** |
|
81 * Starts progress timer |
|
82 * @param aEventHandler Object which will handle timed event |
|
83 * @param aDelay Delay before first timed event |
|
84 * @param aInterval Interval between timed events |
|
85 */ |
|
86 void StartTimerL( CState& aEventHandler, TInt aDelay, TInt aInterval ); |
|
87 |
|
88 /** |
|
89 * Deletes progress timer |
|
90 */ |
|
91 void StopTimer(); |
|
92 |
|
93 /** |
|
94 * Callback for timed event |
|
95 * @param aObject Contains this pointer |
|
96 * @return KErrNone |
|
97 */ |
|
98 static TInt OnTimedEvent( TAny* aObject ); |
|
99 |
|
100 /** |
|
101 * Handles timed event |
|
102 */ |
|
103 virtual void DoTimedEventL(); |
|
104 |
|
105 /** |
|
106 * Brings the application to foreground |
|
107 */ |
|
108 void BringToForeground(); |
|
109 |
|
110 private: // Data |
|
111 |
|
112 // Data storage |
|
113 CDataStorage* iDataStorage; |
|
114 |
|
115 // Data model |
|
116 CUiModel* iUiModel; |
|
117 |
|
118 // Timer for timed events |
|
119 CPeriodic* iTimer; |
|
120 }; |
|
121 |
|
122 #endif // VUICSTATE_H |
|
123 |
|
124 // End of File |
|