|
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: Base class implementation for video telephone sliders |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <cvtlogger.h> |
|
20 |
|
21 #include "cvtuisliderbase.h" |
|
22 #include "cvtuipopupbase.h" |
|
23 #include "cvtuifeaturemanager.h" |
|
24 #include "mvtuicomponentmanager.h" |
|
25 |
|
26 // --------------------------------------------------------------------------- |
|
27 // CVtUiSliderBase::~CVtUiSliderBase |
|
28 // --------------------------------------------------------------------------- |
|
29 // |
|
30 CVtUiSliderBase::~CVtUiSliderBase() |
|
31 { |
|
32 __VTPRINTENTER( "CVtUiSliderBase.~CVtUiSliderBase" ) |
|
33 delete iPopup; |
|
34 __VTPRINTEXIT( "CVtUiSliderBase.~CVtUiSliderBase" ) |
|
35 } |
|
36 |
|
37 // --------------------------------------------------------------------------- |
|
38 // CVtUiSliderBase::UpdateSlider |
|
39 // --------------------------------------------------------------------------- |
|
40 // |
|
41 void CVtUiSliderBase::UpdateSlider() |
|
42 { |
|
43 __VTPRINTENTER( "CVtUiSliderBase.UpdateSlider" ) |
|
44 |
|
45 iPopup->UpdatePopupL(); |
|
46 |
|
47 __VTPRINTEXIT( "CVtUiSliderBase.UpdateSlider" ) |
|
48 } |
|
49 // --------------------------------------------------------------------------- |
|
50 // CVtUiSliderBase::StartL |
|
51 // --------------------------------------------------------------------------- |
|
52 // |
|
53 void CVtUiSliderBase::StartL() |
|
54 { |
|
55 __VTPRINTENTER( "CVtUiSliderBase.StartL" ) |
|
56 if ( iFeatureState == MVtUiFeature::EReady ) |
|
57 { |
|
58 iFeatureManager.ComponentManager(). |
|
59 RequestActivationL( iPopup->ComponentId() ); |
|
60 // set state |
|
61 iFeatureState = MVtUiFeature::EActive; |
|
62 } |
|
63 __VTPRINTEXIT( "CVtUiSliderBase.StartL" ) |
|
64 } |
|
65 |
|
66 // --------------------------------------------------------------------------- |
|
67 // CVtUiSliderBase::Stop |
|
68 // --------------------------------------------------------------------------- |
|
69 // |
|
70 void CVtUiSliderBase::Stop() |
|
71 { |
|
72 __VTPRINTENTER( "CVtUiSliderBase.Stop" ) |
|
73 TRAP_IGNORE( |
|
74 { |
|
75 if ( iFeatureState == MVtUiFeature::EActive ) |
|
76 { |
|
77 // set state |
|
78 iFeatureState = MVtUiFeature::EReady; |
|
79 iFeatureManager.ComponentManager(). |
|
80 DeActivateComponentL( iPopup->ComponentId() ); |
|
81 } |
|
82 } ); |
|
83 __VTPRINTEXIT( "CVtUiSliderBase.Stop" ) |
|
84 } |
|
85 |
|
86 // --------------------------------------------------------------------------- |
|
87 // CVtUiSliderBase::InitFeatureL |
|
88 // --------------------------------------------------------------------------- |
|
89 // |
|
90 void CVtUiSliderBase::InitFeatureL() |
|
91 { |
|
92 __VTPRINTENTER( "CVtUiSliderBase.InitFeatureL" ) |
|
93 iFeatureState = EReady; |
|
94 __VTPRINTEXIT( "CVtUiSliderBase.InitFeatureL" ) |
|
95 } |
|
96 |
|
97 // --------------------------------------------------------------------------- |
|
98 // CVtUiSliderBase::ComponenStateChangedL() |
|
99 // --------------------------------------------------------------------------- |
|
100 // |
|
101 void CVtUiSliderBase::ComponenStateChangedL() |
|
102 { |
|
103 __VTPRINTENTER( "CVtUiSliderBase.ComponenStateChangedL()" ) |
|
104 // Close event received stop the feature |
|
105 Stop(); |
|
106 __VTPRINTEXIT( "CVtUiSliderBase.ComponenStateChangedL()" ) |
|
107 } |
|
108 |
|
109 // --------------------------------------------------------------------------- |
|
110 // CVtUiSliderBase::SetPermanenVisibility() |
|
111 // --------------------------------------------------------------------------- |
|
112 // |
|
113 void CVtUiSliderBase::SetPermanenVisibility( TBool aPermanent ) |
|
114 { |
|
115 if ( iPopup ) |
|
116 { |
|
117 iPopup->SetPermanenVisibility( aPermanent ); |
|
118 } |
|
119 } |
|
120 |
|
121 // --------------------------------------------------------------------------- |
|
122 // CVtUiSliderBase::CVtUiSliderBase |
|
123 // --------------------------------------------------------------------------- |
|
124 // |
|
125 CVtUiSliderBase::CVtUiSliderBase( CVtUiFeatureManager& aFeatureManager, |
|
126 TVtUiFeatureId aFeatureId ) : CVtUiFeatureBase( |
|
127 aFeatureId, aFeatureManager ) |
|
128 { |
|
129 __VTPRINTENTER( "CVtUiSliderBase.CVtUiSliderBase" ) |
|
130 __VTPRINTEXIT( "CVtUiSliderBase.CVtUiSliderBase" ) |
|
131 } |
|
132 |
|
133 // --------------------------------------------------------------------------- |
|
134 // CVtUiSliderBase::ConstructL |
|
135 // --------------------------------------------------------------------------- |
|
136 // |
|
137 void CVtUiSliderBase::ConstructL() |
|
138 { |
|
139 __VTPRINTENTER( "CVtUiSliderBase.ConstructL" ) |
|
140 BaseConstructL(); |
|
141 __VTPRINTEXIT( "CVtUiSliderBase.ConstructL" ) |
|
142 } |
|
143 |
|
144 // --------------------------------------------------------------------------- |
|
145 // CVtUiSliderBase::SetPopup |
|
146 // --------------------------------------------------------------------------- |
|
147 // |
|
148 void CVtUiSliderBase::SetPopup( CVtUiPopupBase* aPopup ) |
|
149 { |
|
150 __VTPRINTENTER( "CVtUiSliderBase.SetPopup" ) |
|
151 iPopup = aPopup; |
|
152 if ( iPopup ) |
|
153 { |
|
154 iPopup->SetObserver( *this ); |
|
155 } |
|
156 __VTPRINTEXIT( "CVtUiSliderBase.SetPopup" ) |
|
157 } |
|
158 |
|
159 // --------------------------------------------------------------------------- |
|
160 // CVtUiSliderBase::SetPopup |
|
161 // --------------------------------------------------------------------------- |
|
162 // |
|
163 CVtUiPopupBase& CVtUiSliderBase::Popup() |
|
164 { |
|
165 return *iPopup; |
|
166 } |
|
167 |
|
168 // --------------------------------------------------------------------------- |
|
169 // CVtUiSliderBase::SetPopup |
|
170 // --------------------------------------------------------------------------- |
|
171 // |
|
172 const CVtUiPopupBase& CVtUiSliderBase::Popup() const |
|
173 { |
|
174 return *iPopup; |
|
175 } |