AknLayoutUtils Class Reference

class AknLayoutUtils

Utility classes to build layout based on European LAF from resource files. (can be used by applications)

Methods in this class are designed to be called from your control's SizeChanged() method!

This class knows the specification's coordinate data format and ensures that different types of controls are positioned and setup correctly according to European LAF.

This class helps you with positioning labels, controls, rects and other things to according to LAF specification. (It is NOT trivial to get it correct and this adjusts easily to changes in the LAF specification - if you're not using this, remember to read the whole LAF specification - especially the beginning and the end with color and especially how text margins and widths interact!!)

(idea of this class is that when specification of one component changes, only resource file needs to be changed and when you get new product with new specification format, only this module needs to be changed and resources rewritten from the specification. And when component's specification changes, only the component need to be changed (usually only change is what components are inside it and how it calls this module.).. => all controls have common format that decides its layout!

Parent rectangles are always coordinates of LAF specification's parent rectangle in the screen.

To use this, call one of the methods in your SizeChanged() and then you'll need to make sure you draw the area between controls using ClearBetweenRects() call from egul library. (CCoeControl::Rect() helps with that...)

A Tip: You do not want to use any dynamic calculation of layouts! It is almost always an error to do so! => Do not allow layouts that have not been specified!

(If LAF spec has many numbers and you need to dynamically choose between them, then keep the numbers in code as function-local using SAknLayoutText/SAknLayoutRect/... -structs..)

You'll want to use TAknLayoutRect and TAknLayoutText too to build layout for your custom controls.

Public Member Functions
IMPORT_C TAknCbaLocationCbaLocation()
TInt CorrectBaseline(TInt, TInt, TInt)
voidCorrectFontId(TRect, TInt, TInt, TInt, TInt &)
IMPORT_C CAknLayoutFont *CreateLayoutFontFromSpecificationL(const TAknFontSpecification &)
IMPORT_C CAknLayoutFont *CreateLayoutFontFromSpecificationL(const TTypeface &, const TAknFontSpecification &)
IMPORT_C TIntCursorAscentFromFont(const TFontSpec &)
IMPORT_C voidCursorExtensionsFromFont(const TFontSpec &, TInt &, TInt &)
IMPORT_C TIntCursorHeightFromFont(const TFontSpec &)
IMPORT_C TIntCursorWidthFromFont(const TFontSpec &)
IMPORT_C CEikScrollBarFrame::TScrollBarTypeDefaultScrollBarType(CAknAppUiBase *)
IMPORT_C TIntEdwinLinesWithinHeight(const TAknTextLineLayout &, TInt, TInt, TInt &)
IMPORT_C const CFont *FontFromId(TInt, const CFont *)
IMPORT_C const CFont *FontFromName(const TDesC &)
IMPORT_C voidGetEdwinVerticalPositionAndHeightFromLines(TInt, const TAknTextLineLayout &, TInt, TInt, TInt &, TInt &)
IMPORT_C TGulAlignmentGulAlignFromId(TInt)
TRect HighlightBasedRect(const TRect &, CCoeControl *)
voidHighlightExtensionsFromFont(const TInt, TInt &, TInt &, TInt &, TInt &)
IMPORT_C TIntHighlightLeftPixelsFromFont(const TFontSpec &)
IMPORT_C TIntHighlightRightPixelsFromFont(const TFontSpec &)
IMPORT_C voidLayoutControl(CCoeControl *, const TRect &, TInt)
IMPORT_C voidLayoutControl(CCoeControl *, const TRect &, TResourceReader &)
IMPORT_C voidLayoutControl(CCoeControl *, const TRect &, const SAknLayoutControl &)
IMPORT_C voidLayoutControl(CCoeControl *, const TRect &, const TAknWindowLineLayout &)
IMPORT_C voidLayoutControl(CCoeControl *, const TRect &, TInt, TInt, TInt, TInt, TInt, TInt, TInt)
IMPORT_C voidLayoutEdwin(CEikEdwin *, const TRect &, TInt, TInt, const CFont *, TBool)
IMPORT_C voidLayoutEdwin(CEikEdwin *, const TRect &, TResourceReader &, TInt, const CFont *, TBool)
IMPORT_C voidLayoutEdwin(CEikEdwin *, const TRect &, const SAknLayoutEdwin &, const CFont *, TBool)
IMPORT_C voidLayoutEdwin(CEikEdwin *, const TRect &, const TAknMultiLineTextLayout &, const CFont *, TBool)
IMPORT_C voidLayoutEdwin(CEikEdwin *, const TRect &, const TAknMultiLineTextLayout &, TAknsQsnTextColorsIndex, const CFont *, TBool)
IMPORT_C voidLayoutEdwin(CEikEdwin *, const TRect &, const TAknTextLineLayout &, const CFont *, TBool)
IMPORT_C voidLayoutEdwin(CEikEdwin *, const TRect &, const TAknTextLineLayout &, TAknsQsnTextColorsIndex, const CFont *, TBool)
IMPORT_C voidLayoutEdwin(CEikEdwin *, const TRect &, const TAknTextLineLayout &, TInt, TInt, TAknsQsnTextColorsIndex, TInt &)
IMPORT_C voidLayoutEdwin(CEikEdwin *, const TRect &, TInt, TInt, TInt, TInt, TInt, TInt, TInt, TInt, TInt, const CFont *, TBool)
IMPORT_C voidLayoutEdwin(CEikEdwin *, const TRect &, TInt, TInt, TInt, TInt, TInt, TInt, TInt, TInt, TInt, TAknsQsnTextColorsIndex, const CFont *, TBool)
IMPORT_C const CAknLayoutFont *LayoutFontFromId(TInt, const CAknLayoutFont *)
IMPORT_C voidLayoutHorizontalScrollBar(CEikScrollBarFrame *, const TRect &, const TAknWindowLineLayout &)
IMPORT_C voidLayoutImage(CEikImage *, const TRect &, TInt)
IMPORT_C voidLayoutImage(CEikImage *, const TRect &, TResourceReader &)
IMPORT_C voidLayoutImage(CEikImage *, const TRect &, const SAknLayoutControl &)
IMPORT_C voidLayoutImage(CEikImage *, const TRect &, const TAknWindowLineLayout &)
IMPORT_C voidLayoutImage(CEikImage *, const TRect &, TInt, TInt, TInt, TInt, TInt, TInt, TInt)
IMPORT_C voidLayoutLabel(CEikLabel *, const TRect &, TInt, const CFont *)
IMPORT_C voidLayoutLabel(CEikLabel *, const TRect &, TResourceReader &, const CFont *)
IMPORT_C voidLayoutLabel(CEikLabel *, const TRect &, const SAknLayoutLabel &, const CFont *)
IMPORT_C voidLayoutLabel(CEikLabel *, const TRect &, const TAknMultiLineTextLayout &, const CFont *)
IMPORT_C voidLayoutLabel(CEikLabel *, const TRect &, const TAknTextLineLayout &, const CFont *)
IMPORT_C voidLayoutLabel(CEikLabel *, const TRect &, TInt, TInt, TInt, TInt, TInt, TInt, TInt, TInt, const CFont *)
IMPORT_C TBoolLayoutMetricsPosition(TAknLayoutMetrics, TPoint &)
IMPORT_C TBoolLayoutMetricsRect(TAknLayoutMetrics, TRect &)
IMPORT_C TBoolLayoutMetricsSize(TAknLayoutMetrics, TSize &)
IMPORT_C voidLayoutMfne(CEikMfne *, const TRect &, TInt)
IMPORT_C voidLayoutMfne(CEikMfne *, const TRect &, TResourceReader &)
IMPORT_C voidLayoutMfne(CEikMfne *, const TRect &, const SAknLayoutMfne &)
IMPORT_C voidLayoutMfne(CEikMfne *, const TRect &, const TAknTextLineLayout &)
IMPORT_C voidLayoutMfne(CEikMfne *, const TRect &, TInt, TInt, TInt, TInt, TInt, TInt, TInt)
IMPORT_C TBoolLayoutMirrored()
IMPORT_C voidLayoutSecretEditor(CEikSecretEditor *, const TRect &, const SAknLayoutText &)
IMPORT_C voidLayoutSecretEditor(CEikSecretEditor *, const TRect &, const TAknTextLineLayout &)
IMPORT_C voidLayoutVerticalScrollBar(CEikScrollBarFrame *, const TRect &, const TAknWindowLineLayout &)
IMPORT_C TBoolMSKEnabled()
IMPORT_C TAknMainPaneStateMainPaneState()
const CAknLayoutFont *MatchFontFromSystemFontArray(const TFontSpec &, MGraphicsDeviceMap *)
IMPORT_C TRectMinimizedEdwinRect(const CEikEdwin *)
IMPORT_C voidOverrideControlColorL(CCoeControl &, TLogicalColor, TRgb)
IMPORT_C TBoolPenEnabled()
IMPORT_C TRectRectFromCoords(const TRect &, TInt, TInt, TInt, TInt, TInt, TInt)
IMPORT_C TBoolScalableLayoutInterfaceAvailable()
IMPORT_C ESubVariantFlagSubVariant()
IMPORT_C CGraphicsContext::TTextAlignTextAlignFromId(TInt)
IMPORT_C TRectTextRectFromCoords(const TRect &, const CFont *, TInt, TInt, TInt, TInt, TInt)
IMPORT_C EVariantFlagVariant()
Public Member Enumerations
enumTAknCbaLocation { EAknCbaLocationBottom, EAknCbaLocationRight, EAknCbaLocationLeft }
enumTAknLayoutMetrics {
EScreen, EApplicationWindow, EStatusPane, EMainPane, EControlPane, ESignalPane, EContextPane, ETitlePane, EBatteryPane, EUniversalIndicatorPane, ENaviPane, EFindPane, EWallpaperPane, EIndicatorPane, EAColunm, EBColunm, ECColunm, EDColunm, EStatusPaneSecondary, EControlPaneSecondary, EStaconTop, EStaconBottom, EPopupParent, EStatusPaneBottom = EStatusPaneSecondary, EControlPaneBottom = EControlPaneSecondary, EControlPaneTop = EControlPane, EStatusPaneTop = EStatusPane
}
enumTAknMainPaneState { EAknMainPaneForTinyStatusPane = 0x0001 }
Public Member Type Definitions
typedef SAknLayoutRect SAknLayoutControl
typedef SAknLayoutTextMultiline SAknLayoutEdwin
typedef SAknLayoutRect SAknLayoutImage
typedef SAknLayoutTextMultiline SAknLayoutLabel
typedef SAknLayoutText SAknLayoutMfne
typedef SAknLayoutText SAknLayoutSecEd

Member Functions Documentation

CbaLocation()

IMPORT_C TAknCbaLocationCbaLocation()[static]

This method tells location of softkeys (CBA) field in current running application. Possible location of softkeys are bottom (portrait and landscape), left and right (only landscape).

3.0

TAknCbaLocation

CorrectBaseline(TInt, TInt, TInt)

TInt CorrectBaseline(TIntaParentHeight,
TIntaBaseline,
TIntaFontId
)[static]

This method returns a new value for a baseline, based upon a value for bottom and a value for height. For legacy layout data, the baseline will be correct, and this method will detect that it is a legacy font id and just return aBottom. However, for scalable layout data, the bottom value will be hidden inside the old baseline variable, so call this method passing in 'iB', NOT passing in 'ib' ... e.g.: (the following line is an example, so is ok to have commented out code) TInt newbaseline = CorrectBaseline(myLayoutLine.iB, myLayoutLine.iFont);

2.8

new Baseline value

Parameters

TInt aParentHeight
TInt aBaseline
TInt aFontIdFontId of text pane (for scalable layouts, this will encode the height)

CorrectFontId(TRect, TInt, TInt, TInt, TInt &)

voidCorrectFontId(TRectaParent,
TIntat,
TIntaH,
TIntab,
TInt &aFontId
)[static]

This method updates fontid if it has ELayoutEmpty or parent relative values

Parameters

TRect aParent
TInt at
TInt aH
TInt ab
TInt & aFontId

CreateLayoutFontFromSpecificationL(const TAknFontSpecification &)

IMPORT_C CAknLayoutFont *CreateLayoutFontFromSpecificationL(const TAknFontSpecification &aSpec)[static]

Return a fully constructed CAknLayoutFont object based upon the specification passed in. The Avkon font specifiation object uses TAknFontCategory to determine the font.

The font object is returned as non-const, since it is owned and will eventually be deleted by the client.

pointer to a CAknLayoutFont object, owned by the caller

Parameters

const TAknFontSpecification & aSpecS60 font specification object

CreateLayoutFontFromSpecificationL(const TTypeface &, const TAknFontSpecification &)

IMPORT_C CAknLayoutFont *CreateLayoutFontFromSpecificationL(const TTypeface &aTypeface,
const TAknFontSpecification &aSpec
)[static]

Return a fully constructed CAknLayoutFont object based upon the typeface and specification passed in. The TTypeface object contains a typeface name that is used as the primary key to select a font. The S60 font specifiation object is also used, but any value of TAknFontCategory passed in is reset to EAknFontCategoryUndefined, and is not used to select the font.

The font object is returned as non-const, since it is owned and will eventually be deleted by the client.

pointer to a CAknLayoutFont object, owned by the caller

Parameters

const TTypeface & aTypefaceSymbian Typface object
const TAknFontSpecification & aSpecS60 font specification object

CursorAscentFromFont(const TFontSpec &)

IMPORT_C TIntCursorAscentFromFont(const TFontSpec &aFont)[static]

Parameters

const TFontSpec & aFont

CursorExtensionsFromFont(const TFontSpec &, TInt &, TInt &)

IMPORT_C voidCursorExtensionsFromFont(const TFontSpec &,
TInt &aFirstExtension,
TInt &aSecondExtension
)[static]

Parameters

const TFontSpec &
TInt & aFirstExtension
TInt & aSecondExtension

CursorHeightFromFont(const TFontSpec &)

IMPORT_C TIntCursorHeightFromFont(const TFontSpec &aFont)[static]

Parameters

const TFontSpec & aFont

CursorWidthFromFont(const TFontSpec &)

IMPORT_C TIntCursorWidthFromFont(const TFontSpec &aFont)[static]

Parameters

const TFontSpec & aFont

DefaultScrollBarType(CAknAppUiBase *)

IMPORT_C CEikScrollBarFrame::TScrollBarTypeDefaultScrollBarType(CAknAppUiBase *aApplication)[static]

Parameters

CAknAppUiBase * aApplication

EdwinLinesWithinHeight(const TAknTextLineLayout &, TInt, TInt, TInt &)

IMPORT_C TIntEdwinLinesWithinHeight(const TAknTextLineLayout &aLayout,
TIntaBaselineSeparationOverride,
TIntaMaxHeight,
TInt &aUsedHeight
)[static]

Utility routine to give the number of text lines that will completely fit, including room for highlights, within the given height, when the passed in layout is being used.

Note that the NumberOfLinesShown() value from the TAknTextLineLayout object is not taken into consideration. This routine ignores it, and returns number of lines based upon the font metrics, hightlight specification, and the passed in maximum height.

Note that this API does not cause a layout of the editor.

3.1

The number of lines which completely fit

Parameters

const TAknTextLineLayout & aLayoutS60 layout object for the text to be laid out in the editor
TInt aBaselineSeparationOverridevertical separation of baselines overriding aLayout, if not KAknLayoutUtilsDoNotOverride
TInt aMaxHeightInput maximum height to use for the editor.
TInt & aUsedHeightReturns the number of pixels required for the lines that fit

FontFromId(TInt, const CFont *)

IMPORT_C const CFont *FontFromId(TIntaFontId,
const CFont *aCustomFont = 0
)[static]

Method to return a useable system font reference from a S60 font enumeration from among the supported list.

This method should only be used if application code needs to render its own graphics. That is, it is not using S60 controls and furthermore not using the recommended methods AknLayoutUtils::LayoutEdwin(), AknLayoutUtils::LayoutLabel() or AknLayoutUtils::LayoutSecretEditor().

Fonts returned by this are not recommended to be stored in clients' member data, but should be accessed when they are required for use.

Applications that are written to run with their layout dynamically adapting to different screen sizes should use only the values found in the S60 logical font enumeration, TAknLogicalFontId.

const pointer to a system font, or aCustomFont

Parameters

TInt aFontIdInput S60 font id.
const CFont * aCustomFont = 0Font to return if aFontId is given as EFontCustom

FontFromName(const TDesC &)

IMPORT_C const CFont *FontFromName(const TDesC &aName)[static]

Deprecated! Do not use!

Parameters

const TDesC & aName

GetEdwinVerticalPositionAndHeightFromLines(TInt, const TAknTextLineLayout &, TInt, TInt, TInt &, TInt &)

IMPORT_C voidGetEdwinVerticalPositionAndHeightFromLines(TIntaParentHeight,
const TAknTextLineLayout &aLayout,
TIntaBaselineSeparationOverRide,
TIntaNumberOfLinesToShowOverRide,
TInt &aEdwinVerticalPositionRelativeToParent,
TInt &aEdwinHeight
)[static]

Utility method to be used along side LayoutEdwin methods that take number of lines or baseline separation overrides.

This routine returns the edwin height in pixels required to fit exactly the passed-in layout, or the layout with overridden baseline separation and/or number of lines.

The vertical position of the editor is also returned. Note that the correct height of the parent layout item is needed in order for this to be calculated properly.

Note that this API does not cause a layout of the editor.

3.1

Parameters

TInt aParentHeightHeight of the parent layout item
const TAknTextLineLayout & aLayoutS60 layout object for the text to be laid out in the editor
TInt aBaselineSeparationOverRide
TInt aNumberOfLinesToShowOverRide
TInt & aEdwinVerticalPositionRelativeToParentReturns the vertical postion of the editor relative to its parent when laid out.
TInt & aEdwinHeightThe height required in pixels to fit the required number of laid out lines plus highlights.

GulAlignFromId(TInt)

IMPORT_C TGulAlignmentGulAlignFromId(TIntaId)[static]

Parameters

TInt aId

HighlightBasedRect(const TRect &, CCoeControl *)

TRect HighlightBasedRect(const TRect &aHighlightRect,
CCoeControl *aControl
)[static]

Used by pop-ups to align themselves around the given highlighted area. TRect Size and position of pop-up.

Parameters

const TRect & aHighlightRectHighlighted area.
CCoeControl * aControlControl whose position should be calculated,

HighlightExtensionsFromFont(const TInt, TInt &, TInt &, TInt &, TInt &)

voidHighlightExtensionsFromFont(const TIntfontid,
TInt &aLeft,
TInt &aRight,
TInt &aTop,
TInt &aBottom
)[static]

Parameters

const TInt fontid
TInt & aLeft
TInt & aRight
TInt & aTop
TInt & aBottom

HighlightLeftPixelsFromFont(const TFontSpec &)

IMPORT_C TIntHighlightLeftPixelsFromFont(const TFontSpec &aFont)[static]

Parameters

const TFontSpec & aFont

HighlightRightPixelsFromFont(const TFontSpec &)

IMPORT_C TIntHighlightRightPixelsFromFont(const TFontSpec &aFont)[static]

Parameters

const TFontSpec & aFont

LayoutControl(CCoeControl *, const TRect &, TInt)

IMPORT_C voidLayoutControl(CCoeControl *aControl,
const TRect &aControlParent,
TIntaResourceId
)[static]

Deprecated! Do not use!

Parameters

CCoeControl * aControl
const TRect & aControlParent
TInt aResourceId

LayoutControl(CCoeControl *, const TRect &, TResourceReader &)

IMPORT_C voidLayoutControl(CCoeControl *aControl,
const TRect &aControlParent,
TResourceReader &aReader
)[static]

Deprecated! Do not use!

Parameters

CCoeControl * aControl
const TRect & aControlParent
TResourceReader & aReader

LayoutControl(CCoeControl *, const TRect &, const SAknLayoutControl &)

IMPORT_C voidLayoutControl(CCoeControl *aControl,
const TRect &aControlParent,
const SAknLayoutControl &aLayout
)[static]

Parameters

CCoeControl * aControl
const TRect & aControlParent
const SAknLayoutControl & aLayout

LayoutControl(CCoeControl *, const TRect &, const TAknWindowLineLayout &)

IMPORT_C voidLayoutControl(CCoeControl *aControl,
const TRect &aControlParent,
const TAknWindowLineLayout &aLayout
)[static]

Parameters

CCoeControl * aControl
const TRect & aControlParent
const TAknWindowLineLayout & aLayout

LayoutControl(CCoeControl *, const TRect &, TInt, TInt, TInt, TInt, TInt, TInt, TInt)

IMPORT_C voidLayoutControl(CCoeControl *aControl,
const TRect &aControlParent,
TInt,
TIntl,
TIntt,
TIntr,
TIntb,
TIntW,
TIntH
)[static]

Parameters

CCoeControl * aControl
const TRect & aControlParent
TInt
TInt l
TInt t
TInt r
TInt b
TInt W
TInt H

LayoutEdwin(CEikEdwin *, const TRect &, TInt, TInt, const CFont *, TBool)

IMPORT_C voidLayoutEdwin(CEikEdwin *aEdwin,
const TRect &aEdwinParent,
TIntaResourceId,
TIntaNumberOfLines = 0,
const CFont *aCustomFont = 0,
TBoolaMinimizeEdwinView = EFalse
)[static]

Deprecated! Do not use!

Parameters

CEikEdwin * aEdwin
const TRect & aEdwinParent
TInt aResourceId
TInt aNumberOfLines = 0
const CFont * aCustomFont = 0
TBool aMinimizeEdwinView = EFalse

LayoutEdwin(CEikEdwin *, const TRect &, TResourceReader &, TInt, const CFont *, TBool)

IMPORT_C voidLayoutEdwin(CEikEdwin *aEdwin,
const TRect &aEdwinParent,
TResourceReader &aReader,
TIntaNumberOfLines = 0,
const CFont *aCustomFont = 0,
TBoolaMinimizeEdwinView = EFalse
)[static]

Deprecated! Do not use!

Parameters

CEikEdwin * aEdwin
const TRect & aEdwinParent
TResourceReader & aReader
TInt aNumberOfLines = 0
const CFont * aCustomFont = 0
TBool aMinimizeEdwinView = EFalse

LayoutEdwin(CEikEdwin *, const TRect &, const SAknLayoutEdwin &, const CFont *, TBool)

IMPORT_C voidLayoutEdwin(CEikEdwin *aEdwin,
const TRect &aEdwinParent,
const SAknLayoutEdwin &aLayout,
const CFont *aCustomFont = 0,
TBoolaMinimizeEdwinView = EFalse
)[static]

Layouts an editor via a structure of layout parameters

Parameters

CEikEdwin * aEdwin
const TRect & aEdwinParent
const SAknLayoutEdwin & aLayoutthe structure
const CFont * aCustomFont = 0
TBool aMinimizeEdwinView = EFalse

LayoutEdwin(CEikEdwin *, const TRect &, const TAknMultiLineTextLayout &, const CFont *, TBool)

IMPORT_C voidLayoutEdwin(CEikEdwin *aEdwin,
const TRect &aEdwinParent,
const TAknMultiLineTextLayout &aLayout,
const CFont *aCustomFont = 0,
TBoolaMinimizeEdwinView = EFalse
)[static]

Layouts an editor via a structure of layout parameters

Parameters

CEikEdwin * aEdwin
const TRect & aEdwinParent
const TAknMultiLineTextLayout & aLayoutthe structure
const CFont * aCustomFont = 0
TBool aMinimizeEdwinView = EFalse

LayoutEdwin(CEikEdwin *, const TRect &, const TAknMultiLineTextLayout &, TAknsQsnTextColorsIndex, const CFont *, TBool)

IMPORT_C voidLayoutEdwin(CEikEdwin *aEdwin,
const TRect &aEdwinParent,
const TAknMultiLineTextLayout &aLayout,
TAknsQsnTextColorsIndexaOverrideColor,
const CFont *aCustomFont = 0,
TBoolaMinimizeEdwinView = EFalse
)[static]

Parameters

CEikEdwin * aEdwin
const TRect & aEdwinParent
const TAknMultiLineTextLayout & aLayout
TAknsQsnTextColorsIndex aOverrideColor
const CFont * aCustomFont = 0
TBool aMinimizeEdwinView = EFalse

LayoutEdwin(CEikEdwin *, const TRect &, const TAknTextLineLayout &, const CFont *, TBool)

IMPORT_C voidLayoutEdwin(CEikEdwin *aEdwin,
const TRect &aEdwinParent,
const TAknTextLineLayout &aLayout,
const CFont *aCustomFont = 0,
TBoolaMinimizeEdwinView = EFalse
)[static]

Parameters

CEikEdwin * aEdwin
const TRect & aEdwinParent
const TAknTextLineLayout & aLayout
const CFont * aCustomFont = 0
TBool aMinimizeEdwinView = EFalse

LayoutEdwin(CEikEdwin *, const TRect &, const TAknTextLineLayout &, TAknsQsnTextColorsIndex, const CFont *, TBool)

IMPORT_C voidLayoutEdwin(CEikEdwin *aEdwin,
const TRect &aEdwinParent,
const TAknTextLineLayout &aLayout,
TAknsQsnTextColorsIndexaOverrideColor,
const CFont *aCustomFont = 0,
TBoolaMinimizeEdwinView = EFalse
)[static]

Parameters

CEikEdwin * aEdwin
const TRect & aEdwinParent
const TAknTextLineLayout & aLayout
TAknsQsnTextColorsIndex aOverrideColor
const CFont * aCustomFont = 0
TBool aMinimizeEdwinView = EFalse

LayoutEdwin(CEikEdwin *, const TRect &, const TAknTextLineLayout &, TInt, TInt, TAknsQsnTextColorsIndex, TInt &)

IMPORT_C voidLayoutEdwin(CEikEdwin *aEdwin,
const TRect &aEdwinParent,
const TAknTextLineLayout &aLayout,
TIntaNumberOfLinesToShowOverRide,
TIntaBaselineSeparationOverRide,
TAknsQsnTextColorsIndexaOverrideColor,
TInt &aNumberOfVisibleLines
)[static]

Routine to perform standard layout of a CEikEdwin editor. Two elements from the S60 layout data are required: The rectangle of the containing layout element, and the TAknTextLineLayout object created for the contained text pane element.

Override parameters can be supplied for a different number of lines, a different baseline separation, or substituted skin color. Various "Do Not Override" values are to be passed if the values passed in aLayout are to be used. Refer to the parameters' documentation.

The lower extent of the editor to be laid out (whether driven by the NumberOfLinesToShow() feature of the TAknTextLineLayout object, or overridden by aNumberOfLinesToShowOverRide) will not extend below the lower limit of the rectangle aEdwinParent. Thus the number of lines formatted is limited, and is available as an output parameter.

The height of the editor is also restricted by any value previously set in CEikEdwin::SetMaximumHeightInLines().

3.1

Parameters

CEikEdwin * aEdwinpointer to the editor to be laid out
const TRect & aEdwinParentrectangle of the containing layout element
const TAknTextLineLayout & aLayoutobject representing the layout of the text pane implemented by this editor
TInt aNumberOfLinesToShowOverRide
TInt aBaselineSeparationOverRide
TAknsQsnTextColorsIndex aOverrideColorAvkon Skins color index to override with, if not (TAknsQsnTextColorsIndex)KAknLayoutUtilsDoNotOverride
TInt & aNumberOfVisibleLinesNumber of lines of editor actually laid out.

LayoutEdwin(CEikEdwin *, const TRect &, TInt, TInt, TInt, TInt, TInt, TInt, TInt, TInt, TInt, const CFont *, TBool)

IMPORT_C voidLayoutEdwin(CEikEdwin *aEdwin,
const TRect &aEdwinParent,
TIntfont,
TIntC,
TIntl,
TIntr,
TIntB,
TIntW,
TIntJ,
TIntaNumberOfLinesShown,
TIntaNextLineBaseline,
const CFont *aCustomFont = 0,
TBoolaMinimizeEdwinView = EFalse
)[static]

Layouts an editor via parameters from the specification

Parameters

CEikEdwin * aEdwin
const TRect & aEdwinParent
TInt fontfont id, ELatinPlain12, ELatinBold12, ELatinBold13, ELatinBold17, ELatinBold19 etc..
TInt Ccolour index, 0..255
TInt lleft margin
TInt rright margin
TInt BBaseline from top of the parent rectangle
TInt Wtext width in pixels
TInt Jjustification. ELayoutAlignNone; ELayoutAlignCenter; ELayoutAlignLeft; ELayoutAlignRight; ELayoutAlignBidi
TInt aNumberOfLinesShownnumber of lines visible for the editor
TInt aNextLineBaseline
const CFont * aCustomFont = 0
TBool aMinimizeEdwinView = EFalsewhether to use minimum size. You need to use MinimizedEdwinRect() if you use ETrue here.

LayoutEdwin(CEikEdwin *, const TRect &, TInt, TInt, TInt, TInt, TInt, TInt, TInt, TInt, TInt, TAknsQsnTextColorsIndex, const CFont *, TBool)

IMPORT_C voidLayoutEdwin(CEikEdwin *aEdwin,
const TRect &aEdwinParent,
TIntfont,
TIntC,
TIntl,
TIntr,
TIntB,
TIntW,
TIntJ,
TIntaNumberOfLinesShown,
TIntaNextLineBaseline,
TAknsQsnTextColorsIndexaOverrideColor,
const CFont *aCustomFont = 0,
TBoolaMinimizeEdwinView = EFalse
)[static]

Parameters

CEikEdwin * aEdwin
const TRect & aEdwinParent
TInt font
TInt C
TInt l
TInt r
TInt B
TInt W
TInt J
TInt aNumberOfLinesShown
TInt aNextLineBaseline
TAknsQsnTextColorsIndex aOverrideColor
const CFont * aCustomFont = 0
TBool aMinimizeEdwinView = EFalse

LayoutFontFromId(TInt, const CAknLayoutFont *)

IMPORT_C const CAknLayoutFont *LayoutFontFromId(TIntaId,
const CAknLayoutFont *aCustomFont = 0
)[static]

Method to return a system font reference from a S60 font id. This will always conform to type CAknLayoutFont

This method should only be used if application code needs to render its own graphics. That is, it is not using S60 controls and furthermore not using the recommended methods AknLayoutUtils::LayoutEdwin(), AknLayoutUtils::LayoutLabel() or AknLayoutUtils::LayoutSecretEditor().

Fonts returned by this are not recommended to be stored in clients' member data, but should be accessed when they are required for use.

Applications that are written to run with their layout dynamically adapting to different screen sizes should use only the values found in the S60 logical font enumeration, TAknLogicalFontId.

const pointer to a system font, or aCustomFont

Parameters

TInt aId
const CAknLayoutFont * aCustomFont = 0Font to return if aFontId is given as EFontCustom

LayoutHorizontalScrollBar(CEikScrollBarFrame *, const TRect &, const TAknWindowLineLayout &)

IMPORT_C voidLayoutHorizontalScrollBar(CEikScrollBarFrame *aScrollBarFrame,
const TRect &aControlParent,
const TAknWindowLineLayout &aLayout
)[static]

Parameters

CEikScrollBarFrame * aScrollBarFrame
const TRect & aControlParent
const TAknWindowLineLayout & aLayout

LayoutImage(CEikImage *, const TRect &, TInt)

IMPORT_C voidLayoutImage(CEikImage *aImage,
const TRect &aParent,
TIntaResourceId
)[static]

Deprecated! Do not use!

Parameters

CEikImage * aImage
const TRect & aParent
TInt aResourceId

LayoutImage(CEikImage *, const TRect &, TResourceReader &)

IMPORT_C voidLayoutImage(CEikImage *aImage,
const TRect &aParent,
TResourceReader &aReader
)[static]

Deprecated! Do not use!

Parameters

CEikImage * aImage
const TRect & aParent
TResourceReader & aReader

LayoutImage(CEikImage *, const TRect &, const SAknLayoutControl &)

IMPORT_C voidLayoutImage(CEikImage *aImage,
const TRect &aParent,
const SAknLayoutControl &aLayout
)[static]

Parameters

CEikImage * aImage
const TRect & aParent
const SAknLayoutControl & aLayout

LayoutImage(CEikImage *, const TRect &, const TAknWindowLineLayout &)

IMPORT_C voidLayoutImage(CEikImage *aImage,
const TRect &aParent,
const TAknWindowLineLayout &aLayout
)[static]

Parameters

CEikImage * aImage
const TRect & aParent
const TAknWindowLineLayout & aLayout

LayoutImage(CEikImage *, const TRect &, TInt, TInt, TInt, TInt, TInt, TInt, TInt)

IMPORT_C voidLayoutImage(CEikImage *aImage,
const TRect &aParent,
TIntC,
TIntl,
TIntt,
TIntr,
TIntb,
TIntW,
TIntH
)[static]

Parameters

CEikImage * aImage
const TRect & aParent
TInt C
TInt l
TInt t
TInt r
TInt b
TInt W
TInt H

LayoutLabel(CEikLabel *, const TRect &, TInt, const CFont *)

IMPORT_C voidLayoutLabel(CEikLabel *aLabel,
const TRect &aLabelParent,
TIntaResourceId,
const CFont *aCustomFont = 0
)[static]

Deprecated! Do not use!

Parameters

CEikLabel * aLabel
const TRect & aLabelParent
TInt aResourceId
const CFont * aCustomFont = 0

LayoutLabel(CEikLabel *, const TRect &, TResourceReader &, const CFont *)

IMPORT_C voidLayoutLabel(CEikLabel *aLabel,
const TRect &aLabelParent,
TResourceReader &aReader,
const CFont *aCustomFont = 0
)[static]

Deprecated! Do not use!

Parameters

CEikLabel * aLabel
const TRect & aLabelParent
TResourceReader & aReader
const CFont * aCustomFont = 0

LayoutLabel(CEikLabel *, const TRect &, const SAknLayoutLabel &, const CFont *)

IMPORT_C voidLayoutLabel(CEikLabel *aLabel,
const TRect &aLabelParent,
const SAknLayoutLabel &aLayout,
const CFont *aCustomFont = 0
)[static]

Layouts a label via a structure of layout parameters

Parameters

CEikLabel * aLabel
const TRect & aLabelParent
const SAknLayoutLabel & aLayoutthe structure
const CFont * aCustomFont = 0

LayoutLabel(CEikLabel *, const TRect &, const TAknMultiLineTextLayout &, const CFont *)

IMPORT_C voidLayoutLabel(CEikLabel *aLabel,
const TRect &aLabelParent,
const TAknMultiLineTextLayout &aLayout,
const CFont *aCustomFont = 0
)[static]

Layouts a label via a layout compiler output

Parameters

CEikLabel * aLabel
const TRect & aLabelParent
const TAknMultiLineTextLayout & aLayouta define from aknlayout.lag file
const CFont * aCustomFont = 0

LayoutLabel(CEikLabel *, const TRect &, const TAknTextLineLayout &, const CFont *)

IMPORT_C voidLayoutLabel(CEikLabel *aLabel,
const TRect &aLabelParent,
const TAknTextLineLayout &aLayout,
const CFont *aCustomFont = 0
)[static]

Layouts a label via a layout compiler output

Parameters

CEikLabel * aLabel
const TRect & aLabelParent
const TAknTextLineLayout & aLayouta define from aknlayout.lag file
const CFont * aCustomFont = 0

LayoutLabel(CEikLabel *, const TRect &, TInt, TInt, TInt, TInt, TInt, TInt, TInt, TInt, const CFont *)

IMPORT_C voidLayoutLabel(CEikLabel *aLabel,
const TRect &aLabelParent,
TIntfont,
TIntC,
TIntl,
TIntr,
TIntB,
TIntW,
TIntJ,
TIntNextLineB = 0,
const CFont *aCustomFont = 0
)[static]

Layouts a label via parameters from the specification

Parameters

CEikLabel * aLabel
const TRect & aLabelParent
TInt fontfont id, ELatinPlain12, ELatinBold12, ELatinBold13, ELatinBold17, ELatinBold19 etc..
TInt Ccolour index, 0..255
TInt lleft margin
TInt rright margin
TInt BBaseline from top of the parent rectangle
TInt Wtext width in pixels
TInt Jjustification. ELayoutAlignNone; ELayoutAlignCenter; ELayoutAlignLeft; ELayoutAlignRight; ELayoutAlignBidi
TInt NextLineB = 0baseline of 2nd line for multi-line labels/editors
const CFont * aCustomFont = 0a font used, if resource file uses EFontCustom

LayoutMetricsPosition(TAknLayoutMetrics, TPoint &)

IMPORT_C TBoolLayoutMetricsPosition(TAknLayoutMetricsaParan,
TPoint &aPos
)[static]

This method returns position of top left corner for given layout component. Returns EFalse for status pane descendants if requested layout component is not available in current layout. For other components returns always ETrue (returned position is from layout definition).

2.8

Parameters

TAknLayoutMetrics aParan
TPoint & aPosResulting position.

LayoutMetricsRect(TAknLayoutMetrics, TRect &)

IMPORT_C TBoolLayoutMetricsRect(TAknLayoutMetricsaParam,
TRect &aRect
)[static]

Fills given TRect with rectangle for given layout component. Returns EFalse for status pane descendants if requested layout component is not available in current layout. For other components returns always ETrue (returned rectangle is from layout definition).

2.8

Parameters

TAknLayoutMetrics aParamLayout component to be queried.
TRect & aRectResulting rectangle.

LayoutMetricsSize(TAknLayoutMetrics, TSize &)

IMPORT_C TBoolLayoutMetricsSize(TAknLayoutMetricsaParam,
TSize &aSize
)[static]

This method returns size of rectangle for given layout component. Returns EFalse for status pane descendants if requested layout component is not available in current layout. For other components returns always ETrue (returned size is from layout definition).

2.8

Parameters

TAknLayoutMetrics aParamLayout component to be queried.
TSize & aSizeResulting size.

LayoutMfne(CEikMfne *, const TRect &, TInt)

IMPORT_C voidLayoutMfne(CEikMfne *aMfne,
const TRect &aMfneParent,
TIntaResourceId
)[static]

Deprecated! Do not use!

Parameters

CEikMfne * aMfne
const TRect & aMfneParent
TInt aResourceId

LayoutMfne(CEikMfne *, const TRect &, TResourceReader &)

IMPORT_C voidLayoutMfne(CEikMfne *aMfne,
const TRect &aMfneParent,
TResourceReader &aReader
)[static]

Deprecated! Do not use!

Parameters

CEikMfne * aMfne
const TRect & aMfneParent
TResourceReader & aReader

LayoutMfne(CEikMfne *, const TRect &, const SAknLayoutMfne &)

IMPORT_C voidLayoutMfne(CEikMfne *aMfne,
const TRect &aMfneParent,
const SAknLayoutMfne &aLayout
)[static]

Parameters

CEikMfne * aMfne
const TRect & aMfneParent
const SAknLayoutMfne & aLayout

LayoutMfne(CEikMfne *, const TRect &, const TAknTextLineLayout &)

IMPORT_C voidLayoutMfne(CEikMfne *aMfne,
const TRect &aMfneParent,
const TAknTextLineLayout &aLayout
)[static]

Parameters

CEikMfne * aMfne
const TRect & aMfneParent
const TAknTextLineLayout & aLayout

LayoutMfne(CEikMfne *, const TRect &, TInt, TInt, TInt, TInt, TInt, TInt, TInt)

IMPORT_C voidLayoutMfne(CEikMfne *aMfne,
const TRect &aMfneParent,
TIntfont,
TIntC,
TIntl,
TIntr,
TIntB,
TIntW,
TIntJ
)[static]

Parameters

CEikMfne * aMfne
const TRect & aMfneParent
TInt font
TInt C
TInt l
TInt r
TInt B
TInt W
TInt J

LayoutMirrored()

IMPORT_C TBoolLayoutMirrored()[static]

LayoutSecretEditor(CEikSecretEditor *, const TRect &, const SAknLayoutText &)

IMPORT_C voidLayoutSecretEditor(CEikSecretEditor *aSecEd,
const TRect &aParent,
const SAknLayoutText &aLayout
)[static]

Sets CEikSecretEditor's position, colors and fonts based on LAF specification

Parameters

CEikSecretEditor * aSecEd
const TRect & aParent
const SAknLayoutText & aLayout

LayoutSecretEditor(CEikSecretEditor *, const TRect &, const TAknTextLineLayout &)

IMPORT_C voidLayoutSecretEditor(CEikSecretEditor *aSecEd,
const TRect &aParent,
const TAknTextLineLayout &aLayout
)[static]

Parameters

CEikSecretEditor * aSecEd
const TRect & aParent
const TAknTextLineLayout & aLayout

LayoutVerticalScrollBar(CEikScrollBarFrame *, const TRect &, const TAknWindowLineLayout &)

IMPORT_C voidLayoutVerticalScrollBar(CEikScrollBarFrame *aScrollBarFrame,
const TRect &aControlParent,
const TAknWindowLineLayout &aLayout
)[static]

Parameters

CEikScrollBarFrame * aScrollBarFrame
const TRect & aControlParent
const TAknWindowLineLayout & aLayout

MSKEnabled()

IMPORT_C TBoolMSKEnabled()[static]

This method can be used to check whether MSK support is enabled. ETrue if MSK support is enabled, otherwise EFalse.

MainPaneState()

IMPORT_C TAknMainPaneStateMainPaneState()[static]

MatchFontFromSystemFontArray(const TFontSpec &, MGraphicsDeviceMap *)

const CAknLayoutFont *MatchFontFromSystemFontArray(const TFontSpec &aSpec,
MGraphicsDeviceMap *aMap
)[static]

Access the system font array to see if there is a font that matches the font specification presented in Twips. Device map is also passed in case the system font array has fonts from different devices.

A null return value means that the system font array is not constructed yet, or does not contain a font that has the same TFontSpec or device map.

NULL if no match was found; otherwise a CAknLayoutFont pointer

Parameters

const TFontSpec & aSpecSymbian font specification object to match
MGraphicsDeviceMap * aMapDevice map to disambiguate fonts on different devices

MinimizedEdwinRect(const CEikEdwin *)

IMPORT_C TRectMinimizedEdwinRect(const CEikEdwin *aEdwin)[static]

Use this, if you give aMinimizeEdwinView to LayoutEdwin as true. The edwin will not draw the whole rectangle allocated for the control.

Parameters

const CEikEdwin * aEdwin

OverrideControlColorL(CCoeControl &, TLogicalColor, TRgb)

IMPORT_C voidOverrideControlColorL(CCoeControl &aControl,
TLogicalColoraLogicalColor,
TRgbaColor
)[static]

Parameters

CCoeControl & aControl
TLogicalColor aLogicalColor
TRgb aColor

PenEnabled()

IMPORT_C TBoolPenEnabled()[static]

This method can be used to check whether pen support is enabled. ETrue if pen support is enabled, otherwise EFalse.

RectFromCoords(const TRect &, TInt, TInt, TInt, TInt, TInt, TInt)

IMPORT_C TRectRectFromCoords(const TRect &aParent,
TIntl,
TIntt,
TIntr,
TIntb,
TIntW,
TIntH
)[static]

Parameters

const TRect & aParent
TInt l
TInt t
TInt r
TInt b
TInt W
TInt H

ScalableLayoutInterfaceAvailable()

IMPORT_C TBoolScalableLayoutInterfaceAvailable()[static]

This method tells if the scalable layout interface is available.

SubVariant()

IMPORT_C ESubVariantFlagSubVariant()[static]

TextAlignFromId(TInt)

IMPORT_C CGraphicsContext::TTextAlignTextAlignFromId(TIntaId)[static]

Parameters

TInt aId

TextRectFromCoords(const TRect &, const CFont *, TInt, TInt, TInt, TInt, TInt)

IMPORT_C TRectTextRectFromCoords(const TRect &aParent,
const CFont *aFont,
TIntl,
TIntr,
TIntB,
TIntW,
TIntLB = 0
)[static]

Different conversions Fonts: ELatinPlain12, ELatinBold12, ELatinBold13, ELatinBold17, ELatinBold19, ENumberPlain5, EClockBold30, ELatinClock14, EFontCustom EAknLogicalFontPrimaryFont, EAknLogicalFontSecondaryFont, EAknLogicalFontTitleFont, Alignments: ELayoutAlignNone, ELayoutAlignCenter, ELayoutAlignLeft, ELayoutAlignRight, ELayoutAlignBidi with these..

Parameters

const TRect & aParent
const CFont * aFont
TInt l
TInt r
TInt B
TInt W
TInt LB = 0

Variant()

IMPORT_C EVariantFlagVariant()[static]

Member Enumerations Documentation

Enum TAknCbaLocation

Enumerators

EAknCbaLocationBottom
EAknCbaLocationRight
EAknCbaLocationLeft

Enum TAknLayoutMetrics

Layout Metrics.

Enumerators

EScreen

Screen.

EApplicationWindow

Window that fills the entire screen.

EStatusPane

Indicates common components for most of the applications.

EMainPane

The application main pane is used in all the applications

EControlPane

Control pane.

ESignalPane

The signal pane is used to indicate signal strength.

EContextPane

The context pane is used to indicate an active application.

ETitlePane

Used to indicate the subject or the name of the main pane content.

EBatteryPane

The battery pane is used to indicate battery strength.

EUniversalIndicatorPane

The universal indicator pane is used to indicate items that require the user's attention while browsing applications.

ENaviPane

The navi pane is used to indicate navigation within an application, to provide context sensitive information to the user while entering or editing data, or to show additional information.

EFindPane

A fixed find pane is used with lists instead of the find pop-up window.

EWallpaperPane

Wallpaper pane.

EIndicatorPane

The universal indicator pane is used to indicate items that require the user's attention while browsing applications.

EAColunm

Used generally to display small sized graphics or heading texts.

EBColunm

Used generally to display large sized icons or heading texts.

ECColunm

Used generally to display data entered by the user. Overlaps with the D column.

EDColunm

Used generally to display additional icons. Overlaps with the C column.

EStatusPaneSecondary

, do not use

EControlPaneSecondary

deprecated, do not use

EStaconTop

Top part of status and control panes in landscape layout.

EStaconBottom

Bottom part of status and control panes in landscape layout.

EPopupParent
EStatusPaneBottom = EStatusPaneSecondary

Bottom part of status pane in landscape layout.

EControlPaneBottom = EControlPaneSecondary

Bottom part of control pane in landscape layout.

EControlPaneTop = EControlPane

Top part of control pane in landscape layout.

EStatusPaneTop = EStatusPane

Top part of status pane in landscape layout.

Enum TAknMainPaneState

Flags for main_pane status

Enumerators

EAknMainPaneForTinyStatusPane = 0x0001

Member Type Definitions Documentation

Typedef SAknLayoutControl

typedef SAknLayoutRect SAknLayoutControl

Typedef SAknLayoutEdwin

typedef SAknLayoutTextMultiline SAknLayoutEdwin

Typedef SAknLayoutImage

typedef SAknLayoutRect SAknLayoutImage

Typedef SAknLayoutLabel

typedef SAknLayoutTextMultiline SAknLayoutLabel

Typedef SAknLayoutMfne

typedef SAknLayoutText SAknLayoutMfne

Typedef SAknLayoutSecEd

typedef SAknLayoutText SAknLayoutSecEd