searchui/stateproviders/searchstateprovider/inc/searchonlinestate.h
author hgs
Mon, 26 Jul 2010 12:45:04 +0530
changeset 15 df6898e696c6
parent 13 0a2ec6860a93
permissions -rw-r--r--
201029
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
 * All rights reserved.
hgs
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
 *
hgs
parents:
diff changeset
     9
 * Initial Contributors:
hgs
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
 *
hgs
parents:
diff changeset
    12
 * Contributors:
hgs
parents:
diff changeset
    13
 *
hgs
parents:
diff changeset
    14
 * Description:  
hgs
parents:
diff changeset
    15
 *
hgs
parents:
diff changeset
    16
 */
hgs
parents:
diff changeset
    17
#ifndef SEARCH_STATES_ONLINE_H
hgs
parents:
diff changeset
    18
#define SEARCH_STATES_ONLINE_H
hgs
parents:
diff changeset
    19
#include <qstate.h>
hgs
parents:
diff changeset
    20
#include "search_global.h"
hgs
parents:
diff changeset
    21
#include <hbicon.h>
hgs
parents:
diff changeset
    22
SEARCH_CLASS( SearchStateProviderTest)
hgs
parents:
diff changeset
    23
15
hgs
parents: 13
diff changeset
    24
class HbListWidget;
9
hgs
parents:
diff changeset
    25
class HbView;
hgs
parents:
diff changeset
    26
class HbSearchPanel;
hgs
parents:
diff changeset
    27
class HbMainWindow;
hgs
parents:
diff changeset
    28
class OnlineHandler;
15
hgs
parents: 13
diff changeset
    29
class SearchUiLoader;
hgs
parents: 13
diff changeset
    30
9
hgs
parents:
diff changeset
    31
/** @ingroup group_searchonlinestate
hgs
parents:
diff changeset
    32
 * @brief The state handles wizard activation and interaction.
hgs
parents:
diff changeset
    33
 *
hgs
parents:
diff changeset
    34
 * @see StateMachine
hgs
parents:
diff changeset
    35
 *
hgs
parents:
diff changeset
    36
 * @lib ?library
hgs
parents:
diff changeset
    37
 * @since S60 ?S60_version
hgs
parents:
diff changeset
    38
 */
hgs
parents:
diff changeset
    39
class SearchOnlineState : public QState
hgs
parents:
diff changeset
    40
    {
hgs
parents:
diff changeset
    41
Q_OBJECT
hgs
parents:
diff changeset
    42
public:
hgs
parents:
diff changeset
    43
hgs
parents:
diff changeset
    44
public:
hgs
parents:
diff changeset
    45
hgs
parents:
diff changeset
    46
    /**
hgs
parents:
diff changeset
    47
     * Constructor.
hgs
parents:
diff changeset
    48
     * @since S60 ?S60_version.     
hgs
parents:
diff changeset
    49
     * @param aParent Owner.
hgs
parents:
diff changeset
    50
     */
hgs
parents:
diff changeset
    51
    SearchOnlineState(QState *aParent = 0);
hgs
parents:
diff changeset
    52
hgs
parents:
diff changeset
    53
    /**
hgs
parents:
diff changeset
    54
     * Destructor.
hgs
parents:
diff changeset
    55
     * @since S60 ?S60_version.
hgs
parents:
diff changeset
    56
     */
hgs
parents:
diff changeset
    57
    virtual ~SearchOnlineState();
hgs
parents:
diff changeset
    58
hgs
parents:
diff changeset
    59
protected:
hgs
parents:
diff changeset
    60
hgs
parents:
diff changeset
    61
    /**
hgs
parents:
diff changeset
    62
     * @copydoc QState::onEntry()
hgs
parents:
diff changeset
    63
     */
hgs
parents:
diff changeset
    64
    void onEntry(QEvent *event);
hgs
parents:
diff changeset
    65
hgs
parents:
diff changeset
    66
    /**
hgs
parents:
diff changeset
    67
     * @copydoc QState::onExit()
hgs
parents:
diff changeset
    68
     */
hgs
parents:
diff changeset
    69
    void onExit(QEvent *event);
hgs
parents:
diff changeset
    70
hgs
parents:
diff changeset
    71
private:
hgs
parents:
diff changeset
    72
    /**
hgs
parents:
diff changeset
    73
     * deactivates the signals .
hgs
parents:
diff changeset
    74
     * @since S60 ?S60_version.
hgs
parents:
diff changeset
    75
     */
hgs
parents:
diff changeset
    76
    void deActivateSignals();
hgs
parents:
diff changeset
    77
hgs
parents:
diff changeset
    78
    /**
hgs
parents:
diff changeset
    79
     * activates the signals .
hgs
parents:
diff changeset
    80
     * @since S60 ?S60_version.
hgs
parents:
diff changeset
    81
     */
hgs
parents:
diff changeset
    82
    void activateSignals();
15
hgs
parents: 13
diff changeset
    83
9
hgs
parents:
diff changeset
    84
public slots:
hgs
parents:
diff changeset
    85
hgs
parents:
diff changeset
    86
    /**
hgs
parents:
diff changeset
    87
     * slot connects to search panel to initiate the online search
hgs
parents:
diff changeset
    88
     * @since S60 ?S60_version.
hgs
parents:
diff changeset
    89
     * @param aKeyword search keyword.
hgs
parents:
diff changeset
    90
     */
hgs
parents:
diff changeset
    91
    void startOnlineSearch(const QString &aKeyword);
hgs
parents:
diff changeset
    92
hgs
parents:
diff changeset
    93
    /**
hgs
parents:
diff changeset
    94
     * slot connects to search panel to launch the settings delimiter
hgs
parents:
diff changeset
    95
     * @since S60 ?S60_version.     
hgs
parents:
diff changeset
    96
     */
hgs
parents:
diff changeset
    97
    void setSettings();
hgs
parents:
diff changeset
    98
hgs
parents:
diff changeset
    99
    /**
hgs
parents:
diff changeset
   100
     * slot connects to search panel to cancel the outstanding search
hgs
parents:
diff changeset
   101
     * @since S60 ?S60_version.     
hgs
parents:
diff changeset
   102
     */
hgs
parents:
diff changeset
   103
    void cancelSearch();
hgs
parents:
diff changeset
   104
hgs
parents:
diff changeset
   105
    /**
hgs
parents:
diff changeset
   106
     * slot connects to online handler to get notified when plugin is intialized 
hgs
parents:
diff changeset
   107
     * @since S60 ?S60_version.     
hgs
parents:
diff changeset
   108
     */
hgs
parents:
diff changeset
   109
    void slotpluginIntialized(bool);
hgs
parents:
diff changeset
   110
hgs
parents:
diff changeset
   111
    /**
hgs
parents:
diff changeset
   112
     * slot connects to online handler to get notified when plugin is shutdown 
hgs
parents:
diff changeset
   113
     * @since S60 ?S60_version.     
hgs
parents:
diff changeset
   114
     */
hgs
parents:
diff changeset
   115
    void slotpluginShutdown(bool);
hgs
parents:
diff changeset
   116
hgs
parents:
diff changeset
   117
    /**
hgs
parents:
diff changeset
   118
     * slot connects to online handler to get notified when view changed  
hgs
parents:
diff changeset
   119
     * @since S60 ?S60_version.     
hgs
parents:
diff changeset
   120
     */
hgs
parents:
diff changeset
   121
    void slotbackEventTriggered();
hgs
parents:
diff changeset
   122
hgs
parents:
diff changeset
   123
    /**
hgs
parents:
diff changeset
   124
     * slot connects to progressive search state to get notified criteria in search panel  
hgs
parents:
diff changeset
   125
     * @since S60 ?S60_version.
hgs
parents:
diff changeset
   126
     * @param aKeyword search keyword.     
hgs
parents:
diff changeset
   127
     */
hgs
parents:
diff changeset
   128
    void slotIndeviceQuery(QString);
hgs
parents:
diff changeset
   129
hgs
parents:
diff changeset
   130
    /**
hgs
parents:
diff changeset
   131
     * slot connects to progressive search state to launch the suggestion links  
hgs
parents:
diff changeset
   132
     * @since S60 ?S60_version.
hgs
parents:
diff changeset
   133
     * @param aKeyword search keyword.
hgs
parents:
diff changeset
   134
     * @param id search provider id.     
hgs
parents:
diff changeset
   135
     */
hgs
parents:
diff changeset
   136
    void slotlaunchLink(int, QString);
hgs
parents:
diff changeset
   137
hgs
parents:
diff changeset
   138
    /**
hgs
parents:
diff changeset
   139
     * slot connects to main window to get notify when view is ready  
hgs
parents:
diff changeset
   140
     * @since S60 ?S60_version.     
hgs
parents:
diff changeset
   141
     */
hgs
parents:
diff changeset
   142
    void slotviewReady();
hgs
parents:
diff changeset
   143
hgs
parents:
diff changeset
   144
signals:
hgs
parents:
diff changeset
   145
hgs
parents:
diff changeset
   146
    /**
hgs
parents:
diff changeset
   147
     * Signalled when user selects an to switch the settings state
hgs
parents:
diff changeset
   148
     * setting state will be  activated.
hgs
parents:
diff changeset
   149
     */
hgs
parents:
diff changeset
   150
    void switchOnlineToSettingsState();
hgs
parents:
diff changeset
   151
hgs
parents:
diff changeset
   152
    /**
hgs
parents:
diff changeset
   153
     * Signalled when user change the state to progressive state
hgs
parents:
diff changeset
   154
     * setting state will be  activated.
hgs
parents:
diff changeset
   155
     */
hgs
parents:
diff changeset
   156
    void onlineSearchQuery(QString);
hgs
parents:
diff changeset
   157
13
hgs
parents: 9
diff changeset
   158
    /**
hgs
parents: 9
diff changeset
   159
     * Signalled when UI is ready on online state        
hgs
parents: 9
diff changeset
   160
     */
hgs
parents: 9
diff changeset
   161
    void applicationReady();
hgs
parents: 9
diff changeset
   162
9
hgs
parents:
diff changeset
   163
private:
hgs
parents:
diff changeset
   164
    HbMainWindow* mMainWindow;
hgs
parents:
diff changeset
   165
    /**
hgs
parents:
diff changeset
   166
     * main view.
hgs
parents:
diff changeset
   167
     * Own.
hgs
parents:
diff changeset
   168
     */
hgs
parents:
diff changeset
   169
    HbView* mView;
hgs
parents:
diff changeset
   170
hgs
parents:
diff changeset
   171
    /**
hgs
parents:
diff changeset
   172
     * The searchpanel widget.
hgs
parents:
diff changeset
   173
     * Own.
hgs
parents:
diff changeset
   174
     */
hgs
parents:
diff changeset
   175
    HbSearchPanel* mSearchPanel;
hgs
parents:
diff changeset
   176
hgs
parents:
diff changeset
   177
    /**
15
hgs
parents: 13
diff changeset
   178
     * The List View widget.    
9
hgs
parents:
diff changeset
   179
     */
15
hgs
parents: 13
diff changeset
   180
    HbListWidget* mListView;
9
hgs
parents:
diff changeset
   181
hgs
parents:
diff changeset
   182
    /**
hgs
parents:
diff changeset
   183
     * OnlineHandler instance.
hgs
parents:
diff changeset
   184
     */
hgs
parents:
diff changeset
   185
    OnlineHandler* mInternetHandler;
hgs
parents:
diff changeset
   186
15
hgs
parents: 13
diff changeset
   187
    SearchUiLoader* mUiLoader;
hgs
parents: 13
diff changeset
   188
9
hgs
parents:
diff changeset
   189
    /**
hgs
parents:
diff changeset
   190
     * search keyword.
hgs
parents:
diff changeset
   191
     */
hgs
parents:
diff changeset
   192
    QString mSearchQuery;
hgs
parents:
diff changeset
   193
    bool mSearchReady;
hgs
parents:
diff changeset
   194
    bool mIndeviceQueryAvailable;
15
hgs
parents: 13
diff changeset
   195
   
9
hgs
parents:
diff changeset
   196
    /**
hgs
parents:
diff changeset
   197
     * friend class for unit testing
hgs
parents:
diff changeset
   198
     */
hgs
parents:
diff changeset
   199
    SEARCH_FRIEND_CLASS (SearchStateProviderTest)
hgs
parents:
diff changeset
   200
    };
hgs
parents:
diff changeset
   201
hgs
parents:
diff changeset
   202
#endif //SEARCH_STATES_ONLINE_H