|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Menu View Builder |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef HSMENUVIEWBUILDER_H |
|
19 #define HSMENUVIEWBUILDER_H |
|
20 |
|
21 #include <QFlags> |
|
22 #include <QMap> |
|
23 #include <QString> |
|
24 #include <qnamespace.h> |
|
25 #include <hbdocumentloader.h> |
|
26 |
|
27 class HbAction; |
|
28 class HbGroupBox; |
|
29 class HbLineEdit; |
|
30 class HbListView; |
|
31 class HbSearchPanel; |
|
32 class HbToolBar; |
|
33 class HbView; |
|
34 class HbWidget; |
|
35 |
|
36 class HsMenuViewBuilder |
|
37 { |
|
38 public: |
|
39 HsMenuViewBuilder(); |
|
40 ~HsMenuViewBuilder(); |
|
41 |
|
42 bool setLabelVisible(bool); |
|
43 bool setSearchPanelVisible(bool); |
|
44 bool isLabelVisible() const; |
|
45 bool isSearchPanelVisible() const; |
|
46 |
|
47 HbView *view() const; |
|
48 HbListView *listView() const; |
|
49 HbGroupBox *label() const; |
|
50 HbSearchPanel *searchPanel() const; |
|
51 HbAction *allAppsAction() const; |
|
52 HbAction *allCollectionsAction() const; |
|
53 HbAction *searchAction() const; |
|
54 HbAction *oviStoreAction() const; |
|
55 HbToolBar *toolBar() const; |
|
56 HbLineEdit *searchPanelLineEdit() const; |
|
57 private: |
|
58 |
|
59 bool parseSection(const QString §ionName); |
|
60 |
|
61 HbDocumentLoader mDocumentLoader; |
|
62 |
|
63 QObject mParent; |
|
64 |
|
65 enum ViewOption { |
|
66 Default = 0x0, |
|
67 Label = 0x1, |
|
68 Search = 0x2 |
|
69 }; |
|
70 |
|
71 Q_DECLARE_FLAGS(ViewOptions, ViewOption) |
|
72 ViewOptions mViewOptions; |
|
73 QMap<ViewOptions, QString> mSections; |
|
74 |
|
75 void buildSectionKeyMap(); |
|
76 |
|
77 const QString DOCUMENT_FILE_NAME; |
|
78 const QString ALL_APPS_ACTION_NAME; |
|
79 const QString ALL_COLLECTIONS_ACTION_NAME; |
|
80 const QString SEARCH_ACTION_NAME; |
|
81 const QString OVI_STORE_ACTION_NAME; |
|
82 const QString VIEW_NAME; |
|
83 const QString CONTAINER_NAME; |
|
84 const QString LIST_VIEW_NAME; |
|
85 const QString TOOL_BAR_NAME; |
|
86 const QString SEARCH_PANEL_NAME; |
|
87 const QString LABEL_NAME; |
|
88 const QString LIST_VIEW_SECTION_NAME; |
|
89 const QString LIST_LABELED_VIEW_SECTION_NAME; |
|
90 const QString LIST_SEARCH_VIEW_SECTION_NAME; |
|
91 const QString LIST_SEARCH_LABELED_VIEW_SECTION_NAME; |
|
92 }; |
|
93 |
|
94 #endif // HSMENUVIEWBUILDER_H |