#include <mw/AknsDrawUtils.h>
Link against: AknSkins.lib
class AknsDrawUtils |
Static utility class to support Avkon Skins drawing operations. AknsDrawUtils provides utility methods to perform skin-aware drawing operations, such as background drawing.
This is a public static class with exported functions. The class is not intended for derivation outside the library.
IMPORT_C TBool | Background | ( | MAknsSkinInstance * | aInstance, |
MAknsControlContext * | aContext, | |||
CWindowGc & | aGc, | |||
const TRect & | aRect | |||
) | [static] |
Draws background with assumed origin. Draws bacground to the specified rectangle. Origin is assumed to be (0,0). This overload can not be used with parent absolute layouts.
See DrawBackground for details on chained layouts.
Parameters | |
---|---|
aInstance | Pointer to skin instance as obtained from AknsUtils::SkinInstance(). If NULL rectangle is cleared without bitmap. |
aContext | Control context to obtain context specific information about background drawing. If NULL and skin instance was given, default parameters are used. |
aGc | Graphics context to be used for drawing. |
aRect | Rectangle to be drawn. |
IMPORT_C TBool | Background | ( | MAknsSkinInstance * | aInstance, |
MAknsControlContext * | aContext, | |||
const CCoeControl * | aControl, | |||
CWindowGc & | aGc, | |||
const TRect & | aRect | |||
) | [static] |
Draws background with proper origin. Draws bacground to the specified rectangle. The origin is queried from the control position list (if given using AknsUtils::RegisterControlPosition). If not found, the origin is queried from the given control, which may result in a window server flush.
See DrawBackground for details on chained layouts.
Parameters | |
---|---|
aInstance | Pointer to skin instance as obtained from AknsUtils::SkinInstance(). If NULL rectangle is cleared without bitmap. |
aContext | Control context to obtain context specific information about background drawing. Must be specified, if aInstance is not NULL. |
aControl | Control that knows the current window. Must be specified if parent absolute layout can be used, otherwise NULL may be given. |
aGc | Graphics context to be used for drawing. |
aRect | Rectangle to be drawn. |
IMPORT_C TBool | Background | ( | MAknsSkinInstance * | aInstance, |
MAknsControlContext * | aContext, | |||
const CCoeControl * | aControl, | |||
CWindowGc & | aGc, | |||
const TRect & | aRect, | |||
const TInt | aDrawParam | |||
) | [static] |
Draws background with proper origin and drawing parameters. Draws bacground to the specified rectangle. The origin is queried from the control position list (if given using AknsUtils::RegisterControlPosition). If not found, the origin is queried from the given control, which may result in a window server flush. Drawing parameters may be used to control drawing.
See DrawBackground for details on chained layouts.
Parameters | |
---|---|
aInstance | Pointer to skin instance as obtained from AknsUtils::SkinInstance(). If NULL rectangle is cleared without bitmap. |
aContext | Control context to obtain context specific information about background drawing. Must be specified, if aInstance is not NULL. |
aControl | Control that knows the current window. Must be specified if parent absolute layout can be used, otherwise NULL may be given. |
aGc | Graphics context to be used for drawing. |
aRect | Rectangle to be drawn. |
aDrawParam | Bitwise combination of drawing parameters. KAknsDrawParamDefault should be used if no special handling is required. |
IMPORT_C TBool | BackgroundBetweenRects | ( | MAknsSkinInstance * | aInstance, |
MAknsControlContext * | aContext, | |||
CWindowGc & | aGc, | |||
const TRect & | aOuterRect, | |||
const TRect & | aInnerRect | |||
) | [static] |
Draws background between rects. Draws bacground between specified rectangles. Origin is assumed to be (0,0).
See DrawBackground for details on chained layouts.
Parameters | |
---|---|
aInstance | Pointer to skin instance as obtained from AknsUtils::SkinInstance(). If NULL rectangle is cleared without bitmap. |
aContext | Control context to obtain context specific information about background drawing. If NULL and skin instance was given, default parameters are used. |
aGc | Graphics context to be used for drawing. |
aOuterRect | Outer rectangle. |
aInnerRect | Inner rectangle. |
IMPORT_C TBool | BackgroundBetweenRects | ( | MAknsSkinInstance * | aInstance, |
MAknsControlContext * | aContext, | |||
const CCoeControl * | aControl, | |||
CWindowGc & | aGc, | |||
const TRect & | aOuterRect, | |||
const TRect & | aInnerRect | |||
) | [static] |
Draws background between rects. Draws bacground between specified rectangles.
See DrawBackground for details on chained layouts.
Parameters | |
---|---|
aInstance | Pointer to skin instance as obtained from AknsUtils::SkinInstance(). If NULL rectangle is cleared without bitmap. |
aContext | Control context to obtain context specific information about background drawing. Must be specified if aInstance is not NULL. |
aControl | Control that knows the current window. Must be specified if parent absolute layout can be used, otherwise NULL may be given. |
aGc | Graphics context to be used for drawing. |
aOuterRect | Outer rectangle. |
aInnerRect | Inner rectangle. |
IMPORT_C TBool | BackgroundBetweenRects | ( | MAknsSkinInstance * | aInstance, |
MAknsControlContext * | aContext, | |||
const CCoeControl * | aControl, | |||
CWindowGc & | aGc, | |||
const TRect & | aOuterRect, | |||
const TRect & | aInnerRect, | |||
const TInt | aDrawParam | |||
) | [static] |
Draws background between rects. Draws bacground between specified rectangles with drawing parameters.
Parameters | |
---|---|
aInstance | Pointer to skin instance as obtained from AknsUtils::SkinInstance(). If NULL rectangle is cleared without bitmap. |
aContext | Control context to obtain context specific information about background drawing. Must be specified if aInstance is not NULL. |
aControl | Control that knows the current window. Must be specified if parent absolute layout can be used, otherwise NULL may be given. |
aGc | Graphics context to be used for drawing. |
aOuterRect | Outer rectangle. |
aInnerRect | Inner rectangle. |
aDrawParam | Bitwise combination of drawing parameters. KAknsDrawParamDefault should be used if no special handling is required. |
IMPORT_C MAknsControlContext * | ControlContext | ( | const MObjectProvider * | aMop | ) | [static] |
Returns pointer to the current control context. If aMop parameter is specified retrieves the nearest control context in control hierarchy. If none is found (or NULL parameter was given) returns NULL.
Parameters | |
---|---|
aMop | Object provider to be used to find the control context or NULL. |
IMPORT_C MAknsControlContext * | ControlContextOfParent | ( | const CCoeControl * | aControl | ) | [static] |
Returns pointer to the control context of the parent of the given control. The context possibly supplied by the control itself is ignored.
Parameters | |
---|---|
aControl | Pointer to CCoeControl or NULL. |
IMPORT_C TBool | DrawBackground | ( | MAknsSkinInstance * | aInstance, |
MAknsControlContext * | aContext, | |||
const CCoeControl * | aControl, | |||
CBitmapContext & | aGc, | |||
const TPoint & | aDstPos, | |||
const TRect & | aControlRect, | |||
const TInt | aDrawParam | |||
) | [static] |
Draws background to the given graphics context. The origin is queried from the control position list (if given using AknsUtils::RegisterControlPosition). If not found, the origin is queried from the given control, which may result in a window server flush.
If background contains multiple layers, they are drawn in the sequence specified by the context. If multiple contexts are chained (using SetParentContext), they are drawn in reverse order, i.e. the context given as parameter to this method call is drawn last.
Drawing parameter KAknsDrawParamNoClearUnderImage is automatically assumed for all the chained contexts, except the deepest one.
Parameters | |
---|---|
aInstance | Pointer to skin instance as obtained from AknsUtils::SkinInstance(). If NULL rectangle is cleared without bitmap. |
aContext | Control context to obtain context specific information about background drawing. Must be specified, if aInstance is not NULL. |
aControl | Control that knows the current window. Must be specified if parent absolute layout can be used, otherwise NULL may be given. |
aGc | Graphics context to be used for drawing. |
aDstPos | Destination position (top-left corner of the area to be drawn) in graphics context coordinate system. |
aControlRect | Rectangle (in the control coordinate system) to be drawn. |
aDrawParam | Bitwise combination of drawing parameters. KAknsDrawParamDefault should be used if no special handling is required. |
IMPORT_C void | DrawCachedImage | ( | MAknsSkinInstance * | aInstance, |
CWindowGc & | aGc, | |||
const TRect & | aRect, | |||
const TAknsItemID & | aID | |||
) | [static] |
Draws a cached image (with its attributes specified in the skin) to the given rectangle.
Parameters | |
---|---|
aInstance | Pointer to the skin instance. If NULL, the method returns immediately. |
aGc | Graphics context to be used for drawing. |
aRect | Rectangle specifying the pane used for drawing. The image is laid out within the rectangle. |
aID | Item ID of the image to be drawn. |
IMPORT_C void | DrawCachedImage | ( | MAknsSkinInstance * | aInstance, |
CFbsBitGc & | aGc, | |||
const TRect & | aRect, | |||
const TAknsItemID & | aID | |||
) | [static] |
Draws a cached image (with its attributes specified in the skin) to the given rectangle in an off-screen graphics context.
Parameters | |
---|---|
aInstance | Pointer to the skin instance. If NULL, the method returns immediately. |
aGc | Bitmapped graphics context to be used for drawing. |
aRect | Rectangle specifying the pane used for drawing. The image is laid out within the rectangle. |
aID | Item ID of the image to be drawn. |
IMPORT_C TBool | DrawFrame | ( | MAknsSkinInstance * | aInstance, |
CWindowGc & | aGc, | |||
const TRect & | aOuterRect, | |||
const TRect & | aInnerRect, | |||
const TAknsItemID & | aFrameID, | |||
const TAknsItemID & | aCenterID | |||
) | [static] |
Draws a frame (with cached images) to the specified area.
Parameters | |
---|---|
aInstance | Pointer to the skin instance. If NULL, the method returns EFalse. |
aGc | Graphics context to be used for drawing. |
aOuterRect | Outer rectangle of the frame. Frame elements will be drawn within this rectangle. |
aInnerRect | Inner rectangle of the frame. Frame center will be drawn within this rectangle. |
aFrameID | Item ID of the entire frame. |
aCenterID | Item ID of the center part of the frame. If KAknsIIDNone, no center will be drawn. If KAknsIIDDefault, the default value from the frame itself will be used. Other values, the item to be used for the center part. If the frame is specified as 1 part graphics in the skin instead of 9 part graphics, this parameter has no effect. |
IMPORT_C TBool | DrawFrame | ( | MAknsSkinInstance * | aInstance, |
CFbsBitGc & | aGc, | |||
const TRect & | aOuterRect, | |||
const TRect & | aInnerRect, | |||
const TAknsItemID & | aFrameID, | |||
const TAknsItemID & | aCenterID, | |||
const TInt | aDrawParam | |||
) | [static] |
Draws a frame (with cached images) to the specified area in an off-screen graphics context.
Parameters | |
---|---|
aInstance | Pointer to the skin instance. If NULL, the method returns EFalse. |
aGc | Bitmapped graphics context to be used for drawing. |
aOuterRect | Outer rectangle of the frame. Frame elements will be drawn within this rectangle. |
aInnerRect | Inner rectangle of the frame. Frame center will be drawn within this rectangle. |
aFrameID | Item ID of the entire frame. |
aCenterID | Item ID of the center part of the frame. If KAknsIIDNone, no center will be drawn. If KAknsIIDDefault, the default value from the frame itself will be used. Other values, the item to be used for the center part. If unsure, specify KAknsIIDDefault. If the frame is specified as 1 part graphics in the skin instead of 9 part graphics, this parameter has no effect. |
aDrawParam | Bitwise combination of drawing parameters. KAknsDrawParamDefault should be used if no special handling is required. |
IMPORT_C TBool | DrawFrame | ( | MAknsSkinInstance * | aInstance, |
CFbsBitGc & | aGc, | |||
const TRect & | aOuterRect, | |||
const TRect & | aInnerRect, | |||
const TAknsItemID & | aFrameID, | |||
const TAknsItemID & | aCenterID | |||
) | [static] |
Draws a frame (with cached images) to the specified area in an off-screen graphics context.
Parameters | |
---|---|
aInstance | Pointer to the skin instance. If NULL, the method returns EFalse. |
aGc | Bitmapped graphics context to be used for drawing. |
aOuterRect | Outer rectangle of the frame. Frame elements will be drawn within this rectangle. |
aInnerRect | Inner rectangle of the frame. Frame center will be drawn within this rectangle. |
aFrameID | Item ID of the entire frame. |
aCenterID | Item ID of the center part of the frame. If KAknsIIDNone, no center will be drawn. If KAknsIIDDefault, the default value from the frame itself will be used. Other values, the item to be used for the center part. If unsure, specifi KAknsIIDDefault. If the frame is specified as 1 part graphics in the skin instead of 9 part graphics, this parameter has no effect. |
IMPORT_C TBool | DrawFramePart | ( | MAknsSkinInstance * | aInstance, |
CWindowGc & | aGc, | |||
const TRect & | aRect, | |||
const TAknsItemID & | aFrameID, | |||
const TAknsFrameElementIndex | aFrameElement | |||
) | [static] |
Draws the specified part of the frame (with a cached image) to the specified rectangle.
Parameters | |
---|---|
aInstance | Pointer to the skin instance. If NULL, the method returns EFalse. |
aGc | Graphics context to be used for drawing. |
aRect | Rectangle for drawing. This must be the rectangle of the specific part of the drawn that will be drawn, e.g. top-left corner rectangle if the top-left corner is being drawn. |
aFrameID | Item ID of the entire frame. |
aFrameElement | Element (index) of the frame element to be drawn. |
IMPORT_C TBool | HasBitmapBackground | ( | MAknsSkinInstance * | aInstance, |
MAknsControlContext * | aContext | |||
) | [static] |
Determines whether background drawing would be done with a bitmap (deprecated).
DeprecatedThis method is deprecated as of release 2.8. Use the return values of background drawing functions to determine whether the background was drawn with skinned content. The return value is always ETrue starting from rel 3.1
Parameters | |
---|---|
aInstance | Pointer to skin instance. If NULL, method returns EFalse. |
aContext | Control context, or NULL if no context is used. Note that absence of control context affects the result. |
IMPORT_C TBool | IsListSeperatorLines | ( | MAknsSkinInstance * | aInstance | ) | [static] |
Returns a boolean value indicating whether list separator lines should be drawn.
The value of KAknsIIDPropertyListSeparatorLines property.
The presence of (non-scalable) column bitmaps. If found, EFalse is returned.
The presence of generic list background (non-scalable). If found, EFalse is returned.
Note that the exact internal implementation of the checks is subject to change.
Parameters | |
---|---|
aInstance | Pointer to the skin instance. If NULL, the method returns ETrue. |
IMPORT_C TBool | PrepareFrame | ( | MAknsSkinInstance * | aInstance, |
const TRect & | aOuterRect, | |||
const TRect & | aInnerRect, | |||
const TAknsItemID & | aFrameID, | |||
const TAknsItemID & | aCenterID | |||
) | [static] |
Prepares the frame graphics for drawing. This function should be called when the frame sizes are known and in places where Flushing the Window server buffer will not cause flicker. For example, a good place to call PrepareFrame() would be controls SizeChanged function. Altough its not mandatory to call PrepareFrame() before DrawFrame(), it's highly recommended in order to avoid unnecessary flushes in the middle of the actual drawing routine.
Note that the rect parameters must be exactly the same for PrepareFrame and subsequent DrawFrame calls. Otherwise the DrawFrame functions will cause a flush, which leads to flicker.
Parameters | |
---|---|
aInstance | Pointer to the skin instance. If NULL, the method returns EFalse. |
aOuterRect | Outer rectangle of the frame. Frame elements are scaled to this size. |
aInnerRect | Inner rectangle of the frame. Frame center is scaled to this size |
aFrameID | Item ID of the entire frame. |
aCenterID | Item ID of the center part of the frame. If KAknsIIDNone, no center part will be prepared. If KAknsIIDDefault, the default value from the frame itself will be used. Other values, the item to be used for the center part. If the frame is specified as 1 part graphics in the skin instead of 9 part graphics, this parameter has no effect. |
IMPORT_C TSlidingMode | SlidingMode | ( | MAknsSkinInstance * | aInstance | ) | [static] |
Returns an enum value indicating the way notes and queries appear to the screen (sliding animation)
Parameters | |
---|---|
aInstance | Pointer to the skin instance. If NULL, the method returns ESlidingDisabled. |