|
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 VUICCONTACTRESULTSSTATE_H |
|
20 #define VUICCONTACTRESULTSSTATE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "vuicstate.h" |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 |
|
27 class CNBestListDialog; |
|
28 class CDesC16ArrayFlat; |
|
29 class MNssTag; |
|
30 class CNssVASDBMgr; |
|
31 class MNssTagMgr; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 /** |
|
35 * COMMENT |
|
36 */ |
|
37 NONSHARABLE_CLASS( CContactResultsState ) : public CState |
|
38 { |
|
39 public: // Constructors and destructor |
|
40 |
|
41 /** |
|
42 * Symbian two-phased constructor. |
|
43 */ |
|
44 static CContactResultsState* NewL( CDataStorage& aDataStorage, CUiModel& aUiModel ); |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 virtual ~CContactResultsState(); |
|
50 |
|
51 public: // New functions |
|
52 |
|
53 /** |
|
54 * Handles received event |
|
55 * @param Event to be handled |
|
56 */ |
|
57 virtual void HandleEventL( TInt aEvent ); |
|
58 |
|
59 /** |
|
60 * Executes the state functionality |
|
61 */ |
|
62 virtual void ExecuteL(); |
|
63 |
|
64 protected: // New functions |
|
65 |
|
66 /** |
|
67 * C++ default constructor. |
|
68 */ |
|
69 CContactResultsState( CDataStorage& aDataStorage, CUiModel& aUiModel ); |
|
70 |
|
71 /** |
|
72 * Symbian OS 2nd phase constructor. |
|
73 */ |
|
74 virtual void ConstructL(); |
|
75 |
|
76 /** |
|
77 * Handles timed event |
|
78 */ |
|
79 void DoTimedEventL(); |
|
80 |
|
81 private: // Functions |
|
82 |
|
83 /** |
|
84 * Handles keypress event |
|
85 * @return ETrue if event was handled else EFalse |
|
86 */ |
|
87 TBool HandleKeypressL(); |
|
88 |
|
89 /** |
|
90 * Plays currently selected name from the n-best list with TTS |
|
91 */ |
|
92 void PlaySelectedNameL(); |
|
93 |
|
94 /** |
|
95 * Creates contact info array |
|
96 */ |
|
97 void CreateContactInfoArrayL(); |
|
98 |
|
99 /** |
|
100 * Compares given tag and currently selected tag names |
|
101 * @param aTag Tag that is used in comparison |
|
102 * @return ETrue if names match else EFalse |
|
103 */ |
|
104 TBool CompareContactNamesL( MNssTag* aTag ); |
|
105 |
|
106 /** |
|
107 * Checks if given tag exists in taglist |
|
108 * @param aTag Tag that is searched |
|
109 * @return ETrue if tag exists else EFalse |
|
110 */ |
|
111 TBool CheckIfAlreadyAdded( MNssTag* aTag ); |
|
112 |
|
113 /** |
|
114 * Creates new items array. Ownership is transferred to caller. |
|
115 * @return Items array |
|
116 */ |
|
117 CDesC16ArrayFlat* CreateItemsArrayL(); |
|
118 |
|
119 /** |
|
120 * Fills buffer with dial tag information |
|
121 * @param aTag Tag containing all needed information |
|
122 * @param aBuffer Buffer to be filled |
|
123 */ |
|
124 void FillDialContextBufferL( MNssTag* aTag, TDes& aBuffer ); |
|
125 |
|
126 /** |
|
127 * Gets the right icon for contact |
|
128 * @param aIconId The type of contacts icon |
|
129 * @return Icon type |
|
130 */ |
|
131 TPtrC GetContactIconType( TFieldType aIconId ); |
|
132 |
|
133 /** |
|
134 * Selects currently active tag from n-best list |
|
135 */ |
|
136 void SelectTag(); |
|
137 |
|
138 private: // Data |
|
139 |
|
140 enum TInternalState |
|
141 { |
|
142 ENotStarted, |
|
143 EStarted, |
|
144 EInitialized, |
|
145 ECompleted |
|
146 }; |
|
147 |
|
148 // N-best list dialog |
|
149 CNBestListDialog* iNBestListDialog; |
|
150 |
|
151 // Stores a keypress event from HandleEventL |
|
152 TInt iKeypress; |
|
153 |
|
154 // For handling internal state logics |
|
155 TInternalState iInternalState; |
|
156 |
|
157 // For storing copies of tag pointers |
|
158 CArrayPtrFlat<MNssTag>* iTagList; |
|
159 |
|
160 // Vas stuff for handling context operations |
|
161 CNssVASDBMgr* iNssVasDbManager; |
|
162 MNssTagMgr* iNssTagManager; |
|
163 }; |
|
164 |
|
165 #endif // VUICCONTACTRESULTSSTATE_H |
|
166 |
|
167 // End of File |