|
1 /* |
|
2 * Copyright (c) 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 #include "texttospeechappui.h" |
|
20 #include "texttospeechengine.h" |
|
21 #include "texttospeechsettingitemlistview.h" |
|
22 |
|
23 |
|
24 /** |
|
25 * Construct the CTextToSpeechAppUi instance |
|
26 */ |
|
27 CTextToSpeechAppUi::CTextToSpeechAppUi() |
|
28 { |
|
29 } |
|
30 |
|
31 /** |
|
32 * The appui's destructor removes the container from the control |
|
33 * stack and destroys it. |
|
34 */ |
|
35 CTextToSpeechAppUi::~CTextToSpeechAppUi() |
|
36 { |
|
37 delete iTextToSpeechEngine; |
|
38 } |
|
39 |
|
40 /** |
|
41 * Initialise container |
|
42 */ |
|
43 void CTextToSpeechAppUi::InitializeContainersL() |
|
44 { |
|
45 iTextToSpeechSettingItemListView = CTextToSpeechSettingItemListView::NewL(); |
|
46 AddViewL( iTextToSpeechSettingItemListView ); |
|
47 SetDefaultViewL( *iTextToSpeechSettingItemListView ); |
|
48 } |
|
49 |
|
50 /** |
|
51 * Handle a command for this appui (override) |
|
52 * @param aCommand command id to be handled |
|
53 */ |
|
54 void CTextToSpeechAppUi::HandleCommandL( TInt aCommand ) |
|
55 { |
|
56 TBool commandHandled( EFalse ); |
|
57 |
|
58 if ( !commandHandled ) |
|
59 { |
|
60 if ( aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit) |
|
61 { |
|
62 Exit(); |
|
63 } |
|
64 } |
|
65 } |
|
66 |
|
67 /** |
|
68 * Override of the HandleResourceChangeL virtual function |
|
69 */ |
|
70 void CTextToSpeechAppUi::HandleResourceChangeL( TInt aType ) |
|
71 { |
|
72 CAknViewAppUi::HandleResourceChangeL( aType ); |
|
73 } |
|
74 |
|
75 /** |
|
76 * Override of the HandleKeyEventL virtual function |
|
77 * @return EKeyWasConsumed if event was handled, EKeyWasNotConsumed if not |
|
78 * @param aKeyEvent |
|
79 * @param aType |
|
80 */ |
|
81 TKeyResponse CTextToSpeechAppUi::HandleKeyEventL( const TKeyEvent& /*aKeyEvent*/, |
|
82 TEventCode /*aType*/ ) |
|
83 { |
|
84 return EKeyWasNotConsumed; |
|
85 } |
|
86 |
|
87 /** |
|
88 * Override of the HandleViewDeactivation virtual function |
|
89 * |
|
90 * @param aViewIdToBeDeactivated |
|
91 * @param aNewlyActivatedViewId |
|
92 */ |
|
93 void CTextToSpeechAppUi::HandleViewDeactivation( const TVwsViewId& aViewIdToBeDeactivated, |
|
94 const TVwsViewId &aNewlyActivatedViewId ) |
|
95 { |
|
96 CAknViewAppUi::HandleViewDeactivation( aViewIdToBeDeactivated, |
|
97 aNewlyActivatedViewId ); |
|
98 } |
|
99 |
|
100 /** |
|
101 * Completes the second phase of Symbian object construction. |
|
102 */ |
|
103 void CTextToSpeechAppUi::ConstructL() |
|
104 { |
|
105 BaseConstructL( EAknEnableSkin | EAknEnableMSK ); |
|
106 |
|
107 InitializeContainersL(); |
|
108 |
|
109 iTextToSpeechEngine = CTextToSpeechEngine::NewL(); |
|
110 } |
|
111 |
|
112 /** |
|
113 * Returns pointer to application engine |
|
114 */ |
|
115 CTextToSpeechEngine* CTextToSpeechAppUi::AppEngine() |
|
116 { |
|
117 return iTextToSpeechEngine; |
|
118 } |
|
119 |
|
120 // Enf of file |