diff -r 474929a40a0f -r 87476091b3f5 homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuviewbuilder.h --- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuviewbuilder.h Wed Jul 14 15:53:30 2010 +0300 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuviewbuilder.h Fri Jul 23 13:47:57 2010 +0300 @@ -20,7 +20,9 @@ #include #include +#include #include +#include #include #include #include @@ -38,18 +40,20 @@ class HbToolBarExtension; class HbPushButton; -enum HsViewContext { - HsAllAppsContext, +enum HsStateContext { + HsAllAppsContext = 0, HsAllCollectionsContext, HsInstalledAppsContext, HsCollectionContext, + InvalidStateContext }; enum HsOperationalContext { - HsItemViewContext, + HsItemViewContext = 0, HsSearchContext, HsButtonContext, - HsEmptyLabelContext + HsEmptyLabelContext, + InvalidOperationalContext }; HS_STATES_TEST_CLASS(MenuStatesTest) @@ -71,37 +75,33 @@ HbToolBarExtension *toolBarExtension() const; // mandatory context dependent widgets accessors - HbView *currentView() const; - HbListView *currentListView() const; + HbView *currentView(); + HbListView *currentListView(); // optional widgets accessors - HbGroupBox *currentViewLabel() const; - HbSearchPanel *currentSearchPanel() const; - HbPushButton *collectionButton() const; + HbGroupBox *currentViewLabel(); + HbSearchPanel *currentSearchPanel(); + HbPushButton *currentAddContentButton(); - void setViewContext(HsViewContext viewContext); + void setStateContext(HsStateContext stateContext); void setOperationalContext(HsOperationalContext operationalContext); - bool build(); private: - void init(); + typedef QPair Context; + typedef QMap > LoaderMap; + + QSharedPointer + parseDocument(const QString &documentBaseName); - bool parseSection(const QString §ionName = QString()); + QSharedPointer readContextConfiguration(); + Context context() const; - bool readContextConfiguration(HsViewContext, HsOperationalContext); + QSharedPointer currentLoader(); - void searchPanelVisibilityChange(bool visible); - - HbLineEdit *searchPanelLineEdit() const; - - QMap mViewContextToStringMap; - QMap mOperationalContextToStringMap; - - HbDocumentLoader mDocumentLoader; QSet mLoadedObjects; const QString DOCUMENT_FILE_NAME; @@ -119,10 +119,13 @@ HbToolBarExtension *mToolBarExtension; HbAction *mToolBarExtensionAction; - HsViewContext mViewContext; + HsStateContext mStateContext; HsOperationalContext mOperationalContext; HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) + + LoaderMap mLoaderMap; + QSharedPointer mCommonObjectsLoader; }; #endif // HSMENUVIEWBUILDER_H