searchui/Searchapplication/src/Search.cpp
changeset 2 208a4ba3894c
parent 0 ccd0fd43f247
equal deleted inserted replaced
0:ccd0fd43f247 2:208a4ba3894c
    13  *
    13  *
    14  * Description:  Search application main class.
    14  * Description:  Search application main class.
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 #include "Search.h"
    18 #include "search.h"
    19 #include "hsruntime.h"
    19 #include <qstatemachine.h>
    20 #include "hsruntimefactory.h"
    20 #include <searchruntimeprovider.h>
       
    21 #include <searchruntime.h>
    21 
    22 
    22 // ---------------------------------------------------------------------------
    23 // ---------------------------------------------------------------------------
    23 // Search::Search
    24 // Search::Search
    24 // ---------------------------------------------------------------------------
    25 // ---------------------------------------------------------------------------
    25 //
    26 //
    26 Search::Search(QObject* aParent) :
    27 Search::Search(QObject* aParent) :
    27     QObject(aParent), mRuntime(NULL)
    28     QObject(aParent), mRuntime(NULL)
    28     {
    29     {
    29     SEARCH_FUNC_ENTRY("SEARCH::Search::Search");
    30     SEARCH_FUNC_ENTRY("SEARCH::Search::Search");
    30 
    31 
    31     HsRuntimeFactory factory("searchresources/plugins/runtimeproviders",
    32     SearchRuntimeProvider *interface = new SearchRuntimeProvider();
    32             "searchresources/plugins/runtimeproviders");
    33     mRuntime = interface->createPlugin();
    33 
       
    34     HsRuntimeToken token;
       
    35     token.mLibrary = "searchruntimeprovider.dll";
       
    36     token.mUri = "search.nokia.com/runtime/defaultruntime";
       
    37 
       
    38     mRuntime = factory.createRuntime(token);
       
    39     if (mRuntime)
    34     if (mRuntime)
    40         {
    35         {
    41         mRuntime->setParent(this);
    36         mRuntime->setParent(this);
    42         connect(mRuntime, SIGNAL(started()), SLOT(handleRuntimeStarted()));
    37         connect(mRuntime, SIGNAL(started()), SLOT(handleRuntimeStarted()));
    43         connect(mRuntime, SIGNAL(stopped()), SLOT(handleRuntimeStopped()));
    38         connect(mRuntime, SIGNAL(stopped()), SLOT(handleRuntimeStopped()));
    44         connect(mRuntime, SIGNAL(faulted()), SLOT(handleRuntimeFaulted()));
    39         connect(mRuntime, SIGNAL(faulted()), SLOT(handleRuntimeFaulted()));
    45         }
    40         } 
    46 
    41 		SEARCH_FUNC_EXIT("SEARCH::Search::Search");
    47     SEARCH_FUNC_EXIT("SEARCH::Search::Search");
       
    48     }
    42     }
    49 
    43 
    50 // ---------------------------------------------------------------------------
    44 // ---------------------------------------------------------------------------
    51 // Search::~Search()
    45 // Search::~Search()
    52 // ---------------------------------------------------------------------------
    46 // ---------------------------------------------------------------------------
    91 // ---------------------------------------------------------------------------
    85 // ---------------------------------------------------------------------------
    92 //
    86 //
    93 void Search::stop()
    87 void Search::stop()
    94     {
    88     {
    95     SEARCH_FUNC_ENTRY("SEARCH::Search::stop");
    89     SEARCH_FUNC_ENTRY("SEARCH::Search::stop");
    96 
    90     if (mRuntime)
    97     mRuntime->stop();
    91         {
       
    92         mRuntime->stop();
       
    93         }
    98 
    94 
    99     SEARCH_FUNC_EXIT("SEARCH::Search::stop");
    95     SEARCH_FUNC_EXIT("SEARCH::Search::stop");
   100     }
    96     }
   101 
    97 
   102 // ---------------------------------------------------------------------------
    98 // ---------------------------------------------------------------------------