|
1 /* |
|
2 * Copyright (c) 2007 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: IMSWCheckBoxPage.cpp |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <ImumUtils.rsg> |
|
20 |
|
21 #include "IMSWCheckBoxPage.h" |
|
22 #include "ImumUtilsLogging.h" |
|
23 |
|
24 // ============================ MEMBER FUNCTIONS =============================== |
|
25 |
|
26 // ---------------------------------------------------------------------------- |
|
27 // CIMSSettingsWizardEditTextPage::CIMSSettingsWizardEditTextPage |
|
28 // ---------------------------------------------------------------------------- |
|
29 CIMSSettingsWizardCheckBoxPage::CIMSSettingsWizardCheckBoxPage( |
|
30 TInt aResourceID, CSelectionItemList* aItemArray, TBool aMustFillOne ): |
|
31 CAknCheckBoxSettingPage( aResourceID, aItemArray ) |
|
32 { |
|
33 IMUM_CONTEXT( CIMSSettingsWizardCheckBoxPage::CIMSSettingsWizardCheckBoxPage, 0, KLogUi ); |
|
34 |
|
35 iItemArray = aItemArray; |
|
36 iMustFillOne = aMustFillOne; |
|
37 iLeftSkResource = R_IMAS_SETTINGS_SK_BUTTON_OK; |
|
38 } |
|
39 |
|
40 // ---------------------------------------------------------------------------- |
|
41 // CIMSSettingsWizardEditTextPage::~CIMSSettingsWizardEditTextPage |
|
42 // ---------------------------------------------------------------------------- |
|
43 CIMSSettingsWizardCheckBoxPage::~CIMSSettingsWizardCheckBoxPage() |
|
44 { |
|
45 IMUM_CONTEXT( CIMSSettingsWizardCheckBoxPage::~CIMSSettingsWizardCheckBoxPage, 0, KLogUi ); |
|
46 } |
|
47 |
|
48 // ---------------------------------------------------------------------------- |
|
49 // CIMSSettingsWizardEditTextPage::UpdateSettingL |
|
50 // ---------------------------------------------------------------------------- |
|
51 void CIMSSettingsWizardCheckBoxPage::UpdateSettingL() |
|
52 { |
|
53 IMUM_CONTEXT( CIMSSettingsWizardCheckBoxPage::UpdateSettingL, 0, KLogUi ); |
|
54 |
|
55 CAknCheckBoxSettingPage::UpdateSettingL(); |
|
56 |
|
57 if ( iMustFillOne ) |
|
58 { |
|
59 // Set left softkey empty if all boxes are unchecked |
|
60 TInt resourceId = R_IMAS_SETTINGS_SK_BUTTON_EMPTY; |
|
61 TInt nItems = iItemArray->Count(); |
|
62 for( TInt i = 0; i < nItems; i++ ) |
|
63 { |
|
64 if ( ( *iItemArray )[i]->SelectionStatus() ) |
|
65 { |
|
66 resourceId = R_IMAS_SETTINGS_SK_BUTTON_OK; |
|
67 } |
|
68 } |
|
69 |
|
70 if ( resourceId != iLeftSkResource ) |
|
71 { |
|
72 CEikButtonGroupContainer *bgc; |
|
73 MopGetObject(bgc); |
|
74 if (bgc) |
|
75 { |
|
76 CEikCba* cba(NULL); |
|
77 cba = ( static_cast<CEikCba*>( bgc->ButtonGroup() ) ); // downcast from MEikButtonGroup |
|
78 const TInt KSkPosition = 0; // left SK position |
|
79 iLeftSkResource = resourceId; |
|
80 cba->SetCommandL( KSkPosition, iLeftSkResource ); |
|
81 cba->DrawNow(); |
|
82 } |
|
83 } |
|
84 } |
|
85 } |
|
86 |
|
87 // End of File |