--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuviewbuilder.h Tue Jul 06 14:06:53 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsmenuviewbuilder.h Wed Aug 18 09:40:07 2010 +0300
@@ -20,7 +20,9 @@
#include <QFlags>
#include <QMap>
+#include <QPair>
#include <QSet>
+#include <QSharedPointer>
#include <QString>
#include <qnamespace.h>
#include <HbDocumentLoader>
@@ -31,25 +33,25 @@
class HbGroupBox;
class HbLineEdit;
class HbListView;
-class HbSearchPanel;
class HbToolBar;
class HbView;
class HbWidget;
class HbToolBarExtension;
class HbPushButton;
-enum HsViewContext {
- HsAllAppsContext,
+enum HsStateContext {
+ HsAllAppsContext = 0,
HsAllCollectionsContext,
HsInstalledAppsContext,
HsCollectionContext,
+ InvalidStateContext
};
enum HsOperationalContext {
- HsItemViewContext,
- HsSearchContext,
+ HsItemViewContext = 0,
HsButtonContext,
- HsEmptyLabelContext
+ HsEmptyLabelContext,
+ InvalidOperationalContext
};
HS_STATES_TEST_CLASS(MenuStatesTest)
@@ -71,58 +73,53 @@
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;
-
-
- void setViewContext(HsViewContext viewContext);
- void setOperationalContext(HsOperationalContext operationalContext);
- bool build();
-
-private:
- void init();
-
- bool parseSection(const QString §ionName = QString());
+ HbGroupBox *currentViewLabel();
+ HbPushButton *currentAddContentButton();
- bool readContextConfiguration(HsViewContext, HsOperationalContext);
+ void setStateContext(HsStateContext stateContext);
+ void setOperationalContext(HsOperationalContext operationalContext);
+
+private:
+ typedef QPair<HsStateContext, HsOperationalContext> Context;
+ typedef QMap<Context, QSharedPointer<HbDocumentLoader> > LoaderMap;
+
+ QSharedPointer<HbDocumentLoader>
+ parseDocument(const QString &documentBaseName);
+
+ QSharedPointer<HbDocumentLoader> readContextConfiguration();
+
+ Context context() const;
+
+ QSharedPointer<HbDocumentLoader> currentLoader();
- void searchPanelVisibilityChange(bool visible);
-
- HbLineEdit *searchPanelLineEdit() const;
-
- QMap<HsViewContext, QString > mViewContextToStringMap;
- QMap<HsOperationalContext, QString > mOperationalContextToStringMap;
-
- HbDocumentLoader mDocumentLoader;
QSet<QObject *> mLoadedObjects;
- const QString DOCUMENT_FILE_NAME;
+
const QString ALL_APPS_ACTION_NAME;
const QString ALL_COLLECTIONS_ACTION_NAME;
const QString SEARCH_ACTION_NAME;
const QString OVI_STORE_ACTION_NAME;
const QString OPERATOR_ACTION_NAME;
- const QString SEARCH_PANEL_NAME;
- const QString BUTTON_NAME;
- const QString TOOL_BAR_NAME;
QActionGroup *mToolBarActionGroup;
HbToolBar *mToolBar;
HbToolBarExtension *mToolBarExtension;
HbAction *mToolBarExtensionAction;
- HsViewContext mViewContext;
+ HsStateContext mStateContext;
HsOperationalContext mOperationalContext;
HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest)
+
+ LoaderMap mLoaderMap;
+ QSharedPointer<HbDocumentLoader> mCommonObjectsLoader;
};
#endif // HSMENUVIEWBUILDER_H