1 /* |
|
2 * Copyright (c) 2010 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: LocationPickerPotraitView declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef LOCATIONPICKERPOTRAITVIEW_H |
|
19 #define LOCATIONPICKERPOTRAITVIEW_H |
|
20 |
|
21 |
|
22 #include <HbView> |
|
23 #include <hbdocumentloader.h> |
|
24 #include "locationpickertypes.h" |
|
25 #include <QGraphicsLinearLayout> |
|
26 |
|
27 #include <HbLabel> |
|
28 |
|
29 //forward declarations |
|
30 class HbListView; |
|
31 class QStandardItemModel; |
|
32 class LocationPickerProxyModel; |
|
33 class LocationPickerCollectionListContent; |
|
34 class LocationPickerCollectionContent; |
|
35 class HbListViewItem; |
|
36 class HbAction; |
|
37 class HbAbstractViewItem; |
|
38 class HbMenu; |
|
39 class QPoint; |
|
40 /** |
|
41 * Class defines the location picker view |
|
42 */ |
|
43 class LocationPickerPotraitView : public HbView |
|
44 { |
|
45 Q_OBJECT |
|
46 public: |
|
47 // constructor |
|
48 LocationPickerPotraitView( HbDocumentLoader* aLoader ); |
|
49 // destructor |
|
50 ~LocationPickerPotraitView(); |
|
51 public: |
|
52 //disable the tabs |
|
53 void disableTabs( QStandardItemModel *aModel ); |
|
54 //get the items from docml and connect to respective slots |
|
55 void init( bool aPopulated, Qt::Orientation aOrientation, QStandardItemModel *aModel ); |
|
56 //Set the appropriate model on list view |
|
57 void manageListView(); |
|
58 //Create collection list and sets to list view |
|
59 void setCollectionData( quint32 acategoryId ); |
|
60 //Set Ctegory ID |
|
61 void setCategoryID( quint32 acategoryId ); |
|
62 //Get the view type |
|
63 TViewType getViewType(); |
|
64 //set the view type |
|
65 void setViewType( TViewType aViewType ); |
|
66 //clear collection Model |
|
67 void clearContentModel(); |
|
68 private slots: |
|
69 //slot to handle list item actions |
|
70 void handleActivated( const QModelIndex &aIndex ); |
|
71 //slots to handle menu action items |
|
72 void sortDescending(); |
|
73 void sortAscending(); |
|
74 void backTriggered(); |
|
75 //slot to handle search tab |
|
76 void searchTabTriggered(); |
|
77 //launch context menu |
|
78 void launchPopUpMenu(HbAbstractViewItem *aItem, const QPointF &aPoint); |
|
79 //handle long press |
|
80 void handleLongPress(); |
|
81 public slots: |
|
82 //slot to handle all tab |
|
83 void allTabTriggered(); |
|
84 //slot to handle collection tab |
|
85 void colectionTabTriggered(); |
|
86 signals: |
|
87 void switchToSearchView(); |
|
88 void selectItem( quint32 aLm ); |
|
89 void completeService(); |
|
90 void sendCategoryID( quint32 aCategoryId ); |
|
91 void handleAllList(); |
|
92 void collectionContentExited(); |
|
93 private: |
|
94 //document loader |
|
95 HbDocumentLoader* mDocumentLoader; |
|
96 // collection list content |
|
97 LocationPickerCollectionListContent* mLocationPickerCollectionListContent; |
|
98 //locationPickerProxyModel |
|
99 LocationPickerProxyModel *mProxyModel; |
|
100 //standard model |
|
101 QStandardItemModel *mModel; |
|
102 //actions |
|
103 HbAction *mAllAction; |
|
104 HbAction *mCollectionAction; |
|
105 HbAction *mSearchAction; |
|
106 HbAction *mAscendingAction; |
|
107 HbAction *mDescendingAction; |
|
108 //secondary back action |
|
109 HbAction *mPotraitBackAction; |
|
110 // list view |
|
111 HbListView *mListView; |
|
112 //list item |
|
113 HbListViewItem *mListItem; |
|
114 //collection content |
|
115 LocationPickerCollectionContent *mCollectionContent; |
|
116 //ViewType |
|
117 TViewType mViewType ; |
|
118 // get the collection/category id |
|
119 quint32 mCategoryId; |
|
120 //label to show current view |
|
121 QModelIndex mIndex; |
|
122 //linear Layout |
|
123 QGraphicsLinearLayout *mLinerLayout; |
|
124 //label to show detail of view |
|
125 HbLabel *mColllabel; |
|
126 //context menu |
|
127 HbMenu* mLongPressMenu; |
|
128 }; |
|
129 |
|
130 |
|
131 #endif // LOCATIONPICKERPOTRAITVIEW_H |
|