|
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: |
|
15 * |
|
16 */ |
|
17 #ifndef CNTEDITORDATAMODELITEM_H |
|
18 #define CNTEDITORDATAMODELITEM_H |
|
19 |
|
20 #include <hbdataformmodelitem.h> |
|
21 #include <QStandardItemModel> |
|
22 #include <qmobilityglobal.h> |
|
23 |
|
24 class HbDataFormViewItem; |
|
25 class HbInputFilter; |
|
26 |
|
27 QTM_BEGIN_NAMESPACE |
|
28 class QContactDetail; |
|
29 QTM_END_NAMESPACE |
|
30 |
|
31 QTM_USE_NAMESPACE |
|
32 |
|
33 class CntEditorDataModelItem : public HbDataFormModelItem |
|
34 { |
|
35 |
|
36 public: |
|
37 // ctor for fields that use HbComboBox |
|
38 CntEditorDataModelItem(QContactDetail &detail, const QString &key, QStandardItemModel *fieldModel, |
|
39 HbDataFormModelItem::DataItemType type, const QString &label = QString(), const HbDataFormModelItem *parent = 0); |
|
40 // ctor for fields that use HbLabel |
|
41 CntEditorDataModelItem(QContactDetail &detail, const QString &key, int maxLength, HbDataFormModelItem::DataItemType type, |
|
42 const QString &label = QString(), const HbDataFormModelItem *parent = 0); |
|
43 // ctor for special pushbutton items |
|
44 CntEditorDataModelItem(QContactDetail &detail, const QString &buttonLabel, HbDataFormModelItem::DataItemType type, |
|
45 const QString &label = QString(), const HbDataFormModelItem *parent = 0); |
|
46 ~CntEditorDataModelItem(); |
|
47 |
|
48 public: |
|
49 QContactDetail &contactDetail(); |
|
50 QString key(); |
|
51 QString buttonLabel(); |
|
52 QStandardItemModel *fieldModel(); |
|
53 int maxLength(); |
|
54 HbInputFilter *inputFilter(); |
|
55 void setTextFilter(HbInputFilter* inputFilter); |
|
56 |
|
57 private: |
|
58 QContactDetail &mContactDetail; |
|
59 QString mKey; |
|
60 QString mButtonLabel; |
|
61 QStandardItemModel *mFieldModel; |
|
62 int mMaxLength; |
|
63 HbInputFilter *mInputFilter; |
|
64 |
|
65 }; |
|
66 #endif //CNTEDITORDATAMODELITEM_H |