williamr@2: /* williamr@2: * Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Defines a public static class AknsDrawUtils and related williamr@2: * constants. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef AKNSDRAWUTILS_H williamr@2: #define AKNSDRAWUTILS_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: williamr@2: // CONSTANTS williamr@2: williamr@2: /** williamr@2: * Default value for drawing parameters. williamr@2: * williamr@2: * @since 2.0 williamr@2: */ williamr@2: static const TInt KAknsDrawParamDefault = 0x0; williamr@2: williamr@2: /** williamr@2: * Drawing parameter that limits processing of layout levels to the first one. williamr@2: * This can be used to temporarily disable secondary layout levels. williamr@2: * williamr@2: * @since 2.0 williamr@2: */ williamr@2: static const TInt KAknsDrawParamLimitToFirstLevel = 0x1; williamr@2: williamr@2: /** williamr@2: * Drawing parameter that suspends clearing under images. Only the first williamr@2: * layout level is affected. williamr@2: * williamr@2: * @since 2.0 williamr@2: */ williamr@2: static const TInt KAknsDrawParamNoClearUnderImage = 0x2; williamr@2: williamr@2: /** williamr@2: * Drawing parameter that causes the layouts and bitmaps to be prepared, williamr@2: * but no actual drawing takes place. williamr@2: * williamr@2: * @since 2.8 williamr@2: */ williamr@2: static const TInt KAknsDrawParamPrepareOnly = 0x04; williamr@2: williamr@2: /** williamr@2: * Drawing parameter that draws only the RGB channel of data. williamr@2: * williamr@2: * @since 3.0 williamr@2: */ williamr@2: static const TInt KAknsDrawParamRGBOnly = 0x8; williamr@2: williamr@2: /** williamr@2: * Drawing parameter that draws only the alpha channel of data. If the data williamr@2: * is unmasked, the result is undefined. williamr@2: * williamr@2: * @since 3.0 williamr@2: */ williamr@2: static const TInt KAknsSDMAlphaOnly = 0x10; williamr@2: /** williamr@2: * Drawing parameter that allows empty SCALABLEITEMS to use williamr@2: * the parent bitmap directly williamr@2: * williamr@2: * @since 3.0 williamr@2: */ williamr@2: static const TInt KAknsDrawParamChained = 0x20; williamr@2: williamr@2: /** williamr@2: * Forces drawing the bottom level in chain to use RGBOnly. Bottom level is the williamr@2: * first drawn level, visually the bottom most level. williamr@2: * williamr@2: * @since 3.0 williamr@2: */ williamr@2: static const TInt KAknsDrawParamBottomLevelRGBOnly = 0x40; williamr@2: williamr@2: /** williamr@2: * Ignores layer mask when drawing layers. williamr@2: * williamr@2: * @since 3.2 williamr@2: */ williamr@2: williamr@2: static const TInt KAknsDrawParamIgnoreLayerMask = 0x80; williamr@2: williamr@2: /** williamr@2: * Direction, from where notes and queries slide to the screen. williamr@2: * williamr@2: * @since 3.1 williamr@2: */ williamr@2: enum TSlidingMode williamr@2: { williamr@2: /** Sliding is disabled either by skin or compile time */ williamr@2: ESlidingDisabled = 0, williamr@2: williamr@2: /** Slide from the CBA side */ williamr@2: ESlidingFromCBA, williamr@2: williamr@2: /** Slide from left */ williamr@2: ESlidingFromLeft, williamr@2: williamr@2: /** Slide from topleft */ williamr@2: ESlidingFromTopLeft, williamr@2: williamr@2: /** Slide from top */ williamr@2: ESlidingFromTop, williamr@2: williamr@2: /** Slide from topright */ williamr@2: ESlidingFromTopRight, williamr@2: williamr@2: /** Slide from right */ williamr@2: ESlidingFromRight, williamr@2: williamr@2: /** Slide from bottomright */ williamr@2: ESlidingFromBottomRight, williamr@2: williamr@2: /** Slide from bottom */ williamr@2: ESlidingFromBottom, williamr@2: williamr@2: /** Slide from bottomleft */ williamr@2: ESlidingFromBottomLeft, williamr@2: williamr@2: /** Slide from random direction (any of the 8 directions) */ williamr@2: ESlidingFromRandom williamr@2: }; williamr@2: williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class MAknsSkinInstance; williamr@2: class MAknsControlContext; williamr@2: class CWindowGc; williamr@2: class CFbsBitGc; williamr@2: class CCoeControl; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * Static utility class to support Avkon Skins drawing operations. williamr@2: * AknsDrawUtils provides utility methods to perform skin-aware drawing williamr@2: * operations, such as background drawing. williamr@2: * williamr@2: * This is a public static class with exported functions. williamr@2: * The class is not intended for derivation outside the library. williamr@2: * williamr@2: * @lib AknSkins.lib williamr@2: * williamr@2: * @since 2.0 williamr@2: */ williamr@2: class AknsDrawUtils williamr@2: { williamr@2: public: // New functions williamr@2: williamr@2: /** williamr@2: * Returns pointer to the current control context. williamr@2: * If aMop parameter is specified retrieves the nearest control context williamr@2: * in control hierarchy. If none is found (or @c NULL parameter was williamr@2: * given) returns @c NULL. williamr@2: * williamr@2: * @since 2.0 williamr@2: * williamr@2: * @param aMop Object provider to be used to find the control context williamr@2: * or @c NULL. williamr@2: * williamr@2: * @return Pointer to the nearest control context or @c NULL if none williamr@2: * was found. williamr@2: */ williamr@2: IMPORT_C static MAknsControlContext* ControlContext( williamr@2: const MObjectProvider* aMop ); williamr@2: williamr@2: /** williamr@2: * Returns pointer to the control context of the parent of the given williamr@2: * control. The context possibly supplied by the control itself is ignored. williamr@2: * williamr@2: * @since 2.6 williamr@2: * williamr@2: * @param aControl Pointer to CCoeControl or @c NULL. williamr@2: * williamr@2: * @return Pointer to the nearest control context of the parent control williamr@2: * or @c NULL if none was found. williamr@2: */ williamr@2: IMPORT_C static MAknsControlContext* ControlContextOfParent( williamr@2: const CCoeControl* aControl ); williamr@2: williamr@2: /** williamr@2: * Draws background with assumed origin. williamr@2: * Draws bacground to the specified rectangle. Origin is assumed williamr@2: * to be (0,0). This overload can not be used with parent absolute williamr@2: * layouts. williamr@2: * williamr@2: * See @c DrawBackground for details on chained layouts. williamr@2: * williamr@2: * @since 2.0 williamr@2: * williamr@2: * @param aInstance Pointer to skin instance as obtained from williamr@2: * AknsUtils::SkinInstance(). If @c NULL rectangle is cleared williamr@2: * without bitmap. williamr@2: * williamr@2: * @param aContext Control context to obtain context specific williamr@2: * information about background drawing. If @c NULL and skin williamr@2: * instance was given, default parameters are used. williamr@2: * williamr@2: * @param aGc Graphics context to be used for drawing. williamr@2: * williamr@2: * @param aRect Rectangle to be drawn. williamr@2: * williamr@2: * @return ETrue if background was drawn with a bitmap, EFalse williamr@2: * otherwise. williamr@2: */ williamr@2: IMPORT_C static TBool Background( MAknsSkinInstance* aInstance, williamr@2: MAknsControlContext* aContext, CWindowGc& aGc, const TRect& aRect ); williamr@2: williamr@2: /** williamr@2: * Draws background with proper origin. williamr@2: * Draws bacground to the specified rectangle. The origin is queried williamr@2: * from the control position list (if given using williamr@2: * AknsUtils::RegisterControlPosition). If not found, the origin is williamr@2: * queried from the given control, which may result in a window server williamr@2: * flush. williamr@2: * williamr@2: * See @c DrawBackground for details on chained layouts. williamr@2: * williamr@2: * @since 2.0 williamr@2: * williamr@2: * @param aInstance Pointer to skin instance as obtained from williamr@2: * AknsUtils::SkinInstance(). If @c NULL rectangle is cleared williamr@2: * without bitmap. williamr@2: * williamr@2: * @param aContext Control context to obtain context specific williamr@2: * information about background drawing. Must be specified, if williamr@2: * aInstance is not @c NULL. williamr@2: * williamr@2: * @param aControl Control that knows the current window. williamr@2: * Must be specified if parent absolute layout can be used, williamr@2: * otherwise @c NULL may be given. williamr@2: * williamr@2: * @param aGc Graphics context to be used for drawing. williamr@2: * williamr@2: * @param aRect Rectangle to be drawn. williamr@2: * williamr@2: * @return ETrue if background was drawn with a bitmap, EFalse williamr@2: * otherwise. Note that many scalable skins implicitly define williamr@2: * background bitmaps for seemingly blank areas. williamr@2: */ williamr@2: IMPORT_C static TBool Background( MAknsSkinInstance* aInstance, williamr@2: MAknsControlContext* aContext, const CCoeControl* aControl, williamr@2: CWindowGc& aGc, const TRect& aRect ); williamr@2: williamr@2: /** williamr@2: * Draws background with proper origin and drawing parameters. williamr@2: * Draws bacground to the specified rectangle. The origin is queried williamr@2: * from the control position list (if given using williamr@2: * AknsUtils::RegisterControlPosition). If not found, the origin is williamr@2: * queried from the given control, which may result in a window server williamr@2: * flush. Drawing parameters may be used to control drawing. williamr@2: * williamr@2: * See @c DrawBackground for details on chained layouts. williamr@2: * williamr@2: * @since 2.0 williamr@2: * williamr@2: * @param aInstance Pointer to skin instance as obtained from williamr@2: * AknsUtils::SkinInstance(). If @c NULL rectangle is cleared williamr@2: * without bitmap. williamr@2: * williamr@2: * @param aContext Control context to obtain context specific williamr@2: * information about background drawing. Must be specified, if williamr@2: * aInstance is not @c NULL. williamr@2: * williamr@2: * @param aControl Control that knows the current window. williamr@2: * Must be specified if parent absolute layout can be used, williamr@2: * otherwise @c NULL may be given. williamr@2: * williamr@2: * @param aGc Graphics context to be used for drawing. williamr@2: * williamr@2: * @param aRect Rectangle to be drawn. williamr@2: * williamr@2: * @param aDrawParam Bitwise combination of drawing parameters. williamr@2: * @c KAknsDrawParamDefault should be used if no special handling williamr@2: * is required. williamr@2: * williamr@2: * @return ETrue if background was drawn with a bitmap, EFalse williamr@2: * otherwise. Note that many scalable skins implicitly define williamr@2: * background bitmaps for seemingly blank areas. williamr@2: */ williamr@2: IMPORT_C static TBool Background( MAknsSkinInstance* aInstance, williamr@2: MAknsControlContext* aContext, const CCoeControl* aControl, williamr@2: CWindowGc& aGc, const TRect& aRect, const TInt aDrawParam ); williamr@2: williamr@2: /** williamr@2: * Draws background to the given graphics context. williamr@2: * The origin is queried from the control position list (if given using williamr@2: * AknsUtils::RegisterControlPosition). If not found, the origin is williamr@2: * queried from the given control, which may result in a window server williamr@2: * flush. williamr@2: * williamr@2: * If background contains multiple layers, they are drawn in the williamr@2: * sequence specified by the context. If multiple contexts are chained williamr@2: * (using @c SetParentContext), they are drawn in reverse order, i.e. williamr@2: * the context given as parameter to this method call is drawn last. williamr@2: * williamr@2: * Drawing parameter KAknsDrawParamNoClearUnderImage is automatically williamr@2: * assumed for all the chained contexts, except the deepest one. williamr@2: * williamr@2: * @since 2.0 williamr@2: * williamr@2: * @param aInstance Pointer to skin instance as obtained from williamr@2: * AknsUtils::SkinInstance(). If @c NULL rectangle is cleared williamr@2: * without bitmap. williamr@2: * williamr@2: * @param aContext Control context to obtain context specific williamr@2: * information about background drawing. Must be specified, if williamr@2: * aInstance is not @c NULL. williamr@2: * williamr@2: * @param aControl Control that knows the current window. williamr@2: * Must be specified if parent absolute layout can be used, williamr@2: * otherwise @c NULL may be given. williamr@2: * williamr@2: * @param aGc Graphics context to be used for drawing. williamr@2: * williamr@2: * @param aDstPos Destination position (top-left corner of the area williamr@2: * to be drawn) in graphics context coordinate system. williamr@2: * williamr@2: * @param aControlRect Rectangle (in the control coordinate system) williamr@2: * to be drawn. williamr@2: * williamr@2: * @param aDrawParam Bitwise combination of drawing parameters. williamr@2: * @c KAknsDrawParamDefault should be used if no special handling williamr@2: * is required. williamr@2: * williamr@2: * @return ETrue if background was drawn with a bitmap, EFalse williamr@2: * otherwise. Note that many scalable skins implicitly define williamr@2: * background bitmaps for seemingly blank areas. williamr@2: */ williamr@2: IMPORT_C static TBool DrawBackground( MAknsSkinInstance* aInstance, williamr@2: MAknsControlContext* aContext, const CCoeControl* aControl, williamr@2: CBitmapContext& aGc, const TPoint& aDstPos, williamr@2: const TRect& aControlRect, const TInt aDrawParam ); williamr@2: williamr@2: /** williamr@2: * Draws background between rects. williamr@2: * Draws bacground between specified rectangles. Origin is assumed williamr@2: * to be (0,0). williamr@2: * williamr@2: * See @c DrawBackground for details on chained layouts. williamr@2: * williamr@2: * @since 2.0 williamr@2: * williamr@2: * @param aInstance Pointer to skin instance as obtained from williamr@2: * AknsUtils::SkinInstance(). If @c NULL rectangle is cleared williamr@2: * without bitmap. williamr@2: * williamr@2: * @param aContext Control context to obtain context specific williamr@2: * information about background drawing. If @c NULL and skin williamr@2: * instance was given, default parameters are used. williamr@2: * williamr@2: * @param aGc Graphics context to be used for drawing. williamr@2: * williamr@2: * @param aOuterRect Outer rectangle. williamr@2: * williamr@2: * @param aInnerRect Inner rectangle. williamr@2: * williamr@2: * @return ETrue if background was drawn with a bitmap, EFalse williamr@2: * otherwise. Note that many scalable skins implicitly define williamr@2: * background bitmaps for seemingly blank areas. williamr@2: */ williamr@2: IMPORT_C static TBool BackgroundBetweenRects( williamr@2: MAknsSkinInstance* aInstance, williamr@2: MAknsControlContext* aContext, CWindowGc& aGc, williamr@2: const TRect& aOuterRect,const TRect& aInnerRect ); williamr@2: williamr@2: /** williamr@2: * Draws background between rects. williamr@2: * Draws bacground between specified rectangles. williamr@2: * williamr@2: * See @c DrawBackground for details on chained layouts. williamr@2: * williamr@2: * @since 2.0 williamr@2: * williamr@2: * @param aInstance Pointer to skin instance as obtained from williamr@2: * AknsUtils::SkinInstance(). If @c NULL rectangle is cleared williamr@2: * without bitmap. williamr@2: * williamr@2: * @param aContext Control context to obtain context specific williamr@2: * information about background drawing. Must be specified if williamr@2: * aInstance is not @c NULL. williamr@2: * williamr@2: * @param aControl Control that knows the current window. williamr@2: * Must be specified if parent absolute layout can be used, williamr@2: * otherwise @c NULL may be given. williamr@2: * williamr@2: * @param aGc Graphics context to be used for drawing. williamr@2: * williamr@2: * @param aOuterRect Outer rectangle. williamr@2: * williamr@2: * @param aInnerRect Inner rectangle. williamr@2: * williamr@2: * @return ETrue if background was drawn with a bitmap, EFalse williamr@2: * otherwise. Note that many scalable skins implicitly define williamr@2: * background bitmaps for seemingly blank areas. williamr@2: */ williamr@2: IMPORT_C static TBool BackgroundBetweenRects( williamr@2: MAknsSkinInstance* aInstance, williamr@2: MAknsControlContext* aContext, const CCoeControl* aControl, williamr@2: CWindowGc& aGc, williamr@2: const TRect& aOuterRect,const TRect& aInnerRect ); williamr@2: williamr@2: /** williamr@2: * Draws background between rects. williamr@2: * Draws bacground between specified rectangles with drawing parameters. williamr@2: * williamr@2: * @since 2.0 williamr@2: * williamr@2: * @param aInstance Pointer to skin instance as obtained from williamr@2: * AknsUtils::SkinInstance(). If @c NULL rectangle is cleared williamr@2: * without bitmap. williamr@2: * williamr@2: * @param aContext Control context to obtain context specific williamr@2: * information about background drawing. Must be specified if williamr@2: * aInstance is not @c NULL. williamr@2: * williamr@2: * @param aControl Control that knows the current window. williamr@2: * Must be specified if parent absolute layout can be used, williamr@2: * otherwise @c NULL may be given. williamr@2: * williamr@2: * @param aGc Graphics context to be used for drawing. williamr@2: * williamr@2: * @param aOuterRect Outer rectangle. williamr@2: * williamr@2: * @param aInnerRect Inner rectangle. williamr@2: * williamr@2: * @param aDrawParam Bitwise combination of drawing parameters. williamr@2: * @c KAknsDrawParamDefault should be used if no special handling williamr@2: * is required. williamr@2: * williamr@2: * @return ETrue if background was drawn with a bitmap, EFalse williamr@2: * otherwise. Note that many scalable skins implicitly define williamr@2: * background bitmaps for seemingly blank areas. williamr@2: */ williamr@2: IMPORT_C static TBool BackgroundBetweenRects( williamr@2: MAknsSkinInstance* aInstance, williamr@2: MAknsControlContext* aContext, const CCoeControl* aControl, williamr@2: CWindowGc& aGc, williamr@2: const TRect& aOuterRect, const TRect& aInnerRect, williamr@2: const TInt aDrawParam ); williamr@2: williamr@2: /** williamr@2: * Determines whether background drawing would be done with williamr@2: * a bitmap (deprecated). williamr@2: * williamr@2: * @param aInstance Pointer to skin instance. If @c NULL, williamr@2: * method returns EFalse. williamr@2: * williamr@2: * @param aContext Control context, or @c NULL if no context williamr@2: * is used. Note that absence of control context affects williamr@2: * the result. williamr@2: * williamr@2: * @return @c ETrue if background would be drawn with a bitmap, williamr@2: * @c EFalse otherwise. If a scalable skin is currently active, williamr@2: * the return value is undefined, and does not necessarily williamr@2: * reflect the return value of the actual drawing operation. williamr@2: * williamr@2: * @deprecated This method is deprecated as of release 2.8. williamr@2: * Use the return values of background drawing functions to williamr@2: * determine whether the background was drawn with skinned williamr@2: * content. The return value is always ETrue starting from williamr@2: * rel 3.1 williamr@2: */ williamr@2: IMPORT_C static TBool HasBitmapBackground( williamr@2: MAknsSkinInstance* aInstance, williamr@2: MAknsControlContext* aContext ); williamr@2: williamr@2: /** williamr@2: * Draws a cached image (with its attributes specified in the skin) williamr@2: * to the given rectangle. williamr@2: * williamr@2: * @param aInstance Pointer to the skin instance. If @c NULL, williamr@2: * the method returns immediately. williamr@2: * williamr@2: * @param aGc Graphics context to be used for drawing. williamr@2: * williamr@2: * @param aRect Rectangle specifying the pane used for drawing. The williamr@2: * image is laid out within the rectangle. williamr@2: * williamr@2: * @param aID Item ID of the image to be drawn. williamr@2: */ williamr@2: IMPORT_C static void DrawCachedImage( MAknsSkinInstance* aInstance, williamr@2: CWindowGc& aGc, const TRect& aRect, const TAknsItemID& aID ); williamr@2: williamr@2: /** williamr@2: * Draws a cached image (with its attributes specified in the skin) williamr@2: * to the given rectangle in an off-screen graphics context. williamr@2: * williamr@2: * @since 2.8 williamr@2: * williamr@2: * @param aInstance Pointer to the skin instance. If @c NULL, williamr@2: * the method returns immediately. williamr@2: * williamr@2: * @param aGc Bitmapped graphics context to be used for drawing. williamr@2: * williamr@2: * @param aRect Rectangle specifying the pane used for drawing. The williamr@2: * image is laid out within the rectangle. williamr@2: * williamr@2: * @param aID Item ID of the image to be drawn. williamr@2: */ williamr@2: IMPORT_C static void DrawCachedImage( MAknsSkinInstance* aInstance, williamr@2: CFbsBitGc& aGc, const TRect& aRect, const TAknsItemID& aID ); williamr@2: williamr@2: /** williamr@2: * Draws a frame (with cached images) to the specified area. williamr@2: * williamr@2: * @param aInstance Pointer to the skin instance. If @c NULL, the williamr@2: * method returns EFalse. williamr@2: * williamr@2: * @param aGc Graphics context to be used for drawing. williamr@2: * williamr@2: * @param aOuterRect Outer rectangle of the frame. Frame elements williamr@2: * will be drawn within this rectangle. williamr@2: * williamr@2: * @param aInnerRect Inner rectangle of the frame. Frame center williamr@2: * will be drawn within this rectangle. williamr@2: * williamr@2: * @param aFrameID Item ID of the entire frame. williamr@2: * williamr@2: * @param aCenterID Item ID of the center part of the frame. If williamr@2: * @c KAknsIIDNone, no center will be drawn. If @c KAknsIIDDefault, williamr@2: * the default value from the frame itself will be used. Other values, williamr@2: * the item to be used for the center part. If the frame is williamr@2: * specified as 1 part graphics in the skin instead of 9 part williamr@2: * graphics, this parameter has no effect. williamr@2: * williamr@2: * @return EFalse, if the frame was not drawn at all. ETrue, if the williamr@2: * frame was (at least partially) drawn. williamr@2: */ williamr@2: IMPORT_C static TBool DrawFrame( MAknsSkinInstance* aInstance, williamr@2: CWindowGc& aGc, const TRect& aOuterRect, const TRect& aInnerRect, williamr@2: const TAknsItemID& aFrameID, const TAknsItemID& aCenterID ); williamr@2: williamr@2: /** williamr@2: * Prepares the frame graphics for drawing. This function should be williamr@2: * called when the frame sizes are known and in places where Flushing williamr@2: * the Window server buffer will not cause flicker. For example, a williamr@2: * good place to call PrepareFrame() would be controls SizeChanged williamr@2: * function. Altough its not mandatory to call PrepareFrame() williamr@2: * before DrawFrame(), it's highly recommended in order to avoid williamr@2: * unnecessary flushes in the middle of the actual drawing routine. williamr@2: * williamr@2: * Note that the rect parameters must be exactly the same for williamr@2: * PrepareFrame and subsequent DrawFrame calls. Otherwise the williamr@2: * DrawFrame functions will cause a flush, which leads williamr@2: * to flicker. williamr@2: * williamr@2: * @since 2.8 williamr@2: * williamr@2: * @param aInstance Pointer to the skin instance. If @c NULL, the williamr@2: * method returns EFalse. williamr@2: * williamr@2: * @param aOuterRect Outer rectangle of the frame. Frame elements williamr@2: * are scaled to this size. williamr@2: * williamr@2: * @param aInnerRect Inner rectangle of the frame. Frame center williamr@2: * is scaled to this size williamr@2: * williamr@2: * @param aFrameID Item ID of the entire frame. williamr@2: * williamr@2: * @param aCenterID Item ID of the center part of the frame. If williamr@2: * @c KAknsIIDNone, no center part will be prepared. williamr@2: * If @c KAknsIIDDefault, the default value from the frame williamr@2: * itself will be used. Other values, the item to be used williamr@2: * for the center part. If the frame is specified as 1 part williamr@2: * graphics in the skin instead of 9 part graphics, this williamr@2: * parameter has no effect. williamr@2: * williamr@2: * @return EFalse, if were nothing to prepare. ETrue, if the williamr@2: * frame was (at least partially) prepared. williamr@2: */ williamr@2: IMPORT_C static TBool PrepareFrame( MAknsSkinInstance* aInstance, williamr@2: const TRect& aOuterRect, const TRect& aInnerRect, williamr@2: const TAknsItemID& aFrameID, const TAknsItemID& aCenterID); williamr@2: williamr@2: /** williamr@2: * Draws a frame (with cached images) to the specified area williamr@2: * in an off-screen graphics context. williamr@2: * williamr@2: * @since 2.8 williamr@2: * williamr@2: * @param aInstance Pointer to the skin instance. If @c NULL, the williamr@2: * method returns EFalse. williamr@2: * williamr@2: * @param aGc Bitmapped graphics context to be used for drawing. williamr@2: * williamr@2: * @param aOuterRect Outer rectangle of the frame. Frame elements williamr@2: * will be drawn within this rectangle. williamr@2: * williamr@2: * @param aInnerRect Inner rectangle of the frame. Frame center williamr@2: * will be drawn within this rectangle. williamr@2: * williamr@2: * @param aFrameID Item ID of the entire frame. williamr@2: * williamr@2: * @param aCenterID Item ID of the center part of the frame. If williamr@2: * @c KAknsIIDNone, no center will be drawn. If @c KAknsIIDDefault, williamr@2: * the default value from the frame itself will be used. Other values, williamr@2: * the item to be used for the center part. If unsure, specify williamr@2: * @c KAknsIIDDefault. If the frame is specified as 1 part williamr@2: * graphics in the skin instead of 9 part graphics, this williamr@2: * parameter has no effect. williamr@2: * williamr@2: * @param aDrawParam Bitwise combination of drawing parameters. williamr@2: * @c KAknsDrawParamDefault should be used if no special handling williamr@2: * is required. williamr@2: * williamr@2: * @return EFalse, if the frame was not drawn at all. ETrue, if the williamr@2: * frame was (at least partially) drawn. williamr@2: */ williamr@2: IMPORT_C static TBool DrawFrame( MAknsSkinInstance* aInstance, williamr@2: CFbsBitGc& aGc, const TRect& aOuterRect, const TRect& aInnerRect, williamr@2: const TAknsItemID& aFrameID, const TAknsItemID& aCenterID, williamr@2: const TInt aDrawParam ); williamr@2: williamr@2: /** williamr@2: * Draws a frame (with cached images) to the specified area williamr@2: * in an off-screen graphics context. williamr@2: * williamr@2: * @since 2.8 williamr@2: * williamr@2: * @param aInstance Pointer to the skin instance. If @c NULL, the williamr@2: * method returns EFalse. williamr@2: * williamr@2: * @param aGc Bitmapped graphics context to be used for drawing. williamr@2: * williamr@2: * @param aOuterRect Outer rectangle of the frame. Frame elements williamr@2: * will be drawn within this rectangle. williamr@2: * williamr@2: * @param aInnerRect Inner rectangle of the frame. Frame center williamr@2: * will be drawn within this rectangle. williamr@2: * williamr@2: * @param aFrameID Item ID of the entire frame. williamr@2: * williamr@2: * @param aCenterID Item ID of the center part of the frame. If williamr@2: * @c KAknsIIDNone, no center will be drawn. If @c KAknsIIDDefault, williamr@2: * the default value from the frame itself will be used. Other values, williamr@2: * the item to be used for the center part. If unsure, specifi williamr@2: * @c KAknsIIDDefault. If the frame is specified as 1 part williamr@2: * graphics in the skin instead of 9 part graphics, this williamr@2: * parameter has no effect. williamr@2: * williamr@2: * @return EFalse, if the frame was not drawn at all. ETrue, if the williamr@2: * frame was (at least partially) drawn. williamr@2: */ williamr@2: IMPORT_C static TBool DrawFrame( MAknsSkinInstance* aInstance, williamr@2: CFbsBitGc& aGc, const TRect& aOuterRect, const TRect& aInnerRect, williamr@2: const TAknsItemID& aFrameID, const TAknsItemID& aCenterID ); williamr@2: williamr@2: /** williamr@2: * Draws the specified part of the frame (with a cached image) to the williamr@2: * specified rectangle. williamr@2: * williamr@2: * @par Compatibility note: williamr@2: * Prior to Series 60 release 2.8, the entire outer rectangle could williamr@2: * be given as the rectangle of a corner part. Due to scalable UI williamr@2: * compatibility, this is no longer supported in release 2.8, and thus williamr@2: * the exact corner rectangle is required. This funtion may not williamr@2: * function correctly if the skin specifies the frame as 1 part williamr@2: * graphics. williamr@2: * williamr@2: * @param aInstance Pointer to the skin instance. If @c NULL, the williamr@2: * method returns @c EFalse. williamr@2: * williamr@2: * @param aGc Graphics context to be used for drawing. williamr@2: * williamr@2: * @param aRect Rectangle for drawing. This must be the rectangle williamr@2: * of the specific part of the drawn that will be drawn, e.g. williamr@2: * top-left corner rectangle if the top-left corner is being drawn. williamr@2: * williamr@2: * @param aFrameID Item ID of the entire frame. williamr@2: * williamr@2: * @param aFrameElement Element (index) of the frame element to williamr@2: * be drawn. williamr@2: * williamr@2: * @return ETrue, if the element was drawn. EFalse otherwise. williamr@2: */ williamr@2: IMPORT_C static TBool DrawFramePart( MAknsSkinInstance* aInstance, williamr@2: CWindowGc& aGc, const TRect& aRect, const TAknsItemID& aFrameID, williamr@2: const TAknsFrameElementIndex aFrameElement ); williamr@2: williamr@2: /** williamr@2: * Returns a boolean value indicating whether list separator lines williamr@2: * should be drawn. williamr@2: * williamr@2: * This method checks: williamr@2: * - The value of @c KAknsIIDPropertyListSeparatorLines property. williamr@2: * - The presence of (non-scalable) column bitmaps. williamr@2: * If found, @c EFalse is returned. williamr@2: * - The presence of generic list background (non-scalable). williamr@2: * If found, @c EFalse is returned. williamr@2: * williamr@2: * Note that the exact internal implementation of the checks is williamr@2: * subject to change. williamr@2: * williamr@2: * @since 2.8 williamr@2: * williamr@2: * @param aInstance Pointer to the skin instance. If @c NULL, williamr@2: * the method returns @c ETrue. williamr@2: * williamr@2: * @return @c ETrue, if list separator lines should drawn. williamr@2: * @c EFalse, if list separator lines should not be drawn williamr@2: * and, consequently, list column and slice bitmaps (if any) from the williamr@2: * skin content should be drawn. williamr@2: */ williamr@2: IMPORT_C static TBool IsListSeperatorLines( williamr@2: MAknsSkinInstance* aInstance ); williamr@2: williamr@2: /** williamr@2: * Returns an enum value indicating the way notes and queries appear williamr@2: * to the screen (sliding animation) williamr@2: * williamr@2: * @since 3.1 williamr@2: * williamr@2: * @param aInstance Pointer to the skin instance. If @c NULL, williamr@2: * the method returns @c ESlidingDisabled. williamr@2: * williamr@2: * @return @c Sliding mode from enumeration TSlidingMode williamr@2: */ williamr@2: IMPORT_C static TSlidingMode SlidingMode( williamr@2: MAknsSkinInstance* aInstance ); williamr@2: williamr@2: private: // Prohibited constructors and destructor williamr@2: williamr@2: // Construction prohibited (static class) williamr@2: AknsDrawUtils(); williamr@2: // Destruction prohibited (static class) williamr@2: ~AknsDrawUtils(); williamr@2: }; williamr@2: williamr@2: #endif // AKNSDRAWUTILS_H williamr@2: williamr@2: // End of File