searchui/stateproviders/searchstateprovider/inc/searchprogressivestate.h
changeset 9 4a2987baf8f7
parent 5 3bc31ad99ee7
child 13 0a2ec6860a93
equal deleted inserted replaced
8:2f67eb14d003 9:4a2987baf8f7
    16  */
    16  */
    17 
    17 
    18 #ifndef PROGRESSIVE_SEARCH_STATE_H
    18 #ifndef PROGRESSIVE_SEARCH_STATE_H
    19 #define PROGRESSIVE_SEARCH_STATE_H
    19 #define PROGRESSIVE_SEARCH_STATE_H
    20 
    20 
    21 #include <qabstractitemmodel.h>
       
    22 #include <qstate.h>
    21 #include <qstate.h>
    23 #include <qstringlist.h>
    22 #include <qstringlist.h>
    24 #include <qdatetime.h>
    23 #include <qdatetime.h>
    25 #include <qpixmap.h>
    24 #include <qpixmap.h>
    26 #include <hbicon.h>
    25 #include <hbicon.h>
    28 #include <xqappmgr.h>
    27 #include <xqappmgr.h>
    29 #include <xqaiwrequest.h>
    28 #include <xqaiwrequest.h>
    30 #include "search_global.h"
    29 #include "search_global.h"
    31 #include <f32file.h>
    30 #include <f32file.h>
    32 
    31 
    33 //Uncomment to enable performance measurements.
    32 #ifdef OST_TRACE_COMPILER_IN_USE //defined in Search_global.h 
    34 //#define OST_TRACE_COMPILER_IN_USE
       
    35 
       
    36 #ifdef OST_TRACE_COMPILER_IN_USE
       
    37 
       
    38 #define PERF_CAT_API_TIME_RESTART  m_categorySearchApiTime.restart();
    33 #define PERF_CAT_API_TIME_RESTART  m_categorySearchApiTime.restart();
    39 #define PERF_CAT_UI_TIME_RESTART  m_categorySearchUiTime.restart();
    34 #define PERF_CAT_UI_TIME_RESTART  m_categorySearchUiTime.restart();
    40 #define PERF_CAT_TOTAL_TIME_RESTART  m_totalSearchUiTime.restart();
    35 #define PERF_CAT_TOTAL_TIME_RESTART  m_totalSearchUiTime.restart();
    41 #define PERF_CAT_API_ENDLOG qDebug() << "Search on category (API): " << mTemplist.at( mDatabasecount-1 ) << "took "<< m_categorySearchApiTime.elapsed() << " msec";
    36 #define PERF_CAT_API_ENDLOG qDebug() << "Search on category (API): " << mTemplist.at( mDatabasecount-1 ) << "took "<< m_categorySearchApiTime.elapsed() << " msec";
    42 #define PERF_CAT_UI_ENDLOG qDebug() << "Search on category (UI): " << mTemplist.at( mDatabasecount-1 ) << "took "<< m_categorySearchUiTime.elapsed() << " msec";
    37 #define PERF_CAT_UI_ENDLOG qDebug() << "Search on category (UI): " << mTemplist.at( mDatabasecount-1 ) << "took "<< m_categorySearchUiTime.elapsed() << " msec";
    44 #define PERF_CAT_HITS_ENDLOG qDebug() << "Hits on category: " << mTemplist.at( mDatabasecount-1 ) << ": "<< aResultCount;
    39 #define PERF_CAT_HITS_ENDLOG qDebug() << "Hits on category: " << mTemplist.at( mDatabasecount-1 ) << ": "<< aResultCount;
    45 #define PERF_CAT_GETDOC_TIME_RESTART m_categoryGetDocumentApiTime.restart();
    40 #define PERF_CAT_GETDOC_TIME_RESTART m_categoryGetDocumentApiTime.restart();
    46 #define PERF_CAT_GETDOC_TIME_ACCUMULATE m_getDocumentCatergoryTimeAccumulator += m_categoryGetDocumentApiTime.elapsed();
    41 #define PERF_CAT_GETDOC_TIME_ACCUMULATE m_getDocumentCatergoryTimeAccumulator += m_categoryGetDocumentApiTime.elapsed();
    47 #define PERF_CAT_GETDOC_ACCUMULATOR_RESET m_getDocumentCatergoryTimeAccumulator = 0;
    42 #define PERF_CAT_GETDOC_ACCUMULATOR_RESET m_getDocumentCatergoryTimeAccumulator = 0;
    48 #define PERF_CAT_GETDOC_ACCUMULATOR_ENDLOG qDebug() << "Get Doc on category (API): " << mTemplist.at( mDatabasecount-1 ) << "took " << m_getDocumentCatergoryTimeAccumulator << "msec";
    43 #define PERF_CAT_GETDOC_ACCUMULATOR_ENDLOG qDebug() << "Get Doc on category (API): " << mTemplist.at( mDatabasecount-1 ) << "took " << m_getDocumentCatergoryTimeAccumulator << "msec";
    49 
    44 #define PERF_RESULT_ITEM_LAUNCH_TIME_RESTART m_resultItemLaunchTime.restart();
       
    45 #define PERF_RESULT_ITEM_FOR_LAUNCHING(string) qDebug() <<"Result_Item_Launching: Launching "<<string ;
       
    46 #define PERF_RESULT_ITEM_LAUNCH_TIME_ENDLOG(string) qDebug() <<"Result_Item_Launching:"<<string<<"took "<<m_resultItemLaunchTime.elapsed()<<" msec";
    50 #else
    47 #else
    51 
    48 
    52 #define PERF_CAT_API_TIME_RESTART  
    49 #define PERF_CAT_API_TIME_RESTART  
    53 #define PERF_CAT_UI_TIME_RESTART  
    50 #define PERF_CAT_UI_TIME_RESTART  
    54 #define PERF_CAT_TOTAL_TIME_RESTART
    51 #define PERF_CAT_TOTAL_TIME_RESTART
    58 #define PERF_CAT_HITS_ENDLOG
    55 #define PERF_CAT_HITS_ENDLOG
    59 #define PERF_CAT_GETDOC_TIME_RESTART
    56 #define PERF_CAT_GETDOC_TIME_RESTART
    60 #define PERF_CAT_GETDOC_TIME_ACCUMULATE 
    57 #define PERF_CAT_GETDOC_TIME_ACCUMULATE 
    61 #define PERF_CAT_GETDOC_ACCUMULATOR_RESET
    58 #define PERF_CAT_GETDOC_ACCUMULATOR_RESET
    62 #define PERF_CAT_GETDOC_ACCUMULATOR_ENDLOG
    59 #define PERF_CAT_GETDOC_ACCUMULATOR_ENDLOG
    63 
    60 #define PERF_RESULT_ITEM_LAUNCH_TIME_RESTART
       
    61 #define PERF_RESULT_ITEM_FOR_LAUNCHING(string)
       
    62 #define PERF_RESULT_ITEM_LAUNCH_TIME_ENDLOG(string)
    64 #endif //OST_TRACE_COMPILER_IN_USE
    63 #endif //OST_TRACE_COMPILER_IN_USE
    65 class HbMainWindow;
    64 class HbMainWindow;
    66 class HbView;
    65 class HbView;
    67 class HbListView;
       
    68 class HbDocumentLoader;
    66 class HbDocumentLoader;
    69 class QStandardItemModel;
       
    70 class HbSearchPanel;
    67 class HbSearchPanel;
    71 class CFbsBitmap;
    68 class CFbsBitmap;
    72 class InDeviceHandler;
    69 class InDeviceHandler;
    73 class QCPixDocument;
    70 class QCPixDocument;
    74 class NotesEditor;
    71 class NotesEditorInterface;
    75 class EventViewerPluginInterface;
    72 class EventViewerPluginInterface;
       
    73 class HbListWidget;
       
    74 class HbListWidgetItem;
       
    75 class QPluginLoader;
    76 SEARCH_CLASS( SearchStateProviderTest)
    76 SEARCH_CLASS( SearchStateProviderTest)
    77 /** @ingroup group_searchstateprovider
    77 /** @ingroup group_searchstateprovider
    78  * @brief The state where progressive search state is shown
    78  * @brief The state where progressive search state is shown
    79  *
    79  *
    80  * @see StateMachine
    80  * @see StateMachine
   170     /**
   170     /**
   171      * slot connects to list view to launch the respective application
   171      * slot connects to list view to launch the respective application
   172      * @since S60 ?S60_version.
   172      * @since S60 ?S60_version.
   173      * @param aIndex index of the activated item.
   173      * @param aIndex index of the activated item.
   174      */
   174      */
   175     void openResultitem(QModelIndex aIndex);
   175     void openResultitem(HbListWidgetItem * item);
   176 
   176 
   177     /**
   177     /**
   178      * slot connects to settings state to get the selected category information
   178      * slot connects to settings state to get the selected category information
   179      * @since S60 ?S60_version.
   179      * @since S60 ?S60_version.
   180      * @param aCategory category(database) name.
   180      * @param aCategory category(database) name.
   194      * @param aKeyword search keyword.
   194      * @param aKeyword search keyword.
   195      */
   195      */
   196     void startNewSearch(const QString &aKeyword);
   196     void startNewSearch(const QString &aKeyword);
   197 
   197 
   198     /**
   198     /**
   199      * slot connects to search state  for internet search
       
   200      * @since S60 ?S60_version.
       
   201      */
       
   202     void _customizeGoButton(bool avalue);
       
   203 
       
   204     /**
       
   205      * slot implemented to avoid repeated search for the same category 
   199      * slot implemented to avoid repeated search for the same category 
   206      * selection when user search for mutiple times
   200      * selection when user search for mutiple times
   207      * @since S60 ?S60_version.
   201      * @since S60 ?S60_version.
   208      */
   202      */
   209     void settingsaction(bool avalue);
   203     void settingsaction(bool avalue);
   226      * Slot implemented to delete the calenderviewer plugin  
   220      * Slot implemented to delete the calenderviewer plugin  
   227      * @since S60 ?S60_version.
   221      * @since S60 ?S60_version.
   228      */
   222      */
   229 
   223 
   230     void _viewingCompleted();
   224     void _viewingCompleted();
       
   225 
       
   226     void viewReady();
       
   227     
       
   228     void slotOnlineQuery(QString);
       
   229     
       
   230     void slotISProvidersIcon(int, HbIcon);
       
   231 
   231 private:
   232 private:
   232 
   233 
   233     /**
   234     /**
   234      * initiate the fresh search for selected category separately 
   235      * initiate the fresh search for selected category separately 
   235      * 
   236      * 
   253     /**
   254     /**
   254      * prepares the suggestion link item on result list view to provide suggestion links     
   255      * prepares the suggestion link item on result list view to provide suggestion links     
   255      * 
   256      * 
   256      * @param aKeyword search keyword.
   257      * @param aKeyword search keyword.
   257      */
   258      */
   258     void createSuggestionLink(bool aFlag);
   259     void createSuggestionLink();
   259 
   260 
   260     /**
   261     /**
   261      * Function to include corrrect Qimage format to be taken from bitmap
   262      * Function to include corrrect Qimage format to be taken from bitmap
   262      *  @param mode Bitmap display mode.
   263      *  @param mode Bitmap display mode.
   263      */
   264      */
   308 
   309 
   309     /**
   310     /**
   310      * Signalled when user selects an to switch the settings state
   311      * Signalled when user selects an to switch the settings state
   311      * setting state will be  activated.
   312      * setting state will be  activated.
   312      */
   313      */
   313     void settingsState();
   314     void switchProToSettingsState();
   314 
   315     
       
   316     void inDeviceSearchQuery(QString);
       
   317 
       
   318     void launchLink(int,QString);
   315 private:
   319 private:
   316 
   320 
   317     HbMainWindow* mMainWindow;
   321     HbMainWindow* mMainWindow;
   318 
   322 
   319     /**
   323     /**
   324 
   328 
   325     /**
   329     /**
   326      * The List View widget.
   330      * The List View widget.
   327      * Own.
   331      * Own.
   328      */
   332      */
   329     HbListView* mListView;
   333     HbListWidget* mListView;
   330 
   334 
   331     /**
   335     /**
   332      * Document handler to load .docml.
   336      * Document handler to load .docml.
   333      * Own.
   337      * Own.
   334      */
   338      */
   338      * The searchpanel widget.
   342      * The searchpanel widget.
   339      * Own.
   343      * Own.
   340      */
   344      */
   341     HbSearchPanel* mSearchPanel;
   345     HbSearchPanel* mSearchPanel;
   342 
   346 
   343     /**
   347  
   344      * model for list view
       
   345      * Own.
       
   346      */
       
   347     QStandardItemModel* mModel;
       
   348 
   348 
   349     /**
   349     /**
   350      * qt interface for CPix engine
   350      * qt interface for CPix engine
   351      * Own.
   351      * Own.
   352      */
   352      */
   435 
   435 
   436     /**
   436     /**
   437      * to create Notes editor 
   437      * to create Notes editor 
   438      * 
   438      * 
   439      */
   439      */
   440     NotesEditor *notesEditor;
   440     NotesEditorInterface *mNotesEditor;
       
   441 
       
   442     /**
       
   443      * to create Notes plugin loader 
       
   444      * 
       
   445      */
       
   446     QPluginLoader *mNotespluginLoader;
       
   447     
       
   448     QMap<int, HbIcon> mISprovidersIcon;
       
   449     
       
   450     bool mOnlineQueryAvailable;
   441 
   451 
   442 private:
   452 private:
   443     /**
   453     /**
   444      * Application manager handler to perform resultitem opening.
   454      * Application manager handler to perform resultitem opening.
   445      * 
   455      * 
   460 #ifdef OST_TRACE_COMPILER_IN_USE
   470 #ifdef OST_TRACE_COMPILER_IN_USE
   461     QTime m_totalSearchUiTime;
   471     QTime m_totalSearchUiTime;
   462     QTime m_categorySearchUiTime;
   472     QTime m_categorySearchUiTime;
   463     QTime m_categorySearchApiTime;
   473     QTime m_categorySearchApiTime;
   464     QTime m_categoryGetDocumentApiTime;
   474     QTime m_categoryGetDocumentApiTime;
       
   475     QTime m_resultItemLaunchTime;
   465     //use long to safeguard overflow from long running operations.
   476     //use long to safeguard overflow from long running operations.
   466     long m_getDocumentCatergoryTimeAccumulator; 
   477     long m_getDocumentCatergoryTimeAccumulator;
   467 #endif
   478 #endif
   468 
   479 
   469 SEARCH_FRIEND_CLASS    (SearchStateProviderTest)
   480     SEARCH_FRIEND_CLASS (SearchStateProviderTest)
   470 
   481 
   471     };
   482     };
   472 
   483 
   473 #endif //PROGRESSIVE_SEARCH_STATE_H
   484 #endif //PROGRESSIVE_SEARCH_STATE_H