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 "cpsamplegroup.h" |
|
18 #include <cpsettingformitemdata.h> |
|
19 #include <cpitemdatahelper.h> |
|
20 #include <hbmessagebox.h> |
|
21 |
|
22 CpSampleGroup::CpSampleGroup(CpItemDataHelper &itemDataHelper) : |
|
23 CpSettingFormItemData(HbDataFormModelItem::GroupItem,QString("Sample Group")), |
|
24 mSliderItem(0), |
|
25 mCheckBoxItem(0) |
|
26 { |
|
27 mSliderItem = new CpSettingFormItemData(HbDataFormModelItem::SliderItem, |
|
28 QString("Sample Slider")); |
|
29 itemDataHelper.addConnection(mSliderItem,SIGNAL(valueChanged(int)),this,SLOT(sliderValueChanged(int))); |
|
30 this->appendChild(mSliderItem); |
|
31 |
|
32 mCheckBoxItem = new CpSettingFormItemData(HbDataFormModelItem::CheckBoxItem, |
|
33 QString("Sample Check Box")); |
|
34 itemDataHelper.addConnection(mCheckBoxItem,SIGNAL(stateChanged (int)),this,SLOT(checkBoxStateChanged(int))); |
|
35 this->appendChild(mCheckBoxItem); |
|
36 |
|
37 } |
|
38 CpSampleGroup::~CpSampleGroup() |
|
39 { |
|
40 //TODO: release resource when necessary |
|
41 } |
|
42 void CpSampleGroup::sliderValueChanged(int value) |
|
43 { |
|
44 //TODO: store your changes |
|
45 HbMessageBox::launchInformationMessageBox(QString("slider value changed to:%1").arg(value)); |
|
46 } |
|
47 void CpSampleGroup::checkBoxStateChanged(int state) |
|
48 { |
|
49 //TODO: store your changes |
|
50 QString str = (state ? "checked" : "un-checked"); |
|
51 HbMessageBox::launchInformationMessageBox(str); |
|
52 } |
|