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..)
|
Public Types |
typedef SAknLayoutTextMultiline | SAknLayoutLabel |
typedef SAknLayoutTextMultiline | SAknLayoutEdwin |
typedef SAknLayoutText | SAknLayoutMfne |
typedef SAknLayoutText | SAknLayoutSecEd |
typedef SAknLayoutRect | SAknLayoutControl |
typedef SAknLayoutRect | SAknLayoutImage |
enum | TAknLayoutMetrics {
EScreen,
EApplicationWindow,
EStatusPane,
EMainPane,
EControlPane,
ESignalPane,
EContextPane,
ETitlePane,
EBatteryPane,
EUniversalIndicatorPane,
ENaviPane,
EFindPane,
EWallpaperPane,
EIndicatorPane,
EAColunm,
EBColunm,
ECColunm,
EDColunm,
EStatusPaneSecondary,
EControlPaneSecondary,
EStaconTop,
EStaconBottom,
EStatusPaneBottom = EStatusPaneSecondary,
EControlPaneBottom = EControlPaneSecondary,
EControlPaneTop = EControlPane,
EStatusPaneTop = EStatusPane
} |
| Layout Metrics. More...
|
enum | TAknCbaLocation { EAknCbaLocationBottom,
EAknCbaLocationRight,
EAknCbaLocationLeft
} |
enum | TAknMainPaneState { EAknMainPaneForTinyStatusPane = 0x0001
} |
| Flags for main_pane status. More...
|
Static Public Member Functions |
static IMPORT_C void | LayoutLabel (CEikLabel *aLabel, const TRect &aLabelParent, TInt aResourceId, const CFont *aCustomFont=0) |
| Deprecated! Do not use!
|
static IMPORT_C void | LayoutLabel (CEikLabel *aLabel, const TRect &aLabelParent, TResourceReader &aReader, const CFont *aCustomFont=0) |
| Deprecated! Do not use!
|
static IMPORT_C void | LayoutLabel (CEikLabel *aLabel, const TRect &aLabelParent, const SAknLayoutLabel &aLayout, const CFont *aCustomFont=0) |
| Layouts a label via a structure of layout parameters.
|
static IMPORT_C void | LayoutLabel (CEikLabel *aLabel, const TRect &aLabelParent, const TAknMultiLineTextLayout &aLayout, const CFont *aCustomFont=0) |
| Layouts a label via a layout compiler output.
|
static IMPORT_C void | LayoutLabel (CEikLabel *aLabel, const TRect &aLabelParent, const TAknTextLineLayout &aLayout, const CFont *aCustomFont=0) |
| Layouts a label via a layout compiler output.
|
static IMPORT_C void | LayoutLabel (CEikLabel *aLabel, const TRect &aLabelParent, TInt font, TInt C, TInt l, TInt r, TInt B, TInt W, TInt J, TInt NextLineB=0, const CFont *aCustomFont=0) |
| Layouts a label via parameters from the specification.
|
static IMPORT_C void | LayoutEdwin (CEikEdwin *aEdwin, const TRect &aEdwinParent, TInt aResourceId, TInt aNumberOfLines=0, const CFont *aCustomFont=0, TBool aMinimizeEdwinView=EFalse) |
| Deprecated! Do not use!
|
static IMPORT_C void | LayoutEdwin (CEikEdwin *aEdwin, const TRect &aEdwinParent, TResourceReader &aReader, TInt aNumberOfLines=0, const CFont *aCustomFont=0, TBool aMinimizeEdwinView=EFalse) |
| Deprecated! Do not use!
|
static IMPORT_C void | LayoutEdwin (CEikEdwin *aEdwin, const TRect &aEdwinParent, const SAknLayoutEdwin &aLayout, const CFont *aCustomFont=0, TBool aMinimizeEdwinView=EFalse) |
| Layouts an editor via a structure of layout parameters.
|
static IMPORT_C void | LayoutEdwin (CEikEdwin *aEdwin, const TRect &aEdwinParent, const TAknMultiLineTextLayout &aLayout, const CFont *aCustomFont=0, TBool aMinimizeEdwinView=EFalse) |
| Layouts an editor via a structure of layout parameters.
|
static IMPORT_C void | LayoutEdwin (CEikEdwin *aEdwin, const TRect &aEdwinParent, const TAknMultiLineTextLayout &aLayout, TAknsQsnTextColorsIndex aOverrideColor, const CFont *aCustomFont=0, TBool aMinimizeEdwinView=EFalse) |
static IMPORT_C void | LayoutEdwin (CEikEdwin *aEdwin, const TRect &aEdwinParent, const TAknTextLineLayout &aLayout, const CFont *aCustomFont=0, TBool aMinimizeEdwinView=EFalse) |
static IMPORT_C void | LayoutEdwin (CEikEdwin *aEdwin, const TRect &aEdwinParent, const TAknTextLineLayout &aLayout, TAknsQsnTextColorsIndex aOverrideColor, const CFont *aCustomFont=0, TBool aMinimizeEdwinView=EFalse) |
static IMPORT_C void | LayoutEdwin (CEikEdwin *aEdwin, const TRect &aEdwinParent, const TAknTextLineLayout &aLayout, TInt aNumberOfLinesToShowOverRide, TInt aBaselineSeparationOverRide, TAknsQsnTextColorsIndex aOverrideColor, TInt &aNumberOfVisibleLines) |
| Routine to perform standard layout of a CEikEdwin editor.
|
static IMPORT_C void | LayoutEdwin (CEikEdwin *aEdwin, const TRect &aEdwinParent, TInt font, TInt C, TInt l, TInt r, TInt B, TInt W, TInt J, TInt aNumberOfLinesShown, TInt aNextLineBaseline, const CFont *aCustomFont=0, TBool aMinimizeEdwinView=EFalse) |
| Layouts an editor via parameters from the specification.
|
static IMPORT_C void | LayoutEdwin (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) |
static IMPORT_C TRect | MinimizedEdwinRect (const CEikEdwin *aEdwin) |
| Use this, if you give aMinimizeEdwinView to LayoutEdwin as true.
|
static IMPORT_C void | LayoutMfne (CEikMfne *aMfne, const TRect &aMfneParent, TInt aResourceId) |
| Deprecated! Do not use!
|
static IMPORT_C void | LayoutMfne (CEikMfne *aMfne, const TRect &aMfneParent, TResourceReader &aReader) |
| Deprecated! Do not use!
|
static IMPORT_C void | LayoutMfne (CEikMfne *aMfne, const TRect &aMfneParent, const SAknLayoutMfne &aLayout) |
static IMPORT_C void | LayoutMfne (CEikMfne *aMfne, const TRect &aMfneParent, const TAknTextLineLayout &aLayout) |
static IMPORT_C void | LayoutMfne (CEikMfne *aMfne, const TRect &aMfneParent, TInt font, TInt C, TInt l, TInt r, TInt B, TInt W, TInt J) |
static IMPORT_C void | LayoutControl (CCoeControl *aControl, const TRect &aControlParent, TInt aResourceId) |
| Deprecated! Do not use!
|
static IMPORT_C void | LayoutControl (CCoeControl *aControl, const TRect &aControlParent, TResourceReader &aReader) |
| Deprecated! Do not use!
|
static IMPORT_C void | LayoutControl (CCoeControl *aControl, const TRect &aControlParent, const SAknLayoutControl &aLayout) |
static IMPORT_C void | LayoutControl (CCoeControl *aControl, const TRect &aControlParent, const TAknWindowLineLayout &aLayout) |
static IMPORT_C void | LayoutControl (CCoeControl *aControl, const TRect &aControlParent, TInt, TInt l, TInt t, TInt r, TInt b, TInt W, TInt H) |
static IMPORT_C void | LayoutImage (CEikImage *aImage, const TRect &aParent, TInt aResourceId) |
| Deprecated! Do not use!
|
static IMPORT_C void | LayoutImage (CEikImage *aImage, const TRect &aParent, TResourceReader &aReader) |
| Deprecated! Do not use!
|
static IMPORT_C void | LayoutImage (CEikImage *aImage, const TRect &aParent, const SAknLayoutControl &aLayout) |
static IMPORT_C void | LayoutImage (CEikImage *aImage, const TRect &aParent, const TAknWindowLineLayout &aLayout) |
static IMPORT_C void | LayoutImage (CEikImage *aImage, const TRect &aParent, TInt C, TInt l, TInt t, TInt r, TInt b, TInt W, TInt H) |
static IMPORT_C void | LayoutSecretEditor (CEikSecretEditor *aSecEd, const TRect &aParent, const SAknLayoutText &aLayout) |
| Sets CEikSecretEditor's position, colors and fonts based on LAF specification.
|
static IMPORT_C void | LayoutSecretEditor (CEikSecretEditor *aSecEd, const TRect &aParent, const TAknTextLineLayout &aLayout) |
static IMPORT_C TRect | TextRectFromCoords (const TRect &aParent, const CFont *aFont, TInt l, TInt r, TInt B, TInt W, TInt LB=0) |
| Different conversions Fonts: ELatinPlain12, ELatinBold12, ELatinBold13, ELatinBold17, ELatinBold19, ENumberPlain5, EClockBold30, ELatinClock14, EFontCustom EAknLogicalFontPrimaryFont, EAknLogicalFontSecondaryFont, EAknLogicalFontTitleFont, Alignments: ELayoutAlignNone, ELayoutAlignCenter, ELayoutAlignLeft, ELayoutAlignRight, ELayoutAlignBidi with these.
|
static IMPORT_C TRect | RectFromCoords (const TRect &aParent, TInt l, TInt t, TInt r, TInt b, TInt W, TInt H) |
static IMPORT_C const CFont * | FontFromId (TInt aFontId, const CFont *aCustomFont=0) |
| Method to return a useable system font reference from a S60 font enumeration from among the supported list.
|
static IMPORT_C const CAknLayoutFont * | LayoutFontFromId (TInt aId, const CAknLayoutFont *aCustomFont=0) |
| Method to return a system font reference from a S60 font id.
|
static IMPORT_C CAknLayoutFont * | CreateLayoutFontFromSpecificationL (const TAknFontSpecification &aSpec) |
| Return a fully constructed CAknLayoutFont object based upon the specification passed in.
|
static IMPORT_C CAknLayoutFont * | CreateLayoutFontFromSpecificationL (const TTypeface &aTypeface, const TAknFontSpecification &aSpec) |
| Return a fully constructed CAknLayoutFont object based upon the typeface and specification passed in.
|
static IMPORT_C const CFont * | FontFromName (const TDesC &aName) |
| Deprecated! Do not use!
|
static IMPORT_C CGraphicsContext::TTextAlign | TextAlignFromId (TInt aId) |
static IMPORT_C TGulAlignment | GulAlignFromId (TInt aId) |
static IMPORT_C TInt | CursorHeightFromFont (const TFontSpec &aFont) |
static IMPORT_C TInt | CursorWidthFromFont (const TFontSpec &aFont) |
static IMPORT_C TInt | CursorAscentFromFont (const TFontSpec &aFont) |
static IMPORT_C void | CursorExtensionsFromFont (const TFontSpec &, TInt &aFirstExtension, TInt &aSecondExtension) |
static IMPORT_C TInt | HighlightLeftPixelsFromFont (const TFontSpec &aFont) |
static IMPORT_C TInt | HighlightRightPixelsFromFont (const TFontSpec &aFont) |
static void | HighlightExtensionsFromFont (const TInt fontid, TInt &aLeft, TInt &aRight, TInt &aTop, TInt &aBottom) |
static const CAknLayoutFont * | MatchFontFromSystemFontArray (const TFontSpec &aSpec, MGraphicsDeviceMap *aMap) |
| Access the system font array to see if there is a font that matches the font specification presented in Twips.
|
static IMPORT_C TBool | LayoutMirrored () |
static IMPORT_C EVariantFlag | Variant () |
static IMPORT_C ESubVariantFlag | SubVariant () |
static IMPORT_C void | OverrideControlColorL (CCoeControl &aControl, TLogicalColor aLogicalColor, TRgb aColor) |
static IMPORT_C CEikScrollBarFrame::TScrollBarType | DefaultScrollBarType (CAknAppUiBase *aApplication) |
static IMPORT_C void | LayoutVerticalScrollBar (CEikScrollBarFrame *aScrollBarFrame, const TRect &aControlParent, const TAknWindowLineLayout &aLayout) |
static IMPORT_C void | LayoutHorizontalScrollBar (CEikScrollBarFrame *aScrollBarFrame, const TRect &aControlParent, const TAknWindowLineLayout &aLayout) |
static IMPORT_C TBool | LayoutMetricsRect (TAknLayoutMetrics aParam, TRect &aRect) |
| Fills given TRect with rectangle for given layout component.
|
static IMPORT_C TBool | LayoutMetricsSize (TAknLayoutMetrics aParam, TSize &aSize) |
| This method returns size of rectangle for given layout component.
|
static IMPORT_C TBool | LayoutMetricsPosition (TAknLayoutMetrics aParan, TPoint &aPos) |
| This method returns position of top left corner for given layout component.
|
static TInt | CorrectBaseline (TInt aParentHeight, TInt aBaseline, TInt aFontId) |
| This method returns a new value for a baseline, based upon a value for bottom and a value for height.
|
static void | CorrectFontId (TRect aParent, TInt at, TInt aH, TInt ab, TInt &aFontId) |
| This method updates fontid if it has ELayoutEmpty or parent relative values.
|
static IMPORT_C TBool | ScalableLayoutInterfaceAvailable () |
| This method tells if the scalable layout interface is available.
|
static IMPORT_C TAknCbaLocation | CbaLocation () |
| This method tells location of softkeys (CBA) field in current running application.
|
static TRect | HighlightBasedRect (const TRect &aHighlightRect, CCoeControl *aControl) |
| Used by pop-ups to align themselves around the given highlighted area.
|
static IMPORT_C TAknMainPaneState | MainPaneState () |
static IMPORT_C TBool | PenEnabled () |
| This method can be used to check whether pen support is enabled.
|
static IMPORT_C TBool | MSKEnabled () |
| This method can be used to check whether MSK support is enabled.
|
static IMPORT_C void | GetEdwinVerticalPositionAndHeightFromLines (TInt aParentHeight, const TAknTextLineLayout &aLayout, TInt aBaselineSeparationOverRide, TInt aNumberOfLinesToShowOverRide, TInt &aEdwinVerticalPositionRelativeToParent, TInt &aEdwinHeight) |
| Utility method to be used along side LayoutEdwin methods that take number of lines or baseline separation overrides.
|
static IMPORT_C TInt | EdwinLinesWithinHeight (const TAknTextLineLayout &aLayout, TInt aBaselineSeparationOverride, TInt aMaxHeight, TInt &aUsedHeight) |
| 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.
|
Data Structures |
struct | SAknLayoutRect |
struct | SAknLayoutText |
struct | SAknLayoutTextMultiline |