|
1 /* |
|
2 * Copyright (c) 2008 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: Implementation of CGSAccBaseContainer class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <aknlists.h> |
|
20 #include <gsaccessoryplugin.rsg> |
|
21 #include <gslistbox.h> |
|
22 |
|
23 #include "gsaccbasecontainer.h" |
|
24 #include "gsaccessorypluginmodel.h" |
|
25 #include "trace.h" |
|
26 |
|
27 // ========================= MEMBER FUNCTIONS ================================ |
|
28 |
|
29 // --------------------------------------------------------------------------- |
|
30 // CGSAccBaseContainer::CGSAccBaseContainer() |
|
31 // --------------------------------------------------------------------------- |
|
32 // |
|
33 CGSAccBaseContainer::CGSAccBaseContainer( CGSAccessoryPluginModel& aModel ) |
|
34 : iModel ( aModel ) |
|
35 { |
|
36 FUNC_LOG; |
|
37 } |
|
38 |
|
39 |
|
40 // --------------------------------------------------------------------------- |
|
41 // CGSAccBaseContainer::~CGSAccBaseContainer() |
|
42 // --------------------------------------------------------------------------- |
|
43 // |
|
44 CGSAccBaseContainer::~CGSAccBaseContainer() |
|
45 { |
|
46 FUNC_LOG; |
|
47 |
|
48 delete iListboxItemArray; |
|
49 } |
|
50 |
|
51 |
|
52 // --------------------------------------------------------------------------- |
|
53 // CGSAccBaseContainer::CurrentFeatureId() |
|
54 // --------------------------------------------------------------------------- |
|
55 // |
|
56 TInt CGSAccBaseContainer::CurrentFeatureId() const |
|
57 { |
|
58 FUNC_LOG; |
|
59 |
|
60 return iListboxItemArray->CurrentFeature(); |
|
61 } |
|
62 |
|
63 |
|
64 // --------------------------------------------------------------------------- |
|
65 // CGSAccBaseContainer::CreateListBoxL() |
|
66 // --------------------------------------------------------------------------- |
|
67 // |
|
68 void CGSAccBaseContainer::CreateListBoxL() |
|
69 { |
|
70 FUNC_LOG; |
|
71 |
|
72 iListBox = new( ELeave ) CAknSettingStyleListBox; |
|
73 } |
|
74 |
|
75 |
|
76 // --------------------------------------------------------------------------- |
|
77 // CGSAccBaseContainer::SetItemTextL() |
|
78 // --------------------------------------------------------------------------- |
|
79 // |
|
80 void CGSAccBaseContainer::SetItemTextL( TInt aItemId, const TDesC& aText ) |
|
81 { |
|
82 FUNC_LOG; |
|
83 |
|
84 iListboxItemArray->SetDynamicTextL( aItemId, aText ); |
|
85 } |
|
86 |
|
87 |
|
88 // --------------------------------------------------------------------------- |
|
89 // CGSAccBaseContainer::MakeItemVisibleL() |
|
90 // --------------------------------------------------------------------------- |
|
91 // |
|
92 void CGSAccBaseContainer::MakeItemVisibleL( TInt aItemId ) |
|
93 { |
|
94 FUNC_LOG; |
|
95 INFO_1( "Making listbox item %d visible", aItemId ); |
|
96 |
|
97 iListboxItemArray->SetItemVisibilityL( |
|
98 aItemId, CGSListBoxItemTextArray::EVisible ); |
|
99 } |
|
100 |
|
101 |
|
102 // --------------------------------------------------------------------------- |
|
103 // CGSAccBaseContainer::ConstructListBoxL() |
|
104 // --------------------------------------------------------------------------- |
|
105 // |
|
106 void CGSAccBaseContainer::ConstructListBoxL( TInt aResLbxId ) |
|
107 { |
|
108 FUNC_LOG; |
|
109 |
|
110 iListBox->ConstructL( this, EAknListBoxSelectionList ); |
|
111 iListboxItemArray = CGSListBoxItemTextArray::NewL( |
|
112 aResLbxId, *iListBox, *iCoeEnv ); |
|
113 iListBox->Model()->SetItemTextArray( iListboxItemArray ); |
|
114 iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
|
115 } |