1.1 --- a/epoc32/include/lafmain.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,266 +0,0 @@
1.4 -// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// 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
1.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -//
1.18 -
1.19 -#ifndef __LAFMAIN_H__
1.20 -#define __LAFMAIN_H__
1.21 -
1.22 -#include <e32std.h>
1.23 -#include <e32base.h>
1.24 -#include <gulbordr.h>
1.25 -#include <gulcolor.h>
1.26 -#include <frmtlay.h>
1.27 -
1.28 -class CCoeControl;
1.29 -class CFont;
1.30 -class TLogicalFont;
1.31 -class MLafEnv;
1.32 -
1.33 -
1.34 -class CLafEdwinCustomDrawBase : public CBase, public MFormCustomDraw
1.35 -/** LAF support for custom drawing of Edwins.
1.36 -
1.37 -This class is used by CEikEdwin to draw lines in plain text editors. It does
1.38 -not work in rich text editors, as it assumes the line spacing is constant.
1.39 -
1.40 -The custom drawing interface is defined by the MFormCustomDraw class.
1.41 -
1.42 -@publishedPartner
1.43 -@released */
1.44 - {
1.45 -public:
1.46 - /** Allocates and constructs the custom drawer.
1.47 -
1.48 - @param aEnv LAF environment functions
1.49 - @param aControl The Edwin control
1.50 - @return New custom drawer */
1.51 - IMPORT_C static CLafEdwinCustomDrawBase* NewL(const MLafEnv& aEnv,const CCoeControl& aControl);
1.52 -public: // from MFormCustomDraw
1.53 - /** Implements MFormCustomDraw::DrawBackground() to draw the Edwin background.
1.54 -
1.55 - See that function for a full description.
1.56 -
1.57 - @param aParam Drawing parameters
1.58 - @param aBackground Default background colour
1.59 - @param aDrawn On return, the rectangle to which the function has drawn */
1.60 - IMPORT_C void DrawBackground(const TParam& aParam,const TRgb& aBackground,TRect& aDrawn) const;
1.61 - /** Gets the physical colour that maps to a specified logical colour.
1.62 -
1.63 - @param aColorIndex Logical colour
1.64 - @param aDefaultColor The default physical colour. This is the colour to be
1.65 - used if no translation is performed. This allows translation to change certain
1.66 - indices but not others ( by passing the default colour back unchanged).
1.67 - @return Physical colour */
1.68 - IMPORT_C TRgb SystemColor(TUint aColorIndex,TRgb aDefaultColor) const;
1.69 -public:
1.70 - /** Notifies the drawer that a MEikEdwinObserver::EEventFormatChanged event has
1.71 - occurred for the Edwin. */
1.72 - IMPORT_C virtual void LineSpacingChanged();
1.73 -protected:
1.74 - /** Constructor that initialises data members.
1.75 -
1.76 - @param aEnv LAF environment functions
1.77 - @param aControl The Edwin control */
1.78 - IMPORT_C CLafEdwinCustomDrawBase(const MLafEnv& aEnv,const CCoeControl& aControl);
1.79 -protected:
1.80 - /** LAF environment functions
1.81 -
1.82 - This is initialised by the constructor. */
1.83 - const MLafEnv& iEnv;
1.84 - /** The Edwin control.
1.85 -
1.86 - This is initialised by the constructor. */
1.87 - const CCoeControl& iControl;
1.88 -private:
1.89 - /** Unused. */
1.90 - TInt iSpare;
1.91 - };
1.92 -
1.93 -
1.94 -class CLafEdwinCustomWrapBase : public CBase, public MFormCustomWrap
1.95 -/** LAF support for custom line breaking in Edwins.
1.96 -
1.97 -This class is used by CEikEdwin to determine how to place line breaks.
1.98 -
1.99 -The custom line breaking interface is defined by the MFormCustomWrap class.
1.100 -
1.101 -@publishedPartner
1.102 -@released */
1.103 - {
1.104 -public:
1.105 - /** Allocates and constructs the custom line breaker.
1.106 -
1.107 - @param aControl The Edwin control
1.108 - @return The new line breaker */
1.109 - IMPORT_C static CLafEdwinCustomWrapBase* NewL(const CCoeControl& aControl);
1.110 - /** Destructor. */
1.111 - IMPORT_C ~CLafEdwinCustomWrapBase();
1.112 -public: // from MFormCustomWrap
1.113 - /** Gets the line break class for a Unicode character.
1.114 -
1.115 - This implements MFormCustomWrap::LineBreakClass().
1.116 -
1.117 - @param aCode The Unicode character code
1.118 - @param aRangeStart On return, contains the Unicode character code at the start
1.119 - of the range including aCode that shares the same line break class as aCode.
1.120 - @param aRangeEnd On return, contains the Unicode character code at the end
1.121 - of the range including aCode that shares the same line break class as aCode
1.122 - @return The line break class assigned to the character. Line break classes
1.123 - are enumerated with MTmCustom::EOpLineBreakClass etc. */
1.124 - IMPORT_C TUint LineBreakClass(TUint aCode,TUint& aRangeStart,TUint& aRangeEnd) const;
1.125 - /** Tests whether a line break is possible between two characters.
1.126 -
1.127 - This implements MFormCustomWrap::LineBreakPossible().
1.128 -
1.129 - @param aPrevClass The line break class of the previous non-space character.
1.130 - @param aNextClass The line break class of the next non-space character.
1.131 - @param aHaveSpaces True if there are one or more space characters (with a line
1.132 - break class of MTmCustom::ESpLineBreakClass) between aPrevClass and aNextClass;
1.133 - false if not.
1.134 - @return ool True if a line break is possible between characters with the two
1.135 - line break classes, false if not */
1.136 - IMPORT_C TBool LineBreakPossible(TUint aPrevClass,TUint aNextClass,TBool aHaveSpaces) const;
1.137 - /** Gets the position of the first or last possible line break position in a text
1.138 - string.
1.139 -
1.140 - This implements MFormCustomWrap::GetLineBreakInContext().
1.141 -
1.142 - @param aText A string containing characters of class MTmCustom::ESaLineBreakClass.
1.143 -
1.144 - @param aMinBreakPos A position within aText at which to begin searching for
1.145 - a possible line break position.
1.146 - @param aMaxBreakPos A position within aText at which to stop searching for
1.147 - a possible line break position.
1.148 - @param aForwards If ETrue, the function gets the first possible line break
1.149 - position (searches forwards from aMinBreakPos); if EFalse, gets the last one
1.150 - (searches backwards from aMaxBreakPos).
1.151 - @param aBreakPos On return, the position of the first or last possible line
1.152 - break within aText. This must be greater than zero and less than aText.Length()
1.153 - - 1, and must also be in the range aMinBreakPos to aMaxBreakPos.
1.154 - @return True if a possible line break position is found, false if not */
1.155 - IMPORT_C TBool GetLineBreakInContext(const TDesC& aText,TInt aMinBreakPos,TInt aMaxBreakPos,TBool aForwards,TInt& aBreakPos) const;
1.156 - /** Tests whether a character can overhang the right margin.
1.157 -
1.158 - @param aChar The Unicode character code of interest
1.159 - @return True if the character specified can overhang the right margin, false
1.160 - if not */
1.161 - IMPORT_C TBool IsHangingCharacter(TUint aChar) const;
1.162 -private:
1.163 - /** Unused. */
1.164 - IMPORT_C void MFormCustomWrap_Reserved_1();
1.165 - /** Unused. */
1.166 - IMPORT_C void MFormCustomWrap_Reserved_2();
1.167 -
1.168 -protected:
1.169 - /** Constructor.
1.170 -
1.171 - @param aControl The Edwin control */
1.172 - IMPORT_C CLafEdwinCustomWrapBase(const CCoeControl& aControl);
1.173 -protected:
1.174 - /** The Edwin control, initialised by the constructor. */
1.175 - const CCoeControl& iControl;
1.176 -private:
1.177 - /** Unused. */
1.178 - TInt iSpare;
1.179 - };
1.180 -
1.181 -class MLafEnv
1.182 -/** LAF interface to access the current system environment settings.
1.183 -
1.184 -It is implemented by the Uikon Core, and effectively allows the LAF
1.185 -limited access to the current thread's CEikonEnv.
1.186 -
1.187 -@publishedPartner
1.188 -@released
1.189 -*/
1.190 -//@publishedAll @deprecated
1.191 - {
1.192 -public:
1.193 - /** Gets the environment's nearest match to the specified logical font.
1.194 -
1.195 - The return value is never NULL.
1.196 -
1.197 - @param aLogicalFont Logical font to match.
1.198 - @return The font that most closely matches aLogicalFont. */
1.199 - virtual const CFont* Font(const TLogicalFont& aLogicalFont) const=0;
1.200 -
1.201 - /** Gets an environment bitmap specified by UID.
1.202 -
1.203 - @param aBmpUid The UID of the bitmap to retrieve.
1.204 - @return The bitmap. */
1.205 - virtual const CFbsBitmap* Bitmap(TUid aBmpUid) const=0;
1.206 -
1.207 - /** Gets the physical (TRgb) colour that corresponds to the specified
1.208 - logical colour, for a specified control.
1.209 -
1.210 - @param aLogicalColor Logical colour.
1.211 - @param aControl Control for which to get the mapping. Note controls can override
1.212 - the system mappings.
1.213 - @return Physical colour. */
1.214 - virtual TRgb ControlColor(TLogicalColor aLogicalColor, const CCoeControl& aControl) const=0;
1.215 -
1.216 - /** Gets the environment's physical (TRgb) colour that corresponds to
1.217 - the specified logical colour.
1.218 -
1.219 - @param aLogicalColor Logical colour.
1.220 - @param aColorListUid UID of the colour list from which to get the mapping. The default
1.221 - value is the environment's list.
1.222 - @return Physical colour. */
1.223 - virtual TRgb Color(TLogicalColor aLogicalColor, TUid aColorListUid=KNullUid) const=0;
1.224 -
1.225 - /** Gets the environment setting for the default display mode.
1.226 -
1.227 - @return Display mode. */
1.228 - virtual TDisplayMode DefaultDisplayMode() const=0;
1.229 - };
1.230 -
1.231 -class MLafClientRectResolver
1.232 -/** Interface that works out how screen furniture reduces the available screen area
1.233 -for applications.
1.234 -
1.235 -The interface is implemented by the UI and can be called by the LAF to get information
1.236 -on the areas of screen furniture.
1.237 -
1.238 -@see LafAppUi::ClientRect()
1.239 -@publishedPartner
1.240 -@released */
1.241 - {
1.242 -public:
1.243 - /** Flags for types of screen furniture. */
1.244 - enum TScreenFurniture
1.245 - {
1.246 - /** Menu bar. */
1.247 - EMenuBar,
1.248 - /** Button group. */
1.249 - EButtonGroup,
1.250 - /** Tool band. */
1.251 - EToolBand,
1.252 - /** Title band. */
1.253 - ETitleBand,
1.254 - /** Status pane. */
1.255 - EStatusPane,
1.256 - /** Command Button Array */
1.257 - ECba
1.258 - };
1.259 -public:
1.260 - /** Calculates how a specified type of screen furniture reduces the application
1.261 - area of a specified screen rectangle.
1.262 -
1.263 - @param aScreenFurniture Type of screen furniture.
1.264 - @param aRect Screen rectangle from which to remove area of specified furniture.
1.265 - On return, the modified rectangle. */
1.266 - virtual void ReduceRect(TScreenFurniture aScreenFurniture,TRect& aRect) const=0;
1.267 - };
1.268 -
1.269 -#endif //__LAFMAIN_H__