1 /* |
|
2 * Copyright (c) 2006 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: Handles tutorial mode resources and dialog showing |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef VUICTUTORIAL_H |
|
20 #define VUICTUTORIAL_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "vuictutorialmessagedialog.h" |
|
24 |
|
25 |
|
26 // CLASS DECLARATION |
|
27 /** |
|
28 * Handles tutorial mode resources and dialog showing |
|
29 */ |
|
30 NONSHARABLE_CLASS( CTutorial ) : public CBase |
|
31 { |
|
32 public: // Constructors and destructor |
|
33 |
|
34 /** |
|
35 * Symbian two-phased constructor. |
|
36 */ |
|
37 static CTutorial* NewL(); |
|
38 |
|
39 /** |
|
40 * Destructor. |
|
41 */ |
|
42 virtual ~CTutorial(); |
|
43 |
|
44 public: // Enumerations |
|
45 |
|
46 enum TTutorialState |
|
47 { |
|
48 EIntroState, |
|
49 ECommandState, |
|
50 EDialState, |
|
51 EOtherState, |
|
52 ETryState, |
|
53 EBestState, |
|
54 EActivationState, |
|
55 EErrorState, |
|
56 EFinishedState |
|
57 }; |
|
58 |
|
59 public: // New functions |
|
60 |
|
61 /** |
|
62 * Creates a message dialog |
|
63 */ |
|
64 void CreateMessageL(); |
|
65 |
|
66 /** |
|
67 * Creates and shows a message dialog |
|
68 * @return Keycode of the pressed key |
|
69 */ |
|
70 TInt CreateAndShowMessageL(); |
|
71 |
|
72 /** |
|
73 * Shows a message dialog |
|
74 * @param aDeviceLockMode ETrue to set tutorial in device lock mode |
|
75 * @return Keycode of the pressed key |
|
76 */ |
|
77 TInt ShowMessageL( TBool aDeviceLockMode = EFalse ); |
|
78 |
|
79 /** |
|
80 * Destroys created message dialog |
|
81 */ |
|
82 void DestroyMessage(); |
|
83 |
|
84 /** |
|
85 * Returns the current state of the tutorial |
|
86 * @return One of the TTutorialState types |
|
87 */ |
|
88 TTutorialState GetTutorialState(); |
|
89 |
|
90 /** |
|
91 * Sets the next shown message to be an error message |
|
92 */ |
|
93 void ErrorState(); |
|
94 |
|
95 private: |
|
96 |
|
97 /** |
|
98 * Check's if the tutorial mode is enabled |
|
99 * @return ETrue if tutorial mode is enabled else EFalse |
|
100 */ |
|
101 TBool IsTutorialModeEnabled(); |
|
102 |
|
103 /** |
|
104 * Sets the first time mode off |
|
105 */ |
|
106 void DisableFirstTimeMode(); |
|
107 |
|
108 /** |
|
109 * C++ default constructor. |
|
110 */ |
|
111 CTutorial(); |
|
112 |
|
113 /** |
|
114 * Symbian OS 2nd phase constructor. |
|
115 */ |
|
116 void ConstructL(); |
|
117 |
|
118 /** |
|
119 * Loads tutorial and first time mode settings from CenRep |
|
120 */ |
|
121 void LoadSettingsL(); |
|
122 |
|
123 /** |
|
124 * Saves tutorial and first time mode settings to CenRep |
|
125 */ |
|
126 void SaveSettingsL(); |
|
127 |
|
128 private: // Data |
|
129 |
|
130 // Actual tutorial mode |
|
131 TBool iTutorialMode; |
|
132 |
|
133 // First time tutorial mode |
|
134 TBool iFirstTimeMode; |
|
135 |
|
136 // For handling internal logics |
|
137 TTutorialState iState; |
|
138 |
|
139 // Message dialog |
|
140 CTutorialMessageDialog* iDlg; |
|
141 }; |
|
142 |
|
143 #endif // VUICTUTORIAL_H |
|
144 |
|
145 // End of File |
|