1 /* |
|
2 * Copyright (c) 2002 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: LandmarksUi Content File - |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 // INCLUDE FILES |
|
26 #include "CLmkDbUtils.h" |
|
27 #include "CLmkUiUtils.h" |
|
28 #include "LmkConsts.h" |
|
29 #include "CLmkAppCategorySelectorImpl.h" |
|
30 #include "CLmkLmItemListProvider.h" |
|
31 #include "LmkListProviderFactory.h" |
|
32 #include <aknlists.h> |
|
33 #include <lmkerrors.h> |
|
34 |
|
35 |
|
36 #if defined(_DEBUG)// CONSTANTS |
|
37 /// Unnamed namespace for local definitions |
|
38 namespace { |
|
39 |
|
40 _LIT( KPanicMsg, "CLmkAppCategorySelectorImpl" ); |
|
41 |
|
42 void Panic( TPanicCode aReason ) |
|
43 { |
|
44 User::Panic( KPanicMsg, aReason ); |
|
45 } |
|
46 } // namespace |
|
47 #endif |
|
48 // ============================ MEMBER FUNCTIONS =============================== |
|
49 |
|
50 // ----------------------------------------------------------------------------- |
|
51 // CLmkAppCategorySelectorImpl::CLmkAppCategorySelectorImpl |
|
52 // C++ default constructor can NOT contain any code, that |
|
53 // might leave. |
|
54 // ----------------------------------------------------------------------------- |
|
55 // |
|
56 CLmkAppCategorySelectorImpl::CLmkAppCategorySelectorImpl( |
|
57 CPosLandmarkDatabase& aDb, |
|
58 CLmkSender& aSender, |
|
59 TBool aFindBox ) |
|
60 : CLmkAppLmItemSelectorImpl( aDb, aSender, aFindBox ) |
|
61 { |
|
62 } |
|
63 |
|
64 // ----------------------------------------------------------------------------- |
|
65 // CLmkAppCategorySelectorImpl::ConstructL |
|
66 // Symbian 2nd phase constructor can leave. |
|
67 // ----------------------------------------------------------------------------- |
|
68 // |
|
69 void CLmkAppCategorySelectorImpl::ConstructL() |
|
70 { |
|
71 CLmkAppLmItemSelectorImpl::BaseConstructL(); |
|
72 |
|
73 } |
|
74 |
|
75 // ----------------------------------------------------------------------------- |
|
76 // CLmkAppCategorySelectorImpl::NewL |
|
77 // Two-phased constructor. |
|
78 // ----------------------------------------------------------------------------- |
|
79 // |
|
80 EXPORT_C CLmkAppCategorySelectorImpl* CLmkAppCategorySelectorImpl::NewL( |
|
81 CPosLandmarkDatabase& aDb, |
|
82 CLmkSender& aSender, |
|
83 TBool aFindBox ) |
|
84 { |
|
85 CLmkAppCategorySelectorImpl* self = |
|
86 new( ELeave ) CLmkAppCategorySelectorImpl( aDb, aSender, aFindBox ); |
|
87 |
|
88 CleanupStack::PushL( self ); |
|
89 self->ConstructL(); |
|
90 CleanupStack::Pop(); |
|
91 |
|
92 return self; |
|
93 } |
|
94 |
|
95 // ----------------------------------------------------------------------------- |
|
96 // CLmkAppCategorySelectorImpl::~CLmkAppCategorySelectorImpl |
|
97 // ----------------------------------------------------------------------------- |
|
98 // |
|
99 CLmkAppCategorySelectorImpl::~CLmkAppCategorySelectorImpl() |
|
100 { |
|
101 } |
|
102 |
|
103 // ----------------------------------------------------------------------------- |
|
104 // CLmkAppCategorySelectorImpl::SetupListProviderL |
|
105 // ----------------------------------------------------------------------------- |
|
106 // |
|
107 void CLmkAppCategorySelectorImpl::SetupListProviderL() |
|
108 { |
|
109 if ( !iListProvider ) |
|
110 { |
|
111 iListProvider = |
|
112 LmkListProviderFactory::CreateProviderL( iDb, ECategorySelector ); |
|
113 iListProvider->AddObserverL( *this ); |
|
114 iListProvider->InitializeL(); |
|
115 } |
|
116 } |
|
117 |
|
118 // ----------------------------------------------------------------------------- |
|
119 // CLmkAppCategorySelectorImpl::ListProvider |
|
120 // ----------------------------------------------------------------------------- |
|
121 // |
|
122 const CLmkListProviderBase& CLmkAppCategorySelectorImpl::ListProvider() const |
|
123 { |
|
124 __ASSERT_DEBUG( iListProvider, Panic( KLmkPanicNullMember ) ); |
|
125 return *iListProvider; |
|
126 } |
|
127 // ----------------------------------------------------------------------------- |
|
128 // CLmkAppCategorySelectorImpl::CurrentCategoryId |
|
129 // ----------------------------------------------------------------------------- |
|
130 // |
|
131 EXPORT_C TInt CLmkAppCategorySelectorImpl::CurrentCategoryId() |
|
132 { |
|
133 return CLmkAppLmItemSelectorImpl::CurrentCategoryId(); |
|
134 } |
|
135 |
|
136 // ----------------------------------------------------------------------------- |
|
137 // CLmkAppCategorySelectorImpl::ProcessCommandL |
|
138 // ----------------------------------------------------------------------------- |
|
139 // |
|
140 void CLmkAppCategorySelectorImpl::ProcessCommandL( TInt aCommandId ) |
|
141 { |
|
142 CLmkAppLmItemSelectorImpl::ProcessCommandL( aCommandId ); |
|
143 } |
|
144 |
|
145 // ----------------------------------------------------------------------------- |
|
146 // CLmkAppCategorySelectorImpl::HandleOperationL |
|
147 // ----------------------------------------------------------------------------- |
|
148 // |
|
149 void CLmkAppCategorySelectorImpl::HandleOperationL( |
|
150 TOperationTypes /*aType*/, |
|
151 TReal32 /*aProgress*/, |
|
152 TInt /*aStatus*/ ) |
|
153 { |
|
154 } |
|
155 |
|
156 // ----------------------------------------------------------------------------- |
|
157 // CLmkAppCategorySelectorImpl::ChangeIconL |
|
158 // ----------------------------------------------------------------------------- |
|
159 // |
|
160 void CLmkAppCategorySelectorImpl::ChangeIconL( |
|
161 TPosLmItemId aId, |
|
162 TInt aIconIndex, |
|
163 TInt aMaskIndex) |
|
164 { |
|
165 TFileName* iconFile = CLmkUiUtils::LmkUiIconFileLC(); |
|
166 iDbUtils->ChangeIconL( iDb, aId, ELmkItemTypeCategory, |
|
167 *iconFile, aIconIndex, aMaskIndex ); |
|
168 CleanupStack::PopAndDestroy();//iconFile |
|
169 } |
|
170 |
|
171 // ----------------------------------------------------------------------------- |
|
172 // CLmkAppCategorySelectorImpl::ChangeIconsL |
|
173 // ----------------------------------------------------------------------------- |
|
174 // |
|
175 void CLmkAppCategorySelectorImpl::ChangeIconsL( |
|
176 RArray<TPosLmItemId>& aIdArray, |
|
177 TInt aIconIndex, TInt aMaskIndex) |
|
178 { |
|
179 TFileName* iconFile = CLmkUiUtils::LmkUiIconFileLC(); |
|
180 iDbUtils->ChangeIconsL( aIdArray, ELmkItemTypeCategory, |
|
181 *iconFile, aIconIndex, aMaskIndex ); |
|
182 CleanupStack::PopAndDestroy();//iconFile |
|
183 } |
|
184 // ----------------------------------------------------------------------------- |
|
185 // CLmkAppCategorySelectorImpl::HandleLmCreated |
|
186 // ----------------------------------------------------------------------------- |
|
187 // |
|
188 void CLmkAppCategorySelectorImpl::HandleLmCreated(TPosLmItemId aNewLmkItemId) |
|
189 { |
|
190 iNewLmkItemId = aNewLmkItemId; |
|
191 iNewListBoxItemAdded = ETrue; |
|
192 } |
|
193 |
|
194 // ----------------------------------------------------------------------------- |
|
195 // CLmkAppCategorySelectorImpl::HandleControlEventL |
|
196 // ----------------------------------------------------------------------------- |
|
197 // |
|
198 //#ifdef RD_SCALABLE_UI_V2 |
|
199 void CLmkAppCategorySelectorImpl::HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType ) |
|
200 { |
|
201 //Update the listbox a sper the search criteria |
|
202 if (iFilter) |
|
203 { |
|
204 iFilter->HandleControlEventL(aControl, aEventType); |
|
205 } |
|
206 } |
|
207 |
|
208 // End of File |
|