|
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 #include "cpprofilesgroupitemdata.h" |
|
18 #include <QStringList> |
|
19 #include <cpsettingformentryitemdataimpl.h> |
|
20 #include <cpbasesettingview.h> |
|
21 #include "cpprofilesettingform.h" |
|
22 |
|
23 CpProfilesGroupItemData::CpProfilesGroupItemData(CpItemDataHelper &itemDataHelper) |
|
24 : CpSettingFormItemData(HbDataFormModelItem::GroupItem,tr("Profiles")) |
|
25 { |
|
26 initItems(itemDataHelper); |
|
27 } |
|
28 |
|
29 CpProfilesGroupItemData::~CpProfilesGroupItemData() |
|
30 { |
|
31 } |
|
32 |
|
33 namespace |
|
34 { |
|
35 class CpProfileSettingView : public CpBaseSettingView |
|
36 { |
|
37 public: |
|
38 CpProfileSettingView() : CpBaseSettingView(new CpProfileSettingForm()) |
|
39 { |
|
40 } |
|
41 }; |
|
42 }; |
|
43 |
|
44 void CpProfilesGroupItemData::initItems(CpItemDataHelper &itemDataHelper) |
|
45 { |
|
46 HbDataFormModelItem *activeProfileItem = new HbDataFormModelItem( |
|
47 HbDataFormModelItem::RadioButtonListItem,tr("Profiles")); |
|
48 |
|
49 QStringList items; |
|
50 items << tr("Normal") << tr("Meeting") << tr("Silent"); |
|
51 activeProfileItem->setContentWidgetData("items",items); |
|
52 activeProfileItem->setContentWidgetData("selected",0); |
|
53 |
|
54 appendChild(activeProfileItem); |
|
55 |
|
56 HbDataFormModelItem *editProfileItem = new CpSettingFormEntryItemDataImpl<CpProfileSettingView>( |
|
57 itemDataHelper,tr("Edit profiles")); |
|
58 appendChild(editProfileItem); |
|
59 } |