|
1 /* |
|
2 * Copyright (c) 2005 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: Container for the Main Barring folder |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <aknlists.h> |
|
21 #include <StringLoader.h> |
|
22 #include <gscallbarringpluginrsc.rsg> |
|
23 #include <csxhelp/cp.hlp.hrh> |
|
24 #include <gsfwviewuids.h> |
|
25 #include "GSMainBarringContainer.h" |
|
26 |
|
27 #include "gslistbox.h" |
|
28 #include "CallBarringPlugin.hrh" |
|
29 #include <BTSapInternalPSKeys.h> |
|
30 #include <e32property.h> //P&S |
|
31 |
|
32 |
|
33 // ========================= MEMBER FUNCTIONS ================================ |
|
34 |
|
35 // --------------------------------------------------------------------------- |
|
36 // |
|
37 // Symbian OS two phased constructor |
|
38 // |
|
39 // --------------------------------------------------------------------------- |
|
40 void CGSSettListMainBarringContainer::ConstructL( const TRect& aRect ) |
|
41 { |
|
42 iListBox = new ( ELeave ) CAknSettingStyleListBox; |
|
43 |
|
44 BaseConstructL( aRect, |
|
45 R_GS_BARRING_MAIN_VIEW_TITLE, |
|
46 R_BARRING_MAIN_LBX ); |
|
47 |
|
48 RProperty::Get( KPSUidBluetoothSapConnectionState, |
|
49 KBTSapConnectionState, |
|
50 iBtSapConnectionState ); |
|
51 } |
|
52 |
|
53 // --------------------------------------------------------------------------- |
|
54 // |
|
55 // Destructor |
|
56 // |
|
57 // --------------------------------------------------------------------------- |
|
58 CGSSettListMainBarringContainer::~CGSSettListMainBarringContainer() |
|
59 { |
|
60 if ( iItems ) |
|
61 { |
|
62 delete iItems; |
|
63 } |
|
64 if ( iListboxItemArray ) |
|
65 { |
|
66 delete iListboxItemArray; |
|
67 } |
|
68 } |
|
69 |
|
70 // --------------------------------------------------------------------------- |
|
71 // |
|
72 // Creates list box |
|
73 // |
|
74 // --------------------------------------------------------------------------- |
|
75 void CGSSettListMainBarringContainer::ConstructListBoxL( TInt aResLbxId ) |
|
76 { |
|
77 iListBox->ConstructL( this, EAknListBoxSelectionList); |
|
78 iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, |
|
79 *iListBox, *iCoeEnv ); |
|
80 iListBox->Model()->SetItemTextArray( iListboxItemArray ); |
|
81 iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
|
82 |
|
83 CreateListBoxItemsL(); |
|
84 } |
|
85 |
|
86 // --------------------------------------------------------------------------- |
|
87 // |
|
88 // Creates List box items |
|
89 // |
|
90 // --------------------------------------------------------------------------- |
|
91 void CGSSettListMainBarringContainer::CreateListBoxItemsL() |
|
92 { |
|
93 if ( iBtSapConnectionState != EBTSapConnected ) |
|
94 { |
|
95 iListboxItemArray->SetItemVisibilityL( EGSCBCellular, |
|
96 CGSListBoxItemTextArray::EVisible ); |
|
97 } |
|
98 |
|
99 iListboxItemArray->SetItemVisibilityL( EGSCBInternet, |
|
100 CGSListBoxItemTextArray::EVisible ); |
|
101 } |
|
102 |
|
103 // --------------------------------------------------------------------------- |
|
104 // CGSSettListMainBarringContainer::GetHelpContext |
|
105 // Gets Help Context |
|
106 // |
|
107 // --------------------------------------------------------------------------- |
|
108 // |
|
109 void CGSSettListMainBarringContainer::GetHelpContext( |
|
110 TCoeHelpContext& aContext ) const |
|
111 { |
|
112 aContext.iMajor = KUidGS; |
|
113 aContext.iContext = KDIV_HLP_BARRING_MAIN; |
|
114 } |
|
115 |
|
116 // --------------------------------------------------------------------------- |
|
117 // CGSSettListMainBarringContainer::CurrentFeatureId() |
|
118 // |
|
119 // --------------------------------------------------------------------------- |
|
120 // |
|
121 TInt CGSSettListMainBarringContainer::CurrentFeatureId() const |
|
122 { |
|
123 return iListboxItemArray->CurrentFeature(); |
|
124 } |
|
125 |
|
126 //End of File |
|
127 |