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