searchui/onlinehandler/inc/onlinehandler.h
changeset 12 993ab30e92fc
equal deleted inserted replaced
11:773be20e0a25 12:993ab30e92fc
       
     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:  Onlinehandler.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef ONLINEHANDLER_H
       
    19 #define ONLINEHANDLER_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <QVector>
       
    23 #include <QDir>
       
    24 #include <hbicon.h>
       
    25 #include "search_global.h"
       
    26 class HbMainWindow;
       
    27 class HbView;
       
    28 class OnlineSearchPlugin;
       
    29 class IsEngine;
       
    30 class ServiceProvider;
       
    31 class HbIcon;
       
    32 
       
    33 #ifdef SEARCHONLINEHANDLER_LIB
       
    34 #define ONLINEHANDLER_EXPORT Q_DECL_EXPORT
       
    35 #else
       
    36 #define ONLINEHANDLER_EXPORT Q_DECL_IMPORT
       
    37 #endif
       
    38 
       
    39 SEARCH_CLASS(SearchOnlineHandlerTest)
       
    40 /**
       
    41  * @ingroup group_OnlineHandler
       
    42  * @brief Loads and connects onlinesearchprovider plugins
       
    43  *
       
    44  * This service is responsible for loading onlinesearchprovider plugins.
       
    45  *
       
    46  * @since S60 ?S60_version.
       
    47  */
       
    48 class ONLINEHANDLER_EXPORT OnlineHandler : public QObject
       
    49     {
       
    50 Q_OBJECT
       
    51 
       
    52 public:
       
    53     /**
       
    54      * Default constructor.
       
    55      *
       
    56      * @since S60 ?S60_version.
       
    57      */
       
    58     OnlineHandler(QObject* = 0);
       
    59 
       
    60     /**
       
    61      * Destructor.
       
    62      *
       
    63      * @since S60 ?S60_version.
       
    64      */
       
    65     virtual ~OnlineHandler();
       
    66     void setDefaultProvider(const int);
       
    67 
       
    68     void isProvidersAvailable();
       
    69     void initializePlugin();    
       
    70     bool activatePlugin();
       
    71     bool activatePlugin(const QString &str);
       
    72 
       
    73     void readSettings();
       
    74     void writeSettings(const int);
       
    75     
       
    76     void loadISPlugin(int id, QString query);
       
    77 
       
    78     void unloadPlugin();
       
    79     void unloadPluginandExit();
       
    80 public slots:
       
    81     void isPluginIntialized(bool);
       
    82     void isShutdownCompleted(bool);
       
    83     void backEvent();
       
    84 
       
    85 signals:
       
    86     void providerDetails(QString, HbIcon, int);
       
    87     void defaultProvider(const int);
       
    88     void pluginIntialized(bool);
       
    89     void pluginShutdown(bool);
       
    90     void backEventTriggered();
       
    91 private:
       
    92     OnlineSearchPlugin *loadSearchPlugin(const QString &pluginFile);
       
    93 
       
    94 private:
       
    95     QString mDefaultPluginName;
       
    96     OnlineSearchPlugin *mOnlinePlugin;
       
    97     IsEngine* mEng;
       
    98     ServiceProvider* mCurrentProvider;
       
    99     QList<ServiceProvider> mAvailableProviders;
       
   100     bool mLoadSuggestion;
       
   101     QString mLoadSuggestionLink;
       
   102 SEARCH_FRIEND_CLASS    (SearchOnlineHandlerTest)
       
   103     };
       
   104 #endif