|
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: Provides LM compass view's container class methods. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <aknlists.h> |
|
21 #include <aknsfld.h> |
|
22 #include <landmarks.rsg> |
|
23 // For RD_AVKON_UNBRANCH |
|
24 #include <bldvariant.hrh> |
|
25 #include <AknDef.h> |
|
26 #include "CLmkUiUtils.h" |
|
27 #include "landmarks.hrh" |
|
28 #include <csxhelp/lm.hlp.hrh> |
|
29 #include "CLmkByCategoryView.h" |
|
30 #include "CLmkByCategoryContainer.h" |
|
31 #include "CLmkAppCategorySelectorImpl.h" |
|
32 |
|
33 #include <lmkui.rsg> |
|
34 |
|
35 // ================= MEMBER FUNCTIONS ======================= |
|
36 // ---------------------------------------------------------------------------- |
|
37 // CLmkByCategoryContainer::NewL |
|
38 // ---------------------------------------------------------------------------- |
|
39 // |
|
40 CLmkByCategoryContainer* CLmkByCategoryContainer::NewL( |
|
41 MLmkKeyProcessor& aKeyProcessor, |
|
42 MObjectProvider* aParent, |
|
43 const TRect& aRect, CAknView& aView ) |
|
44 { |
|
45 CLmkByCategoryContainer* self = |
|
46 new( ELeave ) CLmkByCategoryContainer( aKeyProcessor, aView ); |
|
47 CleanupStack::PushL( self ); |
|
48 self->SetMopParent( aParent ); |
|
49 self->ConstructL( aRect ); |
|
50 CleanupStack::Pop(); // self |
|
51 return self; |
|
52 } |
|
53 |
|
54 // ---------------------------------------------------------------------------- |
|
55 // CLmkByCategoryContainer::CLmkByCategoryContainer |
|
56 // ---------------------------------------------------------------------------- |
|
57 // |
|
58 CLmkByCategoryContainer::CLmkByCategoryContainer( |
|
59 MLmkKeyProcessor& aKeyProcessor, CAknView& aView ) : |
|
60 CLmkLbWithFilterContainer( aKeyProcessor, KLM_HLP_LM_BY_CATEGORY ), |
|
61 iView(aView) |
|
62 { |
|
63 } |
|
64 |
|
65 // ---------------------------------------------------------------------------- |
|
66 // CLmkByCategoryContainer::~CLmkByCategoryContainer |
|
67 // ---------------------------------------------------------------------------- |
|
68 // |
|
69 CLmkByCategoryContainer::~CLmkByCategoryContainer() |
|
70 { |
|
71 } |
|
72 |
|
73 // ---------------------------------------------------------------------------- |
|
74 // CLmkByCategoryContainer::SetupTitlePaneL |
|
75 // ---------------------------------------------------------------------------- |
|
76 // |
|
77 void CLmkByCategoryContainer::SetupTitlePaneL() |
|
78 { |
|
79 CLmkUiUtils::ChangeTitlePaneL( R_LMK_BYCATEGORY_VIEW_TITLE ); |
|
80 } |
|
81 |
|
82 // ---------------------------------------------------------------------------- |
|
83 // CLmkByCategoryContainer::SetupSelectorAndListL |
|
84 // ---------------------------------------------------------------------------- |
|
85 // |
|
86 void CLmkByCategoryContainer::SetupSelectorAndListL( |
|
87 CPosLandmarkDatabase& aDb, |
|
88 CLmkSender& aSender ) |
|
89 { |
|
90 iSelector = CLmkAppCategorySelectorImpl::NewL( aDb, aSender, ETrue ); |
|
91 iSelector->SetMskObserver(this); |
|
92 iListBox = &( iSelector->CreateListBoxL( this, |
|
93 EAknCtSingleGraphicListBox, |
|
94 EAknListBoxSelectionList, |
|
95 R_LMK_EMPTY_NO_LANDMARKS ,R_LMK_GUIDE_NEW_LANDMARK ) ); |
|
96 } |
|
97 |
|
98 // ---------------------------------------------------------------------------- |
|
99 // CLmkByCategoryContainer::GetCurrentCategoryId |
|
100 // ---------------------------------------------------------------------------- |
|
101 // |
|
102 TInt CLmkByCategoryContainer::GetCurrentCategoryId() |
|
103 { |
|
104 return (static_cast<CLmkAppCategorySelectorImpl*>(iSelector))->CurrentCategoryId(); |
|
105 } |
|
106 |
|
107 // ---------------------------------------------------------------------------- |
|
108 // CLmkByCategoryContainer::SetupNaviPaneL |
|
109 // ---------------------------------------------------------------------------- |
|
110 // |
|
111 void CLmkByCategoryContainer::SetupNaviPaneL() |
|
112 { |
|
113 iNaviDeco = CreateNaviPaneL( R_LMK_TAB_GROUP ); |
|
114 ActivateTabL( *iNaviDeco, ELmkByCategoryView ); |
|
115 } |
|
116 |
|
117 // ----------------------------------------------------------------------------- |
|
118 //CLmkByCategoryContainer::HandleResourceChange |
|
119 // ----------------------------------------------------------------------------- |
|
120 // |
|
121 void CLmkByCategoryContainer::HandleResourceChange( TInt aType ) |
|
122 { |
|
123 CCoeControl::HandleResourceChange( aType ); |
|
124 if ( aType == KEikDynamicLayoutVariantSwitch ) |
|
125 { |
|
126 (static_cast <CLmkByCategoryView *> (&iView))->Update(); |
|
127 } |
|
128 if (iListBox) |
|
129 { |
|
130 iListBox->DrawNow(); |
|
131 } |
|
132 if( iFindBox && iFindBox->IsVisible() ) |
|
133 { |
|
134 iFindBox->DrawNow(); |
|
135 } |
|
136 } |
|
137 |
|
138 // ---------------------------------------------------------------------------- |
|
139 // CLmkByCategoryContainer::FocusChanged() |
|
140 // ---------------------------------------------------------------------------- |
|
141 // |
|
142 void CLmkByCategoryContainer::FocusChanged(TDrawNow aDrawNow) |
|
143 { |
|
144 if (iListBox) |
|
145 { |
|
146 iListBox->SetFocus(IsFocused(), aDrawNow); |
|
147 } |
|
148 if( iFindBox && iFindBox->IsVisible() ) |
|
149 { |
|
150 iFindBox->SetFocus( IsFocused(), aDrawNow ); |
|
151 } |
|
152 } |
|
153 |
|
154 // ---------------------------------------------------------------------------- |
|
155 // CLmkByCategoryContainer::UpdateMskContainer() |
|
156 // ---------------------------------------------------------------------------- |
|
157 // |
|
158 void CLmkByCategoryContainer::UpdateMskContainerL() |
|
159 { |
|
160 CLmkBaseView* view = reinterpret_cast<CLmkBaseView*>(&iView); |
|
161 view->UpdateMskViewL(ResolveMskDisplayItem()); |
|
162 } |
|
163 // End of File |