|
1 /* |
|
2 * Copyright (c) 2008 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 the License "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: HG VOD content search related ui implementation* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 #ifndef VCXHGVODSEARCHIMPL_H |
|
21 #define VCXHGVODSEARCHIMPL_H |
|
22 |
|
23 #include <AknProgressDialog.h> //Search progress |
|
24 #include "vcxnscontentsearchif.h" |
|
25 #include "vcxnscontentsearchobserver.h" |
|
26 |
|
27 class CVcxNsUiEngine; |
|
28 class CAknWaitDialog; |
|
29 class CVcxHgVodMainView; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 /** |
|
33 * Content search ui implementation. |
|
34 * This class handles search related functionality |
|
35 * in ui side. |
|
36 * For example search dialogs have been implemented here. |
|
37 * |
|
38 * @code |
|
39 * |
|
40 * @endcode |
|
41 * |
|
42 * @lib vcxhgvodui.lib |
|
43 * @since S60 v5.0 |
|
44 */ |
|
45 NONSHARABLE_CLASS( CVcxHgVodSearchImpl ) : public CBase, |
|
46 public MProgressDialogCallback, |
|
47 public MVcxNsContentSearchObserver |
|
48 { |
|
49 |
|
50 public: |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 * @param aDataProviderIf Reference to UI engine |
|
55 * @return Pointer to newly created instance |
|
56 */ |
|
57 static CVcxHgVodSearchImpl* NewL( |
|
58 CVcxNsUiEngine& aDataProviderIf, |
|
59 CVcxHgVodMainView& aView ); |
|
60 /** |
|
61 * Two-phased constructor. |
|
62 * @param aDataProviderIf Reference to UI engine |
|
63 * @return Pointer to newly created instance |
|
64 */ |
|
65 static CVcxHgVodSearchImpl* NewLC( |
|
66 CVcxNsUiEngine& aDataProviderIf, |
|
67 CVcxHgVodMainView& aView ); |
|
68 |
|
69 /** |
|
70 * Destructor. |
|
71 */ |
|
72 virtual ~CVcxHgVodSearchImpl(); |
|
73 |
|
74 void RegisterObserver(); |
|
75 |
|
76 void DeRegisterObserver(); |
|
77 |
|
78 public: |
|
79 |
|
80 /** |
|
81 * Show search query for user input. |
|
82 * |
|
83 * @param aShowPrevious If ETrue, stored old search query is copied |
|
84 * to search query and displayed on data query |
|
85 * field as a default value. |
|
86 * If EFalse, data query field is empty. |
|
87 */ |
|
88 void ShowSearchQueryL( TBool aShowPrevious ); |
|
89 |
|
90 /** |
|
91 * Display search wait note |
|
92 */ |
|
93 void DisplaySearchWaitNoteL(); |
|
94 |
|
95 /** |
|
96 * Close search wait note |
|
97 */ |
|
98 void CloseSearchWaitNote(); |
|
99 |
|
100 public: |
|
101 |
|
102 /** |
|
103 * From MProgressDialogCallback |
|
104 * Called when wait dialog is dismissed. |
|
105 * |
|
106 * @param aButtonId |
|
107 */ |
|
108 void DialogDismissedL( TInt aButtonId ); |
|
109 |
|
110 public: |
|
111 |
|
112 /** |
|
113 * From MVcxNsContentSearchObserver |
|
114 * Handle search result. |
|
115 * This informs that search has been finished. |
|
116 * |
|
117 * @param aSucceeded Informs the search result. |
|
118 * ETrue if search has been finished successfully. |
|
119 * EFalse if search has failed. |
|
120 */ |
|
121 void HandleSearchResultL( TBool aSucceeded ); |
|
122 |
|
123 /** |
|
124 * From MVcxNsContentSearchObserver |
|
125 * New search started. |
|
126 * This informs that search string has been sent to server and |
|
127 * search prosess has started. |
|
128 * |
|
129 */ |
|
130 void SearchStartedL(); |
|
131 |
|
132 /** |
|
133 * From MVcxNsContentSearchObserver |
|
134 * Start search. |
|
135 * This informs that search can be started. |
|
136 * @param aUseCurrentQuery |
|
137 * ETrue, if IAP has been selected for search |
|
138 * and search can be started again with current query. |
|
139 * EFalse if new search query can be started. |
|
140 * Note: EFalse is always used when search category is opened from |
|
141 * category view and there's no previous search results available. |
|
142 * |
|
143 */ |
|
144 void StartSearchL( TBool aUseCurrentQuery ); |
|
145 |
|
146 private: |
|
147 |
|
148 /** |
|
149 * Default constructor |
|
150 * @param aDataProviderIf Reference to ui engine interface |
|
151 * @param aView Reference to view |
|
152 */ |
|
153 CVcxHgVodSearchImpl( |
|
154 CVcxNsUiEngine& aDataProviderIf, |
|
155 CVcxHgVodMainView& aView ); |
|
156 |
|
157 /** |
|
158 * |
|
159 * @param aDataProviderIf |
|
160 */ |
|
161 void ConstructL( ); |
|
162 |
|
163 private: // data |
|
164 |
|
165 /** |
|
166 * Reference to ui engine interface |
|
167 */ |
|
168 CVcxNsUiEngine& iUiEngine; |
|
169 |
|
170 /** |
|
171 * Reference to view. |
|
172 */ |
|
173 CVcxHgVodMainView& iView; |
|
174 |
|
175 /** |
|
176 * Current search query. |
|
177 * Own. |
|
178 */ |
|
179 HBufC* iCurrentSearchQuery; |
|
180 |
|
181 /** |
|
182 * Wait note during video search |
|
183 */ |
|
184 CAknWaitDialog* iSearchWaitDialog; |
|
185 |
|
186 /** |
|
187 * Pointer to search interface in ui engine. |
|
188 * Not own. |
|
189 */ |
|
190 MVcxNsContentSearchIf* iSearchHandler; |
|
191 }; |
|
192 |
|
193 |
|
194 #endif // VCXHGVODSEARCHIMPL_H |