34 #include "hsmenuviewbuilder.h" |
33 #include "hsmenuviewbuilder.h" |
35 #include "hsmenustates_global.h" |
34 #include "hsmenustates_global.h" |
36 |
35 |
37 static const char* DOCUMENT_BASE_NAME_MAP |
36 static const char* DOCUMENT_BASE_NAME_MAP |
38 [InvalidStateContext][InvalidOperationalContext] = |
37 [InvalidStateContext][InvalidOperationalContext] = |
39 /*HsItemViewContext, HsSearchContext, HsButtonContext, HsEmptyLabelContext*/ |
38 /*HsItemViewContext, HsButtonContext, HsEmptyLabelContext*/ |
40 { |
39 { |
41 /*HsAllAppsContext*/ {"listview", "searchlistview", "listview", "listview"}, |
40 /*HsAllAppsContext*/ {"listview", "listview", "listview"}, |
42 /*HsAllCollectionsContext*/ {"listview", "searchlistview", "listview", "listview"}, |
41 /*HsAllCollectionsContext*/ {"listview", "listview", "listview"}, |
43 /*HsInstalledAppsContext*/ {"labeledlistview", "labeledlistview", |
42 /*HsInstalledAppsContext*/ {"labeledlistview", "labeledlistview", |
44 "labeledlistview", "emptylabeledview"}, |
43 "emptylabeledview"}, |
45 /*HsCollectionContext*/ {"labeledlistview", "searchlabeledlistview", |
44 /*HsCollectionContext*/ {"labeledlistview", "addcontentlabeledview", |
46 "addcontentlabeledview", "emptylabeledview"} |
45 "emptylabeledview"} |
47 }; |
46 }; |
48 |
47 |
49 static const QString DOCUMENT_NAME_PREFIX(QLatin1String(":/xml/")); |
48 static const QString DOCUMENT_NAME_PREFIX(QLatin1String(":/xml/")); |
50 static const QString DOCUMENT_NAME_EXT(QLatin1String(".docml")); |
49 static const QString DOCUMENT_NAME_EXT(QLatin1String(".docml")); |
51 static const QString COMMON_OBJECTS_DOCUMENT_BASE_NAME( |
50 static const QString COMMON_OBJECTS_DOCUMENT_BASE_NAME( |
52 QLatin1String("common_objects")); |
51 QLatin1String("common_objects")); |
53 static const QString VIEW_NAME(QLatin1String("view")); |
52 static const QString VIEW_NAME(QLatin1String("view")); |
54 static const QString LIST_VIEW_NAME(QLatin1String("listView")); |
53 static const QString LIST_VIEW_NAME(QLatin1String("listView")); |
55 static const QString VIEW_LABEL_NAME(QLatin1String("label")); |
54 static const QString VIEW_LABEL_NAME(QLatin1String("label")); |
56 static const QString SEARCH_PANEL_NAME(QLatin1String("searchPanel")); |
|
57 static const QString ADD_CONTENT_BUTTON_NAME(QLatin1String("addContentButton")); |
55 static const QString ADD_CONTENT_BUTTON_NAME(QLatin1String("addContentButton")); |
58 |
56 |
59 /*! |
57 /*! |
60 \class HsMenuViewBuilder |
58 \class HsMenuViewBuilder |
61 \ingroup group_hsmenustateplugin |
59 \ingroup group_hsmenustateplugin |
113 HbGroupBox *viewLabel = |
111 HbGroupBox *viewLabel = |
114 qobject_cast<HbGroupBox *>( |
112 qobject_cast<HbGroupBox *>( |
115 currentLoader()->findWidget(VIEW_LABEL_NAME)); |
113 currentLoader()->findWidget(VIEW_LABEL_NAME)); |
116 |
114 |
117 return viewLabel; |
115 return viewLabel; |
118 } |
|
119 |
|
120 /*! |
|
121 \return Pointer to the search panel resulting from last \a build call. It is |
|
122 guaranteed to be not NULL if the \a build was called for the context |
|
123 related to view including label. |
|
124 The pointer is valid until the HsMenuViewBuilder instance is destroyed. |
|
125 Memory ownership is not changed. |
|
126 */ |
|
127 HbSearchPanel *HsMenuViewBuilder::currentSearchPanel() |
|
128 { |
|
129 HbSearchPanel *searchPanel = |
|
130 qobject_cast<HbSearchPanel *>(currentLoader()->findWidget( |
|
131 SEARCH_PANEL_NAME)); |
|
132 return searchPanel; |
|
133 |
|
134 } |
116 } |
135 |
117 |
136 /*! |
118 /*! |
137 \return Pointer to the 'Add content' button resulting from last |
119 \return Pointer to the 'Add content' button resulting from last |
138 \a build call. It is |
120 \a build call. It is |
250 |
232 |
251 /*! |
233 /*! |
252 Loads non-context sensitive objects. |
234 Loads non-context sensitive objects. |
253 */ |
235 */ |
254 HsMenuViewBuilder::HsMenuViewBuilder(): |
236 HsMenuViewBuilder::HsMenuViewBuilder(): |
255 DOCUMENT_FILE_NAME(":/xml/applibrary.docml"), |
|
256 ALL_APPS_ACTION_NAME("allAppsAction"), |
237 ALL_APPS_ACTION_NAME("allAppsAction"), |
257 ALL_COLLECTIONS_ACTION_NAME("allCollectionsAction"), |
238 ALL_COLLECTIONS_ACTION_NAME("allCollectionsAction"), |
258 SEARCH_ACTION_NAME("searchAction"), |
239 SEARCH_ACTION_NAME("searchAction"), |
259 OVI_STORE_ACTION_NAME("oviStoreAction"), |
240 OVI_STORE_ACTION_NAME("oviStoreAction"), |
260 OPERATOR_ACTION_NAME("operatorAction"), |
241 OPERATOR_ACTION_NAME("operatorAction"), |
261 SEARCH_PANEL_NAME("searchPanel"), |
|
262 BUTTON_NAME("collectionButton"), |
|
263 TOOL_BAR_NAME("toolBar"), |
|
264 mToolBar(new HbToolBar), |
242 mToolBar(new HbToolBar), |
265 mToolBarExtension(new HbToolBarExtension), |
243 mToolBarExtension(new HbToolBarExtension), |
266 mStateContext(HsAllAppsContext), |
244 mStateContext(HsAllAppsContext), |
267 mOperationalContext(HsItemViewContext) |
245 mOperationalContext(HsItemViewContext) |
268 { |
246 { |