|
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: HgWidgetDataModel implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef HGWIDGETDATAMODEL_H |
|
19 #define HGWIDGETDATAMODEL_H |
|
20 |
|
21 #include <QAbstractListModel> |
|
22 #include <HbIcon> |
|
23 |
|
24 class LocationPickerProxyModel; |
|
25 |
|
26 /*! |
|
27 Constructs the data model |
|
28 */ |
|
29 class HgWidgetDataModel : public QAbstractListModel |
|
30 { |
|
31 Q_OBJECT |
|
32 public: |
|
33 //ImageType to be set |
|
34 enum TImageType |
|
35 { |
|
36 ETypeQIcon, |
|
37 ETypeHbIcon, |
|
38 ETypeQImage |
|
39 }; |
|
40 public: |
|
41 //constructor |
|
42 explicit HgWidgetDataModel( LocationPickerProxyModel *aProxyModel, QObject *aParent=0); |
|
43 //destructor |
|
44 virtual ~HgWidgetDataModel(); |
|
45 //count of number of items in model |
|
46 int rowCount(const QModelIndex &aParent=QModelIndex()) const; |
|
47 //get the data from QStandardModel for HgWidgetModel |
|
48 QVariant data(const QModelIndex &aIndex, int aRole=Qt::DisplayRole) const; |
|
49 //Set Image Type |
|
50 void setImageDataType(TImageType type); |
|
51 //reset the model with new data |
|
52 void resetModel( LocationPickerProxyModel *aProxyModel ); |
|
53 |
|
54 #ifdef LOCPICKER_UNIT_TEST |
|
55 public: |
|
56 #else |
|
57 private: |
|
58 #endif |
|
59 //Image Type |
|
60 TImageType mImageType; |
|
61 //default Image type |
|
62 HbIcon mDefaultImage; |
|
63 //low resolution image |
|
64 bool mUseLowResImages; |
|
65 //proxymodel |
|
66 LocationPickerProxyModel *mProxyModel; |
|
67 }; |
|
68 |
|
69 #endif // HgWidgetDataModel_H |
|
70 |