searchui/stateproviders/searchstateprovider/src/searchprogressivestate.cpp
changeset 23 af30d8015c58
parent 20 68cdadcf169e
equal deleted inserted replaced
20:68cdadcf169e 23:af30d8015c58
    52 #include <hblistwidgetitem.h>
    52 #include <hblistwidgetitem.h>
    53 #include <hbabstractviewitem.h>
    53 #include <hbabstractviewitem.h>
    54 #include <hblistviewitem.h>
    54 #include <hblistviewitem.h>
    55 #include <hbactivitymanager.h>
    55 #include <hbactivitymanager.h>
    56 #include <xqaiwdecl.h>
    56 #include <xqaiwdecl.h>
       
    57 #include <xqaiwdeclplat.h>
    57 #include <qservicemanager.h>
    58 #include <qservicemanager.h>
    58 #include <qurl.h>
    59 #include <qurl.h>
    59 QTM_USE_NAMESPACE
    60 QTM_USE_NAMESPACE
    60 #define hbApp qobject_cast<HbApplication*>(qApp)
    61 #define hbApp qobject_cast<HbApplication*>(qApp)
    61 const int totalcategories_normalreason = 10;
    62 const int totalcategories_normalreason = 10;
    62 const int totalcategories_activityreasonreason = 13;
    63 const int totalcategories_activityreasonreason = 13;
    63 const int intial_iteration = 3;
    64 const int intial_iteration = 3;
    64 const int batch_iteration = 20;
    65 const int batch_iteration = 20;
       
    66 #define SEARCHAPPUID "2002C377"
       
    67 
    65 // ---------------------------------------------------------------------------
    68 // ---------------------------------------------------------------------------
    66 // SearchProgressiveState::SearchProgressiveState
    69 // SearchProgressiveState::SearchProgressiveState
    67 // ---------------------------------------------------------------------------
    70 // ---------------------------------------------------------------------------
    68 SearchProgressiveState::SearchProgressiveState(QState *parent) :
    71 SearchProgressiveState::SearchProgressiveState(QState *parent) :
    69     QState(parent), mMainWindow(NULL), mView(NULL), mListView(NULL),
    72     QState(parent), mMainWindow(NULL), mView(NULL), mListView(NULL),
   184     }
   187     }
   185 // ---------------------------------------------------------------------------
   188 // ---------------------------------------------------------------------------
   186 // SearchProgressiveState::onEntry
   189 // SearchProgressiveState::onEntry
   187 // ---------------------------------------------------------------------------
   190 // ---------------------------------------------------------------------------
   188 void SearchProgressiveState::onEntry(QEvent *event)
   191 void SearchProgressiveState::onEntry(QEvent *event)
   189     {
   192     {    
   190     //  WMS_LOG << "::onEntry";
       
   191     QState::onEntry(event);
   193     QState::onEntry(event);
   192 
       
   193     mStateStatus = true;// used for conditional execution for the slots that are connected as transitions
   194     mStateStatus = true;// used for conditional execution for the slots that are connected as transitions
   194     if (mSearchPanel)
   195     if (mSearchPanel)
   195         {
   196         {
   196         mSearchPanel->setPlaceholderText(hbTrId(
   197         mSearchPanel->setPlaceholderText(hbTrId(
   197                 "txt_search_dialog_search_device"));
   198                 "txt_search_dialog_search_device"));
   397     bool t;
   398     bool t;
   398     mRequest = NULL;
   399     mRequest = NULL;
   399     if (item->data(Qt::UserRole + 1).toString().contains("contact"))
   400     if (item->data(Qt::UserRole + 1).toString().contains("contact"))
   400         {
   401         {
   401         PERF_RESULT_ITEM_FOR_LAUNCHING("contact")
   402         PERF_RESULT_ITEM_FOR_LAUNCHING("contact")
   402         mRequest = mAiwMgr->create("com.nokia.symbian.IContactsView",
   403         mRequest = mAiwMgr->create(XQI_CONTACTS_VIEW,XQOP_CONTACTS_VIEW_CONTACT_CARD, true);
   403                 "openContactCard(int)", true);
       
   404 
   404 
   405         int uid = (item->data(Qt::UserRole)).toInt(&t);
   405         int uid = (item->data(Qt::UserRole)).toInt(&t);
   406         args << uid;
   406         args << uid;
   407         }
   407         }
   408     else if (item->data(Qt::UserRole + 1).toString().contains("bookmark"))
   408     else if (item->data(Qt::UserRole + 1).toString().contains("bookmark"))
   467         PERF_RESULT_ITEM_LAUNCH_TIME_ENDLOG("")
   467         PERF_RESULT_ITEM_LAUNCH_TIME_ENDLOG("")
   468         }
   468         }
   469     else if (item->data(Qt::UserRole + 1).toString().contains("msg email"))
   469     else if (item->data(Qt::UserRole + 1).toString().contains("msg email"))
   470         {
   470         {
   471 
   471 
   472         mRequest = mAiwMgr->create("nmail",
   472         mRequest = mAiwMgr->create(XQI_EMAIL_MESSAGE_VIEW,XQOP_EMAIL_MESSAGE_VIEW, true);
   473                 "com.nokia.symbian.IEmailMessageView",
       
   474                 "viewMessage(QVariant,QVariant,QVariant)", true);
       
   475 
   473 
   476         args << item->data(Qt::UserRole + 2).toULongLong(&t) << item->data(
   474         args << item->data(Qt::UserRole + 2).toULongLong(&t) << item->data(
   477                 Qt::UserRole + 3).toULongLong(&t)
   475                 Qt::UserRole + 3).toULongLong(&t)
   478                 << item->data(Qt::UserRole).toULongLong(&t);
   476                 << item->data(Qt::UserRole).toULongLong(&t);
   479         }
   477         }
   480     else if (item->data(Qt::UserRole + 1).toString().contains("msg"))
   478     else if (item->data(Qt::UserRole + 1).toString().contains("msg"))
   481         {
   479         {
   482         PERF_RESULT_ITEM_FOR_LAUNCHING("msg")
   480         PERF_RESULT_ITEM_FOR_LAUNCHING("msg")
   483         mRequest = mAiwMgr->create("messaging",
   481         mRequest = mAiwMgr->create(XQI_MESSAGE_VIEW, XQOP_MESSAGE_VIEW, true);
   484                 "com.nokia.symbian.IMessageView", "view(int)", true);
       
   485 
   482 
   486         int uid = (item->data(Qt::UserRole)).toInt(&t);
   483         int uid = (item->data(Qt::UserRole)).toInt(&t);
   487         args << uid;
   484         args << uid;
   488         }
   485         }
   489     else if (item->data(Qt::UserRole + 1).toString().contains("links"))
   486     else if (item->data(Qt::UserRole + 1).toString().contains("links"))
  1095     }
  1092     }
  1096 // ---------------------------------------------------------------------------
  1093 // ---------------------------------------------------------------------------
  1097 // SearchProgressiveState::LaunchApplicationL
  1094 // SearchProgressiveState::LaunchApplicationL
  1098 // ---------------------------------------------------------------------------
  1095 // ---------------------------------------------------------------------------
  1099 void SearchProgressiveState::LaunchApplicationL(const QString aUid)
  1096 void SearchProgressiveState::LaunchApplicationL(const QString aUid)
  1100     {
  1097     {  
       
  1098     if(aUid.contains(SEARCHAPPUID,Qt::CaseInsensitive))
       
  1099         {       
       
  1100         return;
       
  1101         }
  1101     QServiceManager serviceManager;
  1102     QServiceManager serviceManager;
  1102     QObject* mActivityManager = serviceManager.loadInterface(
  1103     QObject* mActivityManager = serviceManager.loadInterface(
  1103             "com.nokia.qt.activities.ActivityManager");
  1104             "com.nokia.qt.activities.ActivityManager");
  1104     if (!mActivityManager)
  1105     if (!mActivityManager)
  1105         {
  1106         {
  1188         HbIcon icon(icons.at(i));
  1189         HbIcon icon(icons.at(i));
  1189         if (icon.isNull() || !(icon.size().isValid()))
  1190         if (icon.isNull() || !(icon.size().isValid()))
  1190             icon = HbIcon("qtg_large_application");
  1191             icon = HbIcon("qtg_large_application");
  1191         mIconArray.append(icon);
  1192         mIconArray.append(icon);
  1192         }
  1193         }
  1193     /*QList<TUid> appUid;
       
  1194      appUid.append(TUid::Uid(0x20022EF9));//contact
       
  1195      appUid.append(TUid::Uid(0x10207C62));//audio
       
  1196      appUid.append(TUid::Uid(0x200211FE));//video 
       
  1197      appUid.append(TUid::Uid(0x20000A14));//image 
       
  1198      appUid.append(TUid::Uid(0x2001FE79));//msg
       
  1199      appUid.append(TUid::Uid(0x200255BA));//email 
       
  1200      appUid.append(TUid::Uid(0x10005901));//calender
       
  1201      appUid.append(TUid::Uid(0x20029F80));//notes
       
  1202      //appUid.Append(TUid::Uid(0x20022F35));//application
       
  1203      appUid.append(TUid::Uid(0x10008D39));//bookmark
       
  1204      appUid.append(TUid::Uid(0x2002BCC0));//files
       
  1205 
       
  1206      for (int i = 0; i < appUid.count(); i++)
       
  1207      {
       
  1208      TRAP_IGNORE(mIconArray.append(getAppIconFromAppIdL(appUid.at(i))));
       
  1209      }*/
       
  1210     }
  1194     }
  1211 // ---------------------------------------------------------------------------
  1195 // ---------------------------------------------------------------------------
  1212 // SearchProgressiveState::activityRequested
  1196 // SearchProgressiveState::activityRequested
  1213 // ---------------------------------------------------------------------------
  1197 // ---------------------------------------------------------------------------
  1214 void SearchProgressiveState::activityRequested(const QString &name)
  1198 void SearchProgressiveState::activityRequested(const QString &name)