|
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: Popup control for full screen container |
|
15 * |
|
16 */ |
|
17 |
|
18 // Version : %version: 7 % |
|
19 |
|
20 |
|
21 #ifndef MPXVIDEOPLAYBACKBUTTON_H |
|
22 #define MPXVIDEOPLAYBACKBUTTON_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <coecntrl.h> |
|
26 |
|
27 #include "mpxvideo_debug.h" |
|
28 #include "mpxvideoplaybackcontrolscontroller.h" |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 |
|
32 #ifdef RD_TACTILE_FEEDBACK |
|
33 class MTouchFeedback; |
|
34 #endif //RD_TACTILE_FEEDBACK |
|
35 |
|
36 // DATA TYPES |
|
37 enum TMPXButtonState |
|
38 { |
|
39 EMPXButtonNormal, |
|
40 EMPXButtonDimmed, |
|
41 EMPXButtonPressed |
|
42 }; |
|
43 |
|
44 class CMPXVideoPlaybackButton : public CCoeControl |
|
45 { |
|
46 public: |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 */ |
|
50 static CMPXVideoPlaybackButton* NewL( CMPXVideoPlaybackControlsController* aController, |
|
51 TRect aRect, const TDesC &aIconPath ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CMPXVideoPlaybackButton(); |
|
57 |
|
58 private: |
|
59 |
|
60 /** |
|
61 * C++ default constructor. |
|
62 */ |
|
63 CMPXVideoPlaybackButton(); |
|
64 |
|
65 /** |
|
66 * By default Symbian 2nd phase constructor is private. |
|
67 */ |
|
68 void ConstructL( CMPXVideoPlaybackControlsController* aController, |
|
69 TRect aRect, const TDesC &aIconPath ); |
|
70 |
|
71 private: |
|
72 |
|
73 /** |
|
74 * From CoeControl,CountComponentControls. |
|
75 * @return Number of contained component controls. |
|
76 */ |
|
77 TInt CountComponentControls() const; |
|
78 |
|
79 /** |
|
80 * From CCoeControl,Draw. |
|
81 * @param aRect drawable area. |
|
82 */ |
|
83 void Draw( const TRect& aRect ) const; |
|
84 |
|
85 private: |
|
86 |
|
87 /** |
|
88 * Creates button per a state |
|
89 */ |
|
90 CGulIcon* CreateButtonL( const TAknsItemID &aID, |
|
91 const TInt aFileIndex, |
|
92 const TInt aFileMaskIndex ); |
|
93 |
|
94 public: |
|
95 /** |
|
96 * Creates button for defautl cases |
|
97 * @return void |
|
98 */ |
|
99 void CreateDefaultButtonL( const TAknsItemID &aID, |
|
100 const TInt aFileIndex, |
|
101 const TInt aFileMaskIndex ); |
|
102 |
|
103 /** |
|
104 * Creates button for dimmed state |
|
105 * @return void |
|
106 */ |
|
107 void CreateDimmedButtonL( const TAknsItemID &aID, |
|
108 const TInt aFileIndex, |
|
109 const TInt aFileMaskIndex ); |
|
110 |
|
111 /** |
|
112 * Creates button for pressed button |
|
113 * @return void |
|
114 */ |
|
115 void CreatePressedButtonL( const TAknsItemID &aID, |
|
116 const TInt aFileIndex, |
|
117 const TInt aFileMaskIndex ); |
|
118 |
|
119 /** |
|
120 * Set Dimmed |
|
121 * @return void |
|
122 */ |
|
123 void SetDimmed( TBool aDimmed ); |
|
124 |
|
125 /** |
|
126 * Set pressed |
|
127 * @return void |
|
128 */ |
|
129 void SetPressed( TBool aPressed ); |
|
130 |
|
131 /** |
|
132 * Check whether this button is dimmed or not |
|
133 * @return void |
|
134 */ |
|
135 inline TBool IsDimmed(); |
|
136 |
|
137 private: // Data |
|
138 CGulIcon* iDefaultButton; |
|
139 CGulIcon* iDimmedButton; |
|
140 CGulIcon* iPressedButton; |
|
141 |
|
142 TMPXButtonState iState; |
|
143 HBufC* iIConPath; |
|
144 |
|
145 CMPXVideoPlaybackControlsController* iController; |
|
146 }; |
|
147 |
|
148 // INLINE METHODS |
|
149 |
|
150 inline |
|
151 TBool CMPXVideoPlaybackButton::IsDimmed() |
|
152 { |
|
153 TBool isDimmed = ( iState == EMPXButtonDimmed )? ETrue : EFalse; |
|
154 |
|
155 MPX_DEBUG(_L("CMPXVideoPlaybackButton::IsDimmed() (%d)"), isDimmed); |
|
156 |
|
157 return isDimmed; |
|
158 } |
|
159 |
|
160 #endif //MPXVIDEOPLAYBACKBUTTON_H |
|
161 |
|
162 // End of File |