|
1 /* |
|
2 * Copyright (c) 2002-2006 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: Class declaration for EIKON spacer control. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __EIKSPACE_H__ |
|
20 #define __EIKSPACE_H__ |
|
21 |
|
22 #include <AknControl.h> |
|
23 #include <gdi.h> |
|
24 |
|
25 // Forward declarations |
|
26 class TResourceReader; |
|
27 |
|
28 /** |
|
29 * An invisible control that is used to provide a space between |
|
30 * visible controls. It has a width, a height and a color. |
|
31 * The spacer is normally drawn using the background color |
|
32 * so that it is invisible. |
|
33 * |
|
34 * Its associated resource struct is @c SPACER and its control |
|
35 * factory identifier is @c EEikCtSpacer. |
|
36 * |
|
37 * @lib eikctl.lib |
|
38 * @since S60 0.9 |
|
39 */ |
|
40 class CEikSpacer : public CAknControl |
|
41 { |
|
42 public: |
|
43 |
|
44 /** |
|
45 * Default C++ constructor. |
|
46 * The spacer's color is initialised to white. |
|
47 */ |
|
48 IMPORT_C CEikSpacer(); |
|
49 |
|
50 /** |
|
51 * C++ constructor with a width, height and color. |
|
52 * |
|
53 * @param aWidth The spacer's width. |
|
54 * @param aHeight The spacer's height. |
|
55 * @param aColor The spacer's color. |
|
56 */ |
|
57 IMPORT_C CEikSpacer(TInt aWidth,TInt aHeight,TRgb aColor); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 IMPORT_C ~CEikSpacer(); |
|
63 |
|
64 /** |
|
65 * Sets the spacer's width. |
|
66 * |
|
67 * @param aWidth The spacer's width. |
|
68 */ |
|
69 IMPORT_C void SetWidth(TInt aWidth); |
|
70 |
|
71 /** |
|
72 * Sets the spacer's height. |
|
73 * |
|
74 * @param aHeight The spacer's height. |
|
75 */ |
|
76 IMPORT_C void SetHeight(TInt aHeight); |
|
77 |
|
78 /** |
|
79 * Sets the spacer's color. |
|
80 * |
|
81 * @param aColor The spacer's color. |
|
82 */ |
|
83 IMPORT_C void SetColor(TRgb aColor); |
|
84 |
|
85 /** |
|
86 * Specifies whether the spacer is drawn using the standard brush color. |
|
87 * |
|
88 * If the "Is clear" flag is set, the spacer's color value is ignored, |
|
89 * and it is drawn using the brush color defined in the system's |
|
90 * standard graphics context. By default, the "Is clear" flag is unset. |
|
91 * |
|
92 * @param aClear @c ETrue to set the "Is clear" flag, |
|
93 * @c EFalse to unset it. |
|
94 */ |
|
95 IMPORT_C void SetClear(TBool aClear); |
|
96 |
|
97 public: // From @c CCoeControl. |
|
98 |
|
99 /** |
|
100 * Handles pointer events. |
|
101 * |
|
102 * This function gets called whenever a pointer event occurs in the |
|
103 * control, i.e. when the pointer is within the control's extent, or when |
|
104 * the control has grabbed the pointer. |
|
105 * |
|
106 * If overriding this method, the implementation must |
|
107 * include a base call to this method. |
|
108 * |
|
109 * From @c CCoeControl. |
|
110 * |
|
111 * @param aPointerEvent The pointer event. |
|
112 */ |
|
113 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
114 |
|
115 private: /** From @c CCoeControl. */ |
|
116 |
|
117 void ConstructFromResourceL(TResourceReader& aReader); |
|
118 |
|
119 void Draw(const TRect& aRect) const; |
|
120 |
|
121 private: /** From @c CAknControl. */ |
|
122 |
|
123 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
124 |
|
125 private: |
|
126 TRgb iColor; |
|
127 TBool iClear; |
|
128 }; |
|
129 |
|
130 #endif // __EIKSPACE_H__ |