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