57
|
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 CMPXVideoPlaybackVolumeBar
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
// Version : %version: 9 %
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
#ifndef MPXVIDEOPLAYBACKVOLUMEBAR_H
|
|
23 |
#define MPXVIDEOPLAYBACKVOLUMEBAR_H
|
|
24 |
|
|
25 |
// INCLUDES
|
|
26 |
#include <coecntrl.h>
|
|
27 |
|
|
28 |
|
|
29 |
// FORWARD DECLARATIONS
|
|
30 |
class CMPXVideoPlaybackControlsController;
|
|
31 |
|
|
32 |
#ifdef RD_TACTILE_FEEDBACK
|
|
33 |
class MTouchFeedback;
|
|
34 |
#endif //RD_TACTILE_FEEDBACK
|
|
35 |
|
|
36 |
// DATA TYPES
|
|
37 |
enum TMPXVolumeDragging
|
|
38 |
{
|
|
39 |
EVolumeNotDragging,
|
|
40 |
EVolumeIncreaseDragging,
|
|
41 |
EVolumeDecreaseDragging,
|
|
42 |
EVolumeSpeakerDragging,
|
|
43 |
EVolumeBarDragging
|
|
44 |
};
|
|
45 |
|
|
46 |
|
|
47 |
class CMPXVideoPlaybackVolumeBar : public CCoeControl
|
|
48 |
{
|
|
49 |
public:
|
|
50 |
/**
|
|
51 |
* Two-phased constructor.
|
|
52 |
*/
|
|
53 |
static CMPXVideoPlaybackVolumeBar* NewL( CMPXVideoPlaybackControlsController* aController,
|
|
54 |
TRect aRect );
|
|
55 |
|
|
56 |
/**
|
|
57 |
* Destructor.
|
|
58 |
*/
|
|
59 |
virtual ~CMPXVideoPlaybackVolumeBar();
|
|
60 |
|
|
61 |
private:
|
|
62 |
|
|
63 |
/**
|
|
64 |
* C++ default constructor.
|
|
65 |
*/
|
|
66 |
CMPXVideoPlaybackVolumeBar( CMPXVideoPlaybackControlsController* aController, TRect aRect );
|
|
67 |
|
|
68 |
/**
|
|
69 |
* By default Symbian 2nd phase constructor is private.
|
|
70 |
*/
|
|
71 |
void ConstructL();
|
|
72 |
|
|
73 |
void CreateSliderIconsL();
|
|
74 |
|
|
75 |
private: // from CoeControl
|
|
76 |
|
|
77 |
/**
|
|
78 |
* From CoeControl,CountComponentControls.
|
|
79 |
* @return Number of contained component controls.
|
|
80 |
*/
|
|
81 |
TInt CountComponentControls() const;
|
|
82 |
|
|
83 |
/**
|
|
84 |
* From CCoeControl,Draw.
|
|
85 |
* @param aRect drawable area.
|
|
86 |
*/
|
|
87 |
void Draw( const TRect& aRect ) const;
|
|
88 |
|
|
89 |
public: // from CoeControl
|
|
90 |
|
|
91 |
/**
|
|
92 |
* From CoeControl,OfferKeyEventL
|
|
93 |
*/
|
|
94 |
void HandlePointerEventL( const TPointerEvent& aPointerEvent );
|
|
95 |
|
|
96 |
/**
|
|
97 |
* From CCoeControl.
|
|
98 |
*/
|
|
99 |
void HandleResourceChange( TInt aType );
|
|
100 |
|
|
101 |
public:
|
|
102 |
|
|
103 |
/**
|
|
104 |
* Set changed volume
|
|
105 |
* @since 5.0
|
|
106 |
* @return void
|
|
107 |
*/
|
|
108 |
void VolumeChanged( TInt aVolume );
|
|
109 |
|
|
110 |
/*
|
|
111 |
* Abandons any ongoing pointer input
|
|
112 |
* @since 5.0
|
|
113 |
*/
|
|
114 |
void Reset();
|
|
115 |
|
|
116 |
/**
|
|
117 |
* TV Out connected
|
|
118 |
* @return void
|
|
119 |
*/
|
|
120 |
void UpdateTVOutStatusL( TBool aConnected );
|
|
121 |
|
|
122 |
private: //new fuctions
|
|
123 |
/**
|
|
124 |
* Set layout for each icon
|
|
125 |
*/
|
|
126 |
void SetLayout();
|
|
127 |
|
|
128 |
/**
|
|
129 |
* Creates new skins for the control.
|
|
130 |
* @since 5.0
|
|
131 |
* @return void
|
|
132 |
*/
|
|
133 |
void SkinChangeL();
|
|
134 |
|
|
135 |
void HandleVolumeIncreaseL( const TPointerEvent& aPointerEvent );
|
|
136 |
void HandleVolumeDecreaseL( const TPointerEvent& aPointerEvent );
|
|
137 |
void HandleSpeakerControlEventL( const TPointerEvent& aPointerEvent );
|
|
138 |
void HandleVolumeBarEventL( const TPointerEvent& aPointerEvent );
|
|
139 |
|
|
140 |
static TInt HandleVolumeDragEventTimeOut( TAny* aPtr );
|
|
141 |
void DoHandleVolumeDragEventTimeOut();
|
|
142 |
void SetVolumeL( TInt aVolume );
|
|
143 |
|
|
144 |
private: // Data
|
|
145 |
CGulIcon* iSpeakerIcon;
|
|
146 |
CGulIcon* iSpeakerMuteIcon;
|
|
147 |
CGulIcon* iSliderIcon;
|
|
148 |
CGulIcon* iSliderSelectedIcon;
|
|
149 |
CGulIcon* iVolumeUpIcon;
|
|
150 |
CGulIcon* iVolumeDownIcon;
|
|
151 |
CGulIcon* iVolumeFrameIconTop;
|
|
152 |
CGulIcon* iVolumeFrameIconMiddle;
|
|
153 |
CGulIcon* iVolumeFrameIconBottom;
|
|
154 |
CGulIcon* iNoAudioIcon;
|
|
155 |
|
|
156 |
TReal iOneVolumeIncrementHeight;
|
|
157 |
|
|
158 |
TBool iMuted;
|
|
159 |
TInt iVolumeWhileDraggingEvent;
|
|
160 |
|
|
161 |
TRect iRect;
|
|
162 |
TRect iSliderRect;
|
|
163 |
TRect iSpeakerRect;
|
|
164 |
TRect iSpeakerControlRect;
|
|
165 |
TRect iVolumeUpRect;
|
|
166 |
TRect iVolumeDownRect;
|
|
167 |
TRect iVolumeUpControlRect;
|
|
168 |
TRect iVolumeDownControlRect;
|
|
169 |
TRect iVolumeBarRect;
|
|
170 |
TRect iVolumeBarRectTop;
|
|
171 |
TRect iVolumeBarRectMiddle;
|
|
172 |
TRect iVolumeBarRectBottom;
|
|
173 |
TRect iVolumeControlRect;
|
|
174 |
|
|
175 |
TMPXVolumeDragging iDragging;
|
|
176 |
|
|
177 |
CPeriodic* iDraggingHandlerTimer;
|
|
178 |
|
|
179 |
CMPXVideoPlaybackControlsController* iController;
|
|
180 |
|
|
181 |
TInt iCenteredSliderbarIconX;
|
|
182 |
|
|
183 |
#ifdef RD_TACTILE_FEEDBACK
|
|
184 |
MTouchFeedback* iFeedback;
|
|
185 |
#endif //RD_TACTILE_FEEDBACK
|
|
186 |
};
|
|
187 |
|
|
188 |
#endif //MPXVIDEOPLAYBACKVOLUMEBAR_H
|
|
189 |
|
|
190 |
// End of File
|