|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef VUICPLAYSTATE_H |
|
20 #define VUICPLAYSTATE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <AknsItemID.h> |
|
24 |
|
25 #include <cntdef.h> |
|
26 |
|
27 #include <nssttsutility.h> |
|
28 |
|
29 #include <vuivoicerecogdefs.h> |
|
30 |
|
31 #include "vuicstate.h" |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 class CGlobalProgressDialog; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 /** |
|
38 * COMMENT |
|
39 */ |
|
40 NONSHARABLE_CLASS( CPlayState ) : public CState |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Symbian two-phased constructor. |
|
46 */ |
|
47 static CPlayState* NewL( CDataStorage& aDataStorage, CUiModel& aUiModel ); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CPlayState(); |
|
53 |
|
54 public: // New functions |
|
55 |
|
56 /** |
|
57 * Handles received event |
|
58 * @param Event to be handled |
|
59 */ |
|
60 virtual void HandleEventL( TInt aEvent ); |
|
61 |
|
62 /** |
|
63 * Executes the state functionality |
|
64 */ |
|
65 virtual void ExecuteL(); |
|
66 |
|
67 protected: // New functions |
|
68 |
|
69 /** |
|
70 * C++ default constructor. |
|
71 */ |
|
72 CPlayState( CDataStorage& aDataStorage, CUiModel& aUiModel ); |
|
73 |
|
74 /** |
|
75 * Symbian OS 2nd phase constructor. |
|
76 */ |
|
77 virtual void ConstructL(); |
|
78 |
|
79 /** |
|
80 * Handles timed event |
|
81 */ |
|
82 void DoTimedEventL(); |
|
83 |
|
84 private: // Functions |
|
85 |
|
86 /** |
|
87 * Formats given name to fit one line |
|
88 * @param aName Name to be formatted |
|
89 */ |
|
90 void FormatName( TDes& aName ); |
|
91 |
|
92 /** |
|
93 * Plays voice tag |
|
94 */ |
|
95 void PlayVoiceTagL(); |
|
96 |
|
97 /** |
|
98 * Fetches and formats data that will be shown while playing |
|
99 * @param aName Name to be used |
|
100 * @param aPhoneNumber Phone number to be used |
|
101 * @param aFieldType Field type to be used |
|
102 */ |
|
103 void FormatDataL( TDes& aName, TDes& aPhoneNumber, TFieldType& aFieldType ); |
|
104 |
|
105 /** |
|
106 * Shows the play dialog |
|
107 * @param aName Name that will be shown |
|
108 * @param aPhoneNumber Phone number that will be shown |
|
109 * @param aFieldType Type of the shown field |
|
110 */ |
|
111 void ShowPlaydialogL( const TDesC& aName, const TDesC& aPhoneNumber, |
|
112 const TFieldType aFieldType ); |
|
113 |
|
114 /** |
|
115 * Determines icon information according to the given type |
|
116 * @param aType Type to be used |
|
117 * @param aIcon Selected icon |
|
118 * @param aIconMask Selected icon mask |
|
119 * @param aIconId Selected icon id |
|
120 */ |
|
121 void GetDialogIcon( const TFieldType& aType, TInt& aIcon, |
|
122 TInt& aIconMask, TAknsItemID& aIconId ); |
|
123 |
|
124 private: // Data |
|
125 |
|
126 enum TInternalState |
|
127 { |
|
128 ENotStarted, |
|
129 EStarted, |
|
130 EInitialized, |
|
131 ECompleted |
|
132 }; |
|
133 |
|
134 // Dialog |
|
135 CGlobalProgressDialog* iProgressDialog; |
|
136 |
|
137 // For handling internal state logics |
|
138 TInternalState iInternalState; |
|
139 |
|
140 // Used to count timer ticks |
|
141 TInt iTickCount; |
|
142 |
|
143 // Timer data model |
|
144 VTimerModel iTModel; |
|
145 |
|
146 // Playback length |
|
147 TInt iPlaybackDelay; |
|
148 }; |
|
149 |
|
150 #endif // VUICPLAYSTATE_H |
|
151 |
|
152 // End of File |