williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description: Class declaration for EIKON bordered control.
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#ifndef __EIKBCTRL_H__
|
williamr@2
|
20 |
#define __EIKBCTRL_H__
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#include <gulbordr.h>
|
williamr@2
|
23 |
#include <coecntrl.h>
|
williamr@4
|
24 |
#include <AknControl.h>
|
williamr@2
|
25 |
|
williamr@2
|
26 |
/**
|
williamr@2
|
27 |
* A control which is drawn surrounded by a rectangular border.
|
williamr@2
|
28 |
*
|
williamr@2
|
29 |
* The screen appearance of derived classes can be changed by overriding
|
williamr@2
|
30 |
* the protected method @c Draw(). By default, this draws a border of the
|
williamr@2
|
31 |
* appropriate type around the control.
|
williamr@2
|
32 |
*
|
williamr@2
|
33 |
* @lib eikcoctl.lib
|
williamr@2
|
34 |
* @since S60 0.9
|
williamr@2
|
35 |
*/
|
williamr@2
|
36 |
class CEikBorderedControl : public CAknControl
|
williamr@2
|
37 |
{
|
williamr@2
|
38 |
public:
|
williamr@2
|
39 |
|
williamr@2
|
40 |
/**
|
williamr@2
|
41 |
* Default C++ Constructor.
|
williamr@2
|
42 |
* Constructs a new bordered control that has no border.
|
williamr@2
|
43 |
*/
|
williamr@2
|
44 |
IMPORT_C CEikBorderedControl();
|
williamr@2
|
45 |
|
williamr@2
|
46 |
/**
|
williamr@2
|
47 |
* Constructor that creates a new bordered control with
|
williamr@2
|
48 |
* a specified border.
|
williamr@2
|
49 |
*
|
williamr@2
|
50 |
* @param aBorder The border of the control.
|
williamr@2
|
51 |
*/
|
williamr@2
|
52 |
IMPORT_C CEikBorderedControl(const TGulBorder& aBorder);
|
williamr@2
|
53 |
|
williamr@2
|
54 |
public: /** From @c CCoeControl. */
|
williamr@2
|
55 |
|
williamr@2
|
56 |
/**
|
williamr@2
|
57 |
* Checks whether the control has a border.
|
williamr@2
|
58 |
*
|
williamr@2
|
59 |
* From @c CCoeControl.
|
williamr@2
|
60 |
*
|
williamr@2
|
61 |
* @return @c ETrue if the control has a border, @c EFalse otherwise.
|
williamr@2
|
62 |
*/
|
williamr@2
|
63 |
IMPORT_C TBool HasBorder() const;
|
williamr@2
|
64 |
|
williamr@2
|
65 |
/**
|
williamr@2
|
66 |
* Sets the control's adjacency.
|
williamr@2
|
67 |
*
|
williamr@2
|
68 |
* Declares that a control abuts another control along one edge,
|
williamr@2
|
69 |
* and does not need to be drawn with a full border along that side.
|
williamr@2
|
70 |
* This is for use by layout engines or any user code which lays out
|
williamr@2
|
71 |
* controls next to one another.
|
williamr@2
|
72 |
*
|
williamr@2
|
73 |
* Its intended use is to remove the double border that may occur if
|
williamr@2
|
74 |
* two controls, both with borders, are adjacent within a
|
williamr@2
|
75 |
* container control.
|
williamr@2
|
76 |
*
|
williamr@2
|
77 |
* From @c CCoeControl.
|
williamr@2
|
78 |
*
|
williamr@2
|
79 |
* @param aAdjacent A value from @c TGulAdjacent declaring
|
williamr@2
|
80 |
* which edge of this control is shared.
|
williamr@2
|
81 |
*
|
williamr@2
|
82 |
* @see CCoeControl::SetAdjacent()
|
williamr@2
|
83 |
*/
|
williamr@2
|
84 |
IMPORT_C void SetAdjacent(TInt aAdjacent);
|
williamr@2
|
85 |
|
williamr@2
|
86 |
/**
|
williamr@2
|
87 |
* <b> Not used in S60. </b>
|
williamr@2
|
88 |
*
|
williamr@2
|
89 |
* From @c CCoeControl.
|
williamr@2
|
90 |
*
|
williamr@2
|
91 |
* @param aColorUseList Not used.
|
williamr@2
|
92 |
*/
|
williamr@2
|
93 |
IMPORT_C void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const;
|
williamr@2
|
94 |
|
williamr@2
|
95 |
/**
|
williamr@2
|
96 |
* Handles a change to the control's resources.
|
williamr@2
|
97 |
*
|
williamr@2
|
98 |
* The types of resources handled are those which are shared across
|
williamr@2
|
99 |
* the environment, e.g. colours or fonts. For colour scheme changes,
|
williamr@2
|
100 |
* @c DrawDeferred() is called in order to redraw the control.
|
williamr@2
|
101 |
*
|
williamr@2
|
102 |
* If overriding this method, the implementation must
|
williamr@2
|
103 |
* include a base call to this method.
|
williamr@2
|
104 |
*
|
williamr@2
|
105 |
* From @c CCoeControl.
|
williamr@2
|
106 |
*
|
williamr@2
|
107 |
* @param aType The type of resource that has changed.
|
williamr@2
|
108 |
*/
|
williamr@2
|
109 |
IMPORT_C void HandleResourceChange(TInt aType);
|
williamr@2
|
110 |
|
williamr@2
|
111 |
/**
|
williamr@2
|
112 |
* Handles pointer events.
|
williamr@2
|
113 |
*
|
williamr@2
|
114 |
* This function gets called whenever a pointer event occurs in the
|
williamr@2
|
115 |
* control, i.e. when the pointer is within the control's extent, or when
|
williamr@2
|
116 |
* the control has grabbed the pointer.
|
williamr@2
|
117 |
*
|
williamr@2
|
118 |
* If overriding this method, the implementation must
|
williamr@2
|
119 |
* include a base call to this method.
|
williamr@2
|
120 |
*
|
williamr@2
|
121 |
* From @c CCoeControl.
|
williamr@2
|
122 |
*
|
williamr@2
|
123 |
* @param aPointerEvent The pointer event.
|
williamr@2
|
124 |
*/
|
williamr@2
|
125 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@2
|
126 |
|
williamr@2
|
127 |
public:
|
williamr@2
|
128 |
|
williamr@2
|
129 |
/**
|
williamr@2
|
130 |
* Sets the border type of the control to a type defined in
|
williamr@2
|
131 |
* @c TGulBorder::TBorderType.
|
williamr@2
|
132 |
*
|
williamr@2
|
133 |
* @param aBorderType The border type to be set.
|
williamr@2
|
134 |
*/
|
williamr@2
|
135 |
IMPORT_C void SetBorder(TGulBorder::TBorderType aBorderType);
|
williamr@2
|
136 |
|
williamr@2
|
137 |
/**
|
williamr@2
|
138 |
* Sets the border type.
|
williamr@2
|
139 |
* Any one of the values from the enums @c TGulBorder::TBorderType
|
williamr@2
|
140 |
* or @c TGulBorder::TLogicalType specifies a valid border type.
|
williamr@2
|
141 |
*
|
williamr@2
|
142 |
* Custom border types can be created by selecting
|
williamr@2
|
143 |
* one value from enum @c TGulBorder::T3DStyle,
|
williamr@2
|
144 |
* one value from enum @c TGulBorder::TConstructionStyle,
|
williamr@2
|
145 |
* at most one value from enum @c TGulBorder::TOutlineStyle,
|
williamr@2
|
146 |
* at most one value from enum @c TGulBorder::TInlineStyle,
|
williamr@2
|
147 |
* at least one value from enum @c TGulBorder::TThickness and
|
williamr@2
|
148 |
* at least one value from enum @c TGulBorder::TRounding
|
williamr@2
|
149 |
* and performing an OR operation to these.
|
williamr@2
|
150 |
*
|
williamr@2
|
151 |
* @param aBorderType The border type to be set.
|
williamr@2
|
152 |
*/
|
williamr@2
|
153 |
IMPORT_C void SetBorder(TInt aBorderType);
|
williamr@2
|
154 |
|
williamr@2
|
155 |
/**
|
williamr@2
|
156 |
* Gets the control's border.
|
williamr@2
|
157 |
*
|
williamr@2
|
158 |
* @return The border of the control.
|
williamr@2
|
159 |
*/
|
williamr@2
|
160 |
IMPORT_C TGulBorder Border() const;
|
williamr@2
|
161 |
|
williamr@2
|
162 |
protected: /** From @c CCoeControl. */
|
williamr@2
|
163 |
|
williamr@2
|
164 |
/**
|
williamr@2
|
165 |
* Draws the border around the control. This function also clears the
|
williamr@2
|
166 |
* central area if the @c IsBlank() method returns @c ETrue.
|
williamr@2
|
167 |
*
|
williamr@2
|
168 |
* From @c CCoeControl
|
williamr@2
|
169 |
*
|
williamr@2
|
170 |
* @param aRect Not used.
|
williamr@2
|
171 |
*
|
williamr@2
|
172 |
* @see CCoeControl::IsBlank()
|
williamr@2
|
173 |
* @see Border()
|
williamr@2
|
174 |
*/
|
williamr@2
|
175 |
IMPORT_C void Draw(const TRect& aRect) const;
|
williamr@2
|
176 |
|
williamr@2
|
177 |
/**
|
williamr@2
|
178 |
* Writes the internal state of the control and its components to @c aWriteStream.
|
williamr@2
|
179 |
* Does nothing in release mode.
|
williamr@2
|
180 |
*
|
williamr@2
|
181 |
* Designed to be overridden and base called from subclasses.
|
williamr@2
|
182 |
*
|
williamr@2
|
183 |
* From @c CCoeControl
|
williamr@2
|
184 |
*
|
williamr@2
|
185 |
* @param[in,out] aWriteStream A connected write stream.
|
williamr@2
|
186 |
*/
|
williamr@2
|
187 |
IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
|
williamr@2
|
188 |
|
williamr@2
|
189 |
private: /** From @c CAknControl. */
|
williamr@2
|
190 |
|
williamr@2
|
191 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@2
|
192 |
|
williamr@2
|
193 |
protected:
|
williamr@2
|
194 |
|
williamr@2
|
195 |
/** The control's border. */
|
williamr@2
|
196 |
TGulBorder iBorder;
|
williamr@2
|
197 |
|
williamr@2
|
198 |
private:
|
williamr@2
|
199 |
TInt iSpare[2];
|
williamr@2
|
200 |
};
|
williamr@2
|
201 |
|
williamr@2
|
202 |
#endif // __EIKBCTRL_H__
|