Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
31 class CLafEdwinCustomDrawBase : public CBase, public MFormCustomDraw
32 /** LAF support for custom drawing of Edwins.
34 This class is used by CEikEdwin to draw lines in plain text editors. It does
35 not work in rich text editors, as it assumes the line spacing is constant.
37 The custom drawing interface is defined by the MFormCustomDraw class.
43 /** Allocates and constructs the custom drawer.
45 @param aEnv LAF environment functions
46 @param aControl The Edwin control
47 @return New custom drawer */
48 IMPORT_C static CLafEdwinCustomDrawBase* NewL(const MLafEnv& aEnv,const CCoeControl& aControl);
49 public: // from MFormCustomDraw
50 /** Implements MFormCustomDraw::DrawBackground() to draw the Edwin background.
52 See that function for a full description.
54 @param aParam Drawing parameters
55 @param aBackground Default background colour
56 @param aDrawn On return, the rectangle to which the function has drawn */
57 IMPORT_C void DrawBackground(const TParam& aParam,const TRgb& aBackground,TRect& aDrawn) const;
58 /** Gets the physical colour that maps to a specified logical colour.
60 @param aColorIndex Logical colour
61 @param aDefaultColor The default physical colour. This is the colour to be
62 used if no translation is performed. This allows translation to change certain
63 indices but not others ( by passing the default colour back unchanged).
64 @return Physical colour */
65 IMPORT_C TRgb SystemColor(TUint aColorIndex,TRgb aDefaultColor) const;
67 /** Notifies the drawer that a MEikEdwinObserver::EEventFormatChanged event has
68 occurred for the Edwin. */
69 IMPORT_C virtual void LineSpacingChanged();
71 /** Constructor that initialises data members.
73 @param aEnv LAF environment functions
74 @param aControl The Edwin control */
75 IMPORT_C CLafEdwinCustomDrawBase(const MLafEnv& aEnv,const CCoeControl& aControl);
77 /** LAF environment functions
79 This is initialised by the constructor. */
81 /** The Edwin control.
83 This is initialised by the constructor. */
84 const CCoeControl& iControl;
91 class CLafEdwinCustomWrapBase : public CBase, public MFormCustomWrap
92 /** LAF support for custom line breaking in Edwins.
94 This class is used by CEikEdwin to determine how to place line breaks.
96 The custom line breaking interface is defined by the MFormCustomWrap class.
102 /** Allocates and constructs the custom line breaker.
104 @param aControl The Edwin control
105 @return The new line breaker */
106 IMPORT_C static CLafEdwinCustomWrapBase* NewL(const CCoeControl& aControl);
108 IMPORT_C ~CLafEdwinCustomWrapBase();
109 public: // from MFormCustomWrap
110 /** Gets the line break class for a Unicode character.
112 This implements MFormCustomWrap::LineBreakClass().
114 @param aCode The Unicode character code
115 @param aRangeStart On return, contains the Unicode character code at the start
116 of the range including aCode that shares the same line break class as aCode.
117 @param aRangeEnd On return, contains the Unicode character code at the end
118 of the range including aCode that shares the same line break class as aCode
119 @return The line break class assigned to the character. Line break classes
120 are enumerated with MTmCustom::EOpLineBreakClass etc. */
121 IMPORT_C TUint LineBreakClass(TUint aCode,TUint& aRangeStart,TUint& aRangeEnd) const;
122 /** Tests whether a line break is possible between two characters.
124 This implements MFormCustomWrap::LineBreakPossible().
126 @param aPrevClass The line break class of the previous non-space character.
127 @param aNextClass The line break class of the next non-space character.
128 @param aHaveSpaces True if there are one or more space characters (with a line
129 break class of MTmCustom::ESpLineBreakClass) between aPrevClass and aNextClass;
131 @return ool True if a line break is possible between characters with the two
132 line break classes, false if not */
133 IMPORT_C TBool LineBreakPossible(TUint aPrevClass,TUint aNextClass,TBool aHaveSpaces) const;
134 /** Gets the position of the first or last possible line break position in a text
137 This implements MFormCustomWrap::GetLineBreakInContext().
139 @param aText A string containing characters of class MTmCustom::ESaLineBreakClass.
141 @param aMinBreakPos A position within aText at which to begin searching for
142 a possible line break position.
143 @param aMaxBreakPos A position within aText at which to stop searching for
144 a possible line break position.
145 @param aForwards If ETrue, the function gets the first possible line break
146 position (searches forwards from aMinBreakPos); if EFalse, gets the last one
147 (searches backwards from aMaxBreakPos).
148 @param aBreakPos On return, the position of the first or last possible line
149 break within aText. This must be greater than zero and less than aText.Length()
150 - 1, and must also be in the range aMinBreakPos to aMaxBreakPos.
151 @return True if a possible line break position is found, false if not */
152 IMPORT_C TBool GetLineBreakInContext(const TDesC& aText,TInt aMinBreakPos,TInt aMaxBreakPos,TBool aForwards,TInt& aBreakPos) const;
153 /** Tests whether a character can overhang the right margin.
155 @param aChar The Unicode character code of interest
156 @return True if the character specified can overhang the right margin, false
158 IMPORT_C TBool IsHangingCharacter(TUint aChar) const;
161 IMPORT_C void MFormCustomWrap_Reserved_1();
163 IMPORT_C void MFormCustomWrap_Reserved_2();
168 @param aControl The Edwin control */
169 IMPORT_C CLafEdwinCustomWrapBase(const CCoeControl& aControl);
171 /** The Edwin control, initialised by the constructor. */
172 const CCoeControl& iControl;
179 /** LAF interface to access the current system environment settings.
181 It is implemented by the Uikon Core, and effectively allows the LAF
182 limited access to the current thread's CEikonEnv.
187 //@publishedAll @deprecated
190 /** Gets the environment's nearest match to the specified logical font.
192 The return value is never NULL.
194 @param aLogicalFont Logical font to match.
195 @return The font that most closely matches aLogicalFont. */
196 virtual const CFont* Font(const TLogicalFont& aLogicalFont) const=0;
198 /** Gets an environment bitmap specified by UID.
200 @param aBmpUid The UID of the bitmap to retrieve.
201 @return The bitmap. */
202 virtual const CFbsBitmap* Bitmap(TUid aBmpUid) const=0;
204 /** Gets the physical (TRgb) colour that corresponds to the specified
205 logical colour, for a specified control.
207 @param aLogicalColor Logical colour.
208 @param aControl Control for which to get the mapping. Note controls can override
210 @return Physical colour. */
211 virtual TRgb ControlColor(TLogicalColor aLogicalColor, const CCoeControl& aControl) const=0;
213 /** Gets the environment's physical (TRgb) colour that corresponds to
214 the specified logical colour.
216 @param aLogicalColor Logical colour.
217 @param aColorListUid UID of the colour list from which to get the mapping. The default
218 value is the environment's list.
219 @return Physical colour. */
220 virtual TRgb Color(TLogicalColor aLogicalColor, TUid aColorListUid=KNullUid) const=0;
222 /** Gets the environment setting for the default display mode.
224 @return Display mode. */
225 virtual TDisplayMode DefaultDisplayMode() const=0;
228 class MLafClientRectResolver
229 /** Interface that works out how screen furniture reduces the available screen area
232 The interface is implemented by the UI and can be called by the LAF to get information
233 on the areas of screen furniture.
235 @see LafAppUi::ClientRect()
240 /** Flags for types of screen furniture. */
241 enum TScreenFurniture
253 /** Command Button Array */
257 /** Calculates how a specified type of screen furniture reduces the application
258 area of a specified screen rectangle.
260 @param aScreenFurniture Type of screen furniture.
261 @param aRect Screen rectangle from which to remove area of specified furniture.
262 On return, the modified rectangle. */
263 virtual void ReduceRect(TScreenFurniture aScreenFurniture,TRect& aRect) const=0;
266 #endif //__LAFMAIN_H__