1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef TIMELABELNAVI_H |
|
20 #define TIMELABELNAVI_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <coecntrl.h> |
|
24 #include <aknutils.h> |
|
25 |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CFbsBitmap; |
|
29 class MTimeLabelNaviObserver; |
|
30 #ifdef RD_TACTILE_FEEDBACK |
|
31 class MTouchFeedback; |
|
32 #endif /* RD_TACTILE_FEEDBACK */ |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * CTimeLabelNavi |
|
38 */ |
|
39 class CVeiTimeLabelNavi : public CCoeControl |
|
40 { |
|
41 public: // Constructors and destructor |
|
42 /** |
|
43 * Destructor |
|
44 */ |
|
45 IMPORT_C virtual ~CVeiTimeLabelNavi(); |
|
46 |
|
47 /** |
|
48 * Constructors. |
|
49 */ |
|
50 IMPORT_C static CVeiTimeLabelNavi* NewL(); |
|
51 IMPORT_C static CVeiTimeLabelNavi* NewLC(); |
|
52 |
|
53 |
|
54 public: // New functions |
|
55 /** |
|
56 * Changes navipane label. |
|
57 * @param aLabel label text |
|
58 */ |
|
59 IMPORT_C void SetLabelL(const TDesC& aLabel); |
|
60 |
|
61 /** |
|
62 * Sets left navipane arrow visibility |
|
63 * @param aVisible Whether to show or not. |
|
64 * @return - |
|
65 */ |
|
66 IMPORT_C void SetLeftArrowVisibilityL(TBool aVisible); |
|
67 |
|
68 /** |
|
69 * Sets right navipane arrow visibility |
|
70 * @param aVisible Whether to show or not. |
|
71 * @return - |
|
72 */ |
|
73 IMPORT_C void SetRightArrowVisibilityL(TBool aVisible); |
|
74 |
|
75 /** |
|
76 * Sets volume icon visibility |
|
77 * @param aVisible Whether to show or not. |
|
78 * @return - |
|
79 */ |
|
80 IMPORT_C void SetVolumeIconVisibilityL(TBool aVisible); |
|
81 |
|
82 /** |
|
83 * Sets pause icon visibility |
|
84 * @param aVisible whether to show or not. |
|
85 * @return - |
|
86 */ |
|
87 IMPORT_C void SetPauseIconVisibilityL(TBool aVisible); |
|
88 |
|
89 /** |
|
90 * SetNaviObserver |
|
91 * @param aObserver Observer. |
|
92 */ |
|
93 void SetNaviObserver(MTimeLabelNaviObserver* aObserver) |
|
94 { |
|
95 iObserver = aObserver; |
|
96 }; |
|
97 |
|
98 protected: // Functions from base classes |
|
99 |
|
100 /** |
|
101 * From CCoeControl. Handle the size change events. |
|
102 */ |
|
103 void SizeChanged(); |
|
104 |
|
105 /** |
|
106 * From CCoeControl. Draw a control. |
|
107 * @param aRect The region of the control to be redrawn. |
|
108 */ |
|
109 void Draw(const TRect& aRect) const; |
|
110 |
|
111 /** |
|
112 * From CCoeControl. Handles a change to the control's resources. |
|
113 * @param aType A message UID value. |
|
114 */ |
|
115 void HandleResourceChange(TInt aType); |
|
116 |
|
117 /** |
|
118 * From CCoeControl. Handles a control's pointer events. |
|
119 * @param aPointerEvent pointer event. |
|
120 */ |
|
121 void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
122 |
|
123 private: // Constructors and destructor |
|
124 |
|
125 /** |
|
126 * Constructor. |
|
127 */ |
|
128 CVeiTimeLabelNavi(); |
|
129 |
|
130 /** |
|
131 * EPOC 2nd phase constructor. |
|
132 */ |
|
133 void ConstructL(); |
|
134 |
|
135 /** |
|
136 * Load the icon bitmaps. |
|
137 */ |
|
138 void LoadBitmapsL(); |
|
139 |
|
140 /** |
|
141 * Delete the icon bitmaps. |
|
142 */ |
|
143 void DeleteBitmaps(); |
|
144 |
|
145 private: // Data |
|
146 /// Own: Volume bitmap |
|
147 CFbsBitmap* iVolumeBitmap; |
|
148 CFbsBitmap* iVolumeBitmapMask; |
|
149 |
|
150 /// Own: Arrow bitmap |
|
151 CFbsBitmap* iArrowBitmap; |
|
152 CFbsBitmap* iArrowBitmapMask; |
|
153 |
|
154 /// Own: Muted bitmap |
|
155 CFbsBitmap* iMutedBitmap; |
|
156 CFbsBitmap* iMutedBitmapMask; |
|
157 |
|
158 /// Own: Paused bitmap |
|
159 CFbsBitmap* iPausedBitmap; |
|
160 CFbsBitmap* iPausedBitmapMask; |
|
161 |
|
162 TBool iArrowVisible; |
|
163 TBool iVolumeIconVisible; |
|
164 TBool iPauseIconVisible; |
|
165 |
|
166 TBuf<32> iLabel; |
|
167 |
|
168 /// Rectangle where label is drawn |
|
169 TAknLayoutText iTextLayout; |
|
170 /// Layout array for volume/muted, array and paused items |
|
171 TAknLayoutRect iBitmapLayout[3]; |
|
172 |
|
173 /// Ref: to observer |
|
174 MTimeLabelNaviObserver* iObserver; |
|
175 |
|
176 // Feedback for screen touch: |
|
177 #ifdef RD_TACTILE_FEEDBACK |
|
178 MTouchFeedback* iTouchFeedBack; |
|
179 #endif /* RD_TACTILE_FEEDBACK */ |
|
180 |
|
181 }; |
|
182 |
|
183 #endif // VEITIMELABELNAVI_H |
|
184 |
|
185 // End of file |
|