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: Background appearance drawer |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _XNBGCONTROL_H |
|
20 #define _XNBGCONTROL_H |
|
21 |
|
22 // System includes |
|
23 #include <e32base.h> |
|
24 #include <coecntrl.h> |
|
25 |
|
26 // User includes |
|
27 #include "xnuistatelistener.h" |
|
28 |
|
29 // Forward declarations |
|
30 |
|
31 /** |
|
32 * Background appearance drawer |
|
33 * |
|
34 * @ingroup group_xnlayoutengine |
|
35 * @lib xn3layoutengine.lib |
|
36 * @since S60 5.0 |
|
37 */ |
|
38 NONSHARABLE_CLASS( CXnBgControl ) : public CCoeControl , public MXnUiStateObserver |
|
39 { |
|
40 public: |
|
41 // Constructors and destructor |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 */ |
|
46 static CXnBgControl* NewL(); |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. Leaving on stack |
|
50 */ |
|
51 static CXnBgControl* NewLC(); |
|
52 |
|
53 /** |
|
54 * Destructor |
|
55 */ |
|
56 ~CXnBgControl(); |
|
57 |
|
58 private: |
|
59 // private constructors |
|
60 |
|
61 /** |
|
62 * Leaving constructor |
|
63 */ |
|
64 void ConstructL(); |
|
65 |
|
66 /** |
|
67 * C++ default constructor |
|
68 */ |
|
69 CXnBgControl(); |
|
70 |
|
71 public: |
|
72 // from CCoeControl |
|
73 |
|
74 /** |
|
75 * @see CCoeControl |
|
76 */ |
|
77 TInt CountComponentControls() const; |
|
78 |
|
79 /** |
|
80 * @see CCoeControl |
|
81 */ |
|
82 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
83 |
|
84 /** |
|
85 * @see CCoeControl |
|
86 */ |
|
87 void SizeChanged(); |
|
88 |
|
89 /** |
|
90 * @see CCoeControl |
|
91 */ |
|
92 void Draw( const TRect& aRect ) const; |
|
93 |
|
94 /** |
|
95 * @see CCoeControl |
|
96 */ |
|
97 void HandlePointerEventL( const TPointerEvent& aPointerEvent ); |
|
98 |
|
99 public: |
|
100 // new functions |
|
101 void SetCompoundControl( CCoeControl* aControl ); |
|
102 |
|
103 /** |
|
104 * Service for removing grabbing controls |
|
105 */ |
|
106 void ResetGrabbingL(); |
|
107 |
|
108 private: |
|
109 // new functions |
|
110 |
|
111 /** |
|
112 * Removes recursively grabbing controls |
|
113 */ |
|
114 void RemoveGrabbingControL( const CCoeControl* aControl, const TPointerEvent& aEvent ) const; |
|
115 |
|
116 private: |
|
117 // from MXnUiStateObserver |
|
118 |
|
119 /** |
|
120 * @see MXnUiStateObserver |
|
121 */ |
|
122 void NotifyForegroundChanged( TForegroundStatus aStatus ); |
|
123 |
|
124 /** |
|
125 * @see MXnUiStateObserver |
|
126 */ |
|
127 void NotifyLightStatusChanged( TBool aLightsOn ); |
|
128 |
|
129 /** |
|
130 * @see MXnUiStateObserver |
|
131 */ |
|
132 void NotifyInCallStateChaged( TBool aInCall ); |
|
133 |
|
134 private: |
|
135 // data |
|
136 |
|
137 /** Compound Control, Not owned */ |
|
138 CCoeControl* iControl; |
|
139 |
|
140 /** stored point of EButton1Down */ |
|
141 TPoint iHitpoint; |
|
142 |
|
143 }; |
|
144 |
|
145 #endif // _XNBGCONTROL_H |
|