|
1 /* |
|
2 * Copyright (c) 2009 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 #ifndef SEARCH_STATES_ONLINE_H |
|
18 #define SEARCH_STATES_ONLINE_H |
|
19 #include <qstate.h> |
|
20 #include "search_global.h" |
|
21 #include <hbicon.h> |
|
22 SEARCH_CLASS( SearchStateProviderTest) |
|
23 |
|
24 class HbDocumentLoader; |
|
25 class HbView; |
|
26 class HbSearchPanel; |
|
27 class HbMainWindow; |
|
28 class OnlineHandler; |
|
29 /** @ingroup group_searchonlinestate |
|
30 * @brief The state handles wizard activation and interaction. |
|
31 * |
|
32 * @see StateMachine |
|
33 * |
|
34 * @lib ?library |
|
35 * @since S60 ?S60_version |
|
36 */ |
|
37 class SearchOnlineState : public QState |
|
38 { |
|
39 Q_OBJECT |
|
40 public: |
|
41 |
|
42 public: |
|
43 |
|
44 /** |
|
45 * Constructor. |
|
46 * @since S60 ?S60_version. |
|
47 * @param aParent Owner. |
|
48 */ |
|
49 SearchOnlineState(QState *aParent = 0); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 * @since S60 ?S60_version. |
|
54 */ |
|
55 virtual ~SearchOnlineState(); |
|
56 |
|
57 protected: |
|
58 |
|
59 /** |
|
60 * @copydoc QState::onEntry() |
|
61 */ |
|
62 void onEntry(QEvent *event); |
|
63 |
|
64 /** |
|
65 * @copydoc QState::onExit() |
|
66 */ |
|
67 void onExit(QEvent *event); |
|
68 |
|
69 private: |
|
70 /** |
|
71 * deactivates the signals . |
|
72 * @since S60 ?S60_version. |
|
73 */ |
|
74 void deActivateSignals(); |
|
75 |
|
76 /** |
|
77 * activates the signals . |
|
78 * @since S60 ?S60_version. |
|
79 */ |
|
80 void activateSignals(); |
|
81 |
|
82 void createui(); |
|
83 public slots: |
|
84 |
|
85 /** |
|
86 * slot connects to search panel to initiate the online search |
|
87 * @since S60 ?S60_version. |
|
88 * @param aKeyword search keyword. |
|
89 */ |
|
90 void startOnlineSearch(const QString &aKeyword); |
|
91 |
|
92 /** |
|
93 * slot connects to search panel to launch the settings delimiter |
|
94 * @since S60 ?S60_version. |
|
95 */ |
|
96 void setSettings(); |
|
97 |
|
98 /** |
|
99 * slot connects to search panel to cancel the outstanding search |
|
100 * @since S60 ?S60_version. |
|
101 */ |
|
102 void cancelSearch(); |
|
103 |
|
104 /** |
|
105 * slot connects to online handler to get notified when plugin is intialized |
|
106 * @since S60 ?S60_version. |
|
107 */ |
|
108 void slotpluginIntialized(bool); |
|
109 |
|
110 /** |
|
111 * slot connects to online handler to get notified when plugin is shutdown |
|
112 * @since S60 ?S60_version. |
|
113 */ |
|
114 void slotpluginShutdown(bool); |
|
115 |
|
116 /** |
|
117 * slot connects to online handler to get notified when view changed |
|
118 * @since S60 ?S60_version. |
|
119 */ |
|
120 void slotbackEventTriggered(); |
|
121 |
|
122 /** |
|
123 * slot connects to progressive search state to get notified criteria in search panel |
|
124 * @since S60 ?S60_version. |
|
125 * @param aKeyword search keyword. |
|
126 */ |
|
127 void slotIndeviceQuery(QString); |
|
128 |
|
129 /** |
|
130 * slot connects to progressive search state to launch the suggestion links |
|
131 * @since S60 ?S60_version. |
|
132 * @param aKeyword search keyword. |
|
133 * @param id search provider id. |
|
134 */ |
|
135 void slotlaunchLink(int, QString); |
|
136 |
|
137 /** |
|
138 * slot connects to main window to get notify when view is ready |
|
139 * @since S60 ?S60_version. |
|
140 */ |
|
141 void slotviewReady(); |
|
142 |
|
143 signals: |
|
144 |
|
145 /** |
|
146 * Signalled when user selects an to switch the settings state |
|
147 * setting state will be activated. |
|
148 */ |
|
149 void switchOnlineToSettingsState(); |
|
150 |
|
151 /** |
|
152 * Signalled when user change the state to progressive state |
|
153 * setting state will be activated. |
|
154 */ |
|
155 void onlineSearchQuery(QString); |
|
156 |
|
157 private: |
|
158 HbMainWindow* mMainWindow; |
|
159 /** |
|
160 * main view. |
|
161 * Own. |
|
162 */ |
|
163 HbView* mView; |
|
164 |
|
165 /** |
|
166 * The searchpanel widget. |
|
167 * Own. |
|
168 */ |
|
169 HbSearchPanel* mSearchPanel; |
|
170 |
|
171 /** |
|
172 * HbDocumentLoader instance. |
|
173 */ |
|
174 HbDocumentLoader* mDocumentLoader; |
|
175 |
|
176 /** |
|
177 * OnlineHandler instance. |
|
178 */ |
|
179 OnlineHandler* mInternetHandler; |
|
180 |
|
181 /** |
|
182 * search keyword. |
|
183 */ |
|
184 QString mSearchQuery; |
|
185 bool mSearchReady; |
|
186 bool mIndeviceQueryAvailable; |
|
187 bool mIsUICreated; |
|
188 /** |
|
189 * friend class for unit testing |
|
190 */ |
|
191 SEARCH_FRIEND_CLASS (SearchStateProviderTest) |
|
192 }; |
|
193 |
|
194 #endif //SEARCH_STATES_ONLINE_H |