|
1 /* |
|
2 * Copyright (c) 2005-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: A default control in the status pane's digital clock pane. |
|
15 * This class is used as container control |
|
16 * for the digital clock. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef C_AKNSTATUSPANEDIGITALCLOCK_H |
|
22 #define C_AKNSTATUSPANEDIGITALCLOCK_H |
|
23 |
|
24 #include <AknControl.h> |
|
25 #include <e32property.h> |
|
26 #include <hwrmlight.h> |
|
27 |
|
28 class CAknDigitalClock; |
|
29 class CAknStatuspaneDigitalClock; |
|
30 |
|
31 /** |
|
32 * Statuspane digital clock control that contains simple digital clock. |
|
33 * |
|
34 * This class is not intended for further derivation. |
|
35 * |
|
36 * @since 3.1 |
|
37 * |
|
38 * @internal |
|
39 */ |
|
40 NONSHARABLE_CLASS( CAknStatuspaneDigitalClock ) : |
|
41 public CAknControl, |
|
42 public MCoeMessageMonitorObserver, |
|
43 public MHWRMLightObserver |
|
44 { |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Standard constructor. |
|
49 */ |
|
50 CAknStatuspaneDigitalClock(); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 ~CAknStatuspaneDigitalClock(); |
|
56 |
|
57 /** |
|
58 * Construct from resources. |
|
59 * |
|
60 * @param aReader Not used. |
|
61 */ |
|
62 void ConstructFromResourceL( TResourceReader& aReader ); |
|
63 |
|
64 public: // From base class @c CCoeControl. |
|
65 |
|
66 /** |
|
67 * Returns the number of component controls. |
|
68 * |
|
69 * @return Amount of component controls. |
|
70 */ |
|
71 TInt CountComponentControls() const; |
|
72 |
|
73 /** |
|
74 * Returns the specified component control. |
|
75 * |
|
76 * @param aIndex Index of the component control. |
|
77 * @return The component control. |
|
78 */ |
|
79 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
80 |
|
81 /** |
|
82 * Sets dimming. |
|
83 * |
|
84 * @param aDimmed @c ETrue to set dimmed. |
|
85 */ |
|
86 void SetDimmed( TBool aDimmed ); |
|
87 |
|
88 /** |
|
89 * Handles the resource change events. |
|
90 * |
|
91 * @param aType Resource change event type. |
|
92 */ |
|
93 void HandleResourceChange( TInt aType ); |
|
94 |
|
95 virtual void MakeVisible( TBool aVisible ); |
|
96 |
|
97 public: // From base class @c MCoeMessageMonitorObserver. |
|
98 |
|
99 /** |
|
100 * Used to receive event from window server |
|
101 * when the visibility of the window changes. |
|
102 * |
|
103 * @param aEvent The window server event. |
|
104 */ |
|
105 void MonitorWsMessage( const TWsEvent &aEvent ); |
|
106 |
|
107 private: // New functions. |
|
108 |
|
109 /** |
|
110 * Called when the clock control receives foreground. |
|
111 */ |
|
112 void ForegroundGainedL(); |
|
113 |
|
114 protected: // From base class @c CCoeControl. |
|
115 |
|
116 /** |
|
117 * Handles the size change events. |
|
118 */ |
|
119 void SizeChanged(); |
|
120 |
|
121 private: // From base class @c CCoeControl. |
|
122 |
|
123 /** |
|
124 * Draws the control. |
|
125 * |
|
126 * @param aRect Not used. |
|
127 */ |
|
128 void Draw( const TRect& aRect ) const; |
|
129 |
|
130 private: |
|
131 |
|
132 /** |
|
133 * Sets window behaviour in fade situations. |
|
134 * |
|
135 * @param aNonFading @c ETrue to set the window non-fading. |
|
136 */ |
|
137 void SetContainerWindowNonFading( TBool aNonFading ); |
|
138 |
|
139 /** |
|
140 * From MHWRMLightObserver |
|
141 * @since Series 60 3.1 |
|
142 */ |
|
143 void LightStatusChanged(TInt aTarget, CHWRMLight::TLightStatus aStatus); |
|
144 |
|
145 |
|
146 private: // Member data |
|
147 |
|
148 /** Digital clock */ |
|
149 CAknDigitalClock* iClock; |
|
150 |
|
151 TInt iSpare1; |
|
152 TInt iSpare2; |
|
153 |
|
154 TBool iInForeground; |
|
155 |
|
156 /** For registering MHWRMLightObserver. */ |
|
157 CHWRMLight* iLight; |
|
158 }; |
|
159 |
|
160 #endif // C_AKNSTATUSPANEDIGITALCLOCK_H |