# HG changeset patch # User MattD # Date 1270120720 -3600 # Node ID fd868a9289925b120eb3b2c9ff6f0bbde6242047 # Parent 690b4f151c127652466f9569f483a12dbfccffee# Parent 4e8bbb15b77a08278fe38e092649276f4385a688 Merging in kashif's additional head into fdim's diff -r 690b4f151c12 -r fd868a928992 .cproject --- a/.cproject Wed Mar 31 12:29:10 2010 +0300 +++ b/.cproject Thu Apr 01 12:18:40 2010 +0100 @@ -26,7 +26,7 @@ - + diff -r 690b4f151c12 -r fd868a928992 dependencies/ABLD.BAT --- a/dependencies/ABLD.BAT Wed Mar 31 12:29:10 2010 +0300 +++ b/dependencies/ABLD.BAT Thu Apr 01 12:18:40 2010 +0100 @@ -3,7 +3,7 @@ REM Bldmake-generated batch file - ABLD.BAT REM ** DO NOT EDIT ** -perl -S ABLD.PL "\homescreensrv\dependencies\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +perl -S ABLD.PL "\S60\devices\S60_5th_Edition_SDK_v1.0\homescreensrv\dependencies\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 if errorlevel==1 goto CheckPerl goto End diff -r 690b4f151c12 -r fd868a928992 dependencies/AknsEffectAnim.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/AknsEffectAnim.h Thu Apr 01 12:18:40 2010 +0100 @@ -0,0 +1,274 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + +#ifndef AKNSEFFECTANIM_H +#define AKNSEFFECTANIM_H + +// INCLUDE FILES +#include // For TDisplayMode + +// CONSTANTS +enum TAknsAnimState + { + EAknsAnimStateStopped = 0, + EAknsAnimStateRunning = 1, + EAknsAnimStatePaused = 2, + EAknsAnimStateFinished = 3 + }; + +// In milliseconds +const TInt KAknsEffectAnimDefaultIdleInterval = 333; + +// FORWARD DECLARATIONS +class CFbsBitGc; +class CWindowGc; +class CBitmapContext; +class CFbsBitmap; +class TAknsItemID; + +class CAknsAlAnimatorBmp; + +// CLASS DECLARATION +/** +* Animation user must implement this interface to receive notification when a +* new animation frame is ready to be drawn. +* +* @since 3.0 +*/ +class MAknsEffectAnimObserver + { + public: + /** + * Animation frame is ready to be drawn. + * + * @param aError KErrNone if frame has been succesfully created and is + * available for drawing. If !KErrNone the animation has internally + * failed. + * @param aAnimId Reserved for future use + */ + virtual void AnimFrameReady( TInt aError, TInt aAnimId ) = 0; + }; + +// CLASS DECLARATION +/** +* Animation controller for using effect animations. +* +* @since 3.0 +*/ +class CAknsEffectAnim: public CBase + { +public: // Constructors + /** + * Creates a new animation controller. Full construction requires a call to + * ConstructFromSkinL. Leaves with KErrNotSupported if highlight animations + * have been disabled, see AknsUtils::SetAvkonHighlightAnimationEnabledL. + * + * @param aObserver Must be non-NULL + */ + IMPORT_C static CAknsEffectAnim* NewL( MAknsEffectAnimObserver* aObserver ); + IMPORT_C virtual ~CAknsEffectAnim(); + + /** + * Constructs animation from skin item. Leaves if animation construction + * fails. + * @param aItemID Animation skin item ID + * @return ETrue if the animation was found from the skin, EFalse if it was + * not found. + */ + IMPORT_C TBool ConstructFromSkinL( const TAknsItemID& aItemID ); + +private: + CAknsEffectAnim(); + void ConstructL( MAknsEffectAnimObserver* aObserver ); + +public: // Interface for using the animation + /** + * Starts the animation from the very beginning. + * + * @return Error code, KErrNone if operation was succesfull. If returned + * error code != KErrNone the operation has failed (OOM, internal + * misconfiguration etc). Recommended action is to delete the animation + * and fall back to normal rendering. Returns KErrNotReady if input layers + * have not been configured. + */ + IMPORT_C TInt Start(); + + /** + * Stops the animation. Input layers are released, output layer is kept. + * + * @return Error code, KErrNone if operation was succesfull. If returned + * error code != KErrNone the operation has failed (OOM, internal + * misconfiguration etc). Recommended action is to delete the animation + * and fall back to normal rendering. + */ + IMPORT_C TInt Stop(); + + /** + * Pauses the animation. Input layers are not released. + * + * @return Error code, KErrNone if operation was succesfull. If returned + * error code != KErrNone the operation has failed (OOM, internal + * misconfiguration etc). Recommended action is to delete the animation + * and fall back to normal rendering. + */ + IMPORT_C TInt Pause(); + + /** + * Continues the animation from the state where it was paused. + * + * @return Error code, KErrNone if operation was succesfull. If returned + * error code != KErrNone the operation has failed (OOM, internal + * misconfiguration etc). Recommended action is to delete the animation + * and fall back to normal rendering. + */ + IMPORT_C TInt Continue(); + + /** + * @return The current state of animation. Possible state values are + * described in TAknsAnimState. + */ + IMPORT_C TInt State(); + + /** + * Renders the current animation frame with the provided graphics context. + * The animation may have an output mask. The output mask will be used in + * the rendering if it exists. Otherwise nonmasked renderig will be used. + * Rendering will use BitBlt. For more specialized rendering use the exposed + * output bitmaps. + * + * @param aGc The graphics context used for rendering. + * @param aGcRect The frame is blit to this rectangle on the graphics + * context target. + * @return ETrue if rendering was successfull, EFalse otherwise. + */ + IMPORT_C TBool Render( CFbsBitGc& aGc, const TRect& aGcRect ) const; + + /** + * Similar to the other Render, this version is just for the window graphics + * context. + */ + IMPORT_C TBool Render( CWindowGc& aGc, const TRect& aGcRect ) const; + + /** + * Similar to the other renders, this version is just for the bitmap + * graphics context. + * + * @since 3.1 + */ + IMPORT_C TBool Render( CBitmapContext& aGc, const TRect& aGcRect ) const; + + /** + * @return The current animation output frame. Can be NULL if e.g. called + * before configuring animation layers. + */ + IMPORT_C const CFbsBitmap* OutputRgb() const; + + /** + * @return The current animation output frame mask. Output mask is optional + * --> can be NULL at any given time. + */ + IMPORT_C const CFbsBitmap* OutputAlpha() const; + + /** + * @return The minimum allowed size of animation. + */ + IMPORT_C TSize MinimumSize() const; + + /** + * @return The current size of animation. + */ + IMPORT_C TSize Size() const; + + /** + * @return ETrue if input layer is required for correct rendering but it is + * not currently present. + */ + IMPORT_C TBool NeedsInputLayer() const; + + /** + * Starts configuring input layers, should be called prior to Begin() and + * Continue() to restore input layers to animation. Configure sequence is as + * follows: + * 1. Call BeginConfigLayers to start configuration + * 2. Use InputRgbGc and InputAlphaGc to prepare input layers + * 3. Call EndConfigLayers to end configuration + * + * @param aNewSize The layer size, must be larger than or equal to minimum + * size. Providing size smaller than minimum size will lead to leave with + * KErrArgument. + * @param aAboutToStart If animation is about to be started or continued + * after layer configuration this should be set to ETrue (to keep input + * layers). Otherwise EFalse should be used. + */ + IMPORT_C void BeginConfigInputLayersL( const TSize& aNewSize, + TBool aAboutToStart ); + + /** + * Graphics context for drawing the input layer RGB. Can be NULL, in this + * case animation is not expecting input layer. + */ + IMPORT_C CFbsBitGc* InputRgbGc() const; + + /** + * Graphics context for drawing the input layer alpha. Can be NULL, in this + * case animation is not expecting input layer alpha. + */ + IMPORT_C CFbsBitGc* InputAlphaGc() const; + + /** + * Ends layer configuration. + */ + IMPORT_C void EndConfigInputLayersL(); + + /** + * Renders the output layer once without notifying the animation observer. + * Doesn't set animator error state if fails. + * @return The status of rendering, if KErrNone rendering was ok, if + * !KErrNone either rendering failed or animator is already in + * error state. + */ + IMPORT_C TInt UpdateOutput(); + + /** + * When animation is idling it won't update the actual animation. Observer + * AnimFrameReady will be called when idle timer timeouts. Animation + * observer should check there whether or not animation is idling and ignore + * redraw calls caused by idling. + * + * Only animations in state EAknsAnimStateRunning can be set idling. Setting + * idling causes the animation to go in paused state. Trying to idle + * animation in any other state will be silently ignored. Also, idling is + * interrupted when animation is started, stoppped, paused or continued. + * Idling is not interrupted if the animation is resized when being idled. + * Idling can be reset, e.g. calling SetIdling multiple times is ok. + * + * @param aInterval Idling interval in milliseconds. Using the default value + * KAknsEffectAnimDefaultIdleInterval is recommended. + */ + IMPORT_C void SetIdling( TInt aIntervalMs ); + + /** + * @return ETrue if animation is idling, EFalse otherwise. + */ + IMPORT_C TBool IsIdling() const; + +private: + CAknsAlAnimatorBmp* iAnim; + TInt iAboutToStart; + }; + +#endif // AKNSEFFECTANIM_H diff -r 690b4f151c12 -r fd868a928992 dependencies/AknsItemDef.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/AknsItemDef.h Thu Apr 01 12:18:40 2010 +0100 @@ -0,0 +1,1452 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +#ifndef AKNSITEMDEF_H +#define AKNSITEMDEF_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +struct TAknsImageAttributeData; + +// CLASS DECLARATIONS + +/** +* Base class for item definitions. +* Item definition maps item ID specified as TAknsItemID to a specific resource +* (such as bitmap filename and index). Content of the definition varies +* depending of the type of the resource. +* +* CAknsItemDef does not itself have any dynamically allocated members. +* Therefore the members of its friend classes can instantiate CAknsItemDef +* into stack (e.g. to perform binary search with LineraOrder without heap +* allocation) using CAknsItemDef::CAknsItemDef(const TAknsItemID aID) +* constructor. Derived classes, however, require two-phased construction and +* proper destruction. +* +* This is a public class with exported functions. +* The class is not intended for derivation outside the library. +* +* @lib AknSkinSrv.lib +* +* @since 2.0 +*/ +class CAknsItemDef : public CBase + { + + public: // Constructors and destructors + + /** + * Two-phased constructor. + * Constructs item definition object with specified ID, item type + * ::EAknsITUnknown and localization type ::EAknsIDLTDefault. + * + * @param aID Item ID of the newly created item definition. + * + * @return Newly constructed CAknsItemDef object. + * + * @par Exceptions: + * If allocation fails, function leaves with a system-wide error code. + */ + IMPORT_C static CAknsItemDef* NewL( const TAknsItemID& aID ); + + /** + * Destructor. + * Base-class destructor does nothing. It exists only to enable + * destruction of derived objects using pointer to base class object. + */ + IMPORT_C virtual ~CAknsItemDef(); + + public: // New functions + + /** + * Returns the item type of this item definition. + * This method can be used to provide run-time type information. + * Corresponding classes are listed in definition of ::TAknsItemType. + * + * @since 2.0 + * + * @return Type of the item definition as TAknsItemType. + */ + IMPORT_C TAknsItemType Type() const; + + /** + * Returns the item ID of this item definition. + * + * @since 2.0 + * + * @return Item ID of the item definition as TAknsItemID. + */ + IMPORT_C TAknsItemID ID() const; + + /** + * Determines the order of two CAknsItemDef objects. + * Order is determined based on the item ID of the object, as described + * in TAknsItemID::LinearOrder(). + * + * @since 2.0 + * + * @param aFirst First object to be compared. + * + * @param aSecond Second object to be compared. + * + * @return 0 if the two objects are equal, negative value if the first + * object is less than the second and positive value if the first + * object is greater than the second. + */ + IMPORT_C static TInt LinearOrder( const CAknsItemDef& aFirst, + const CAknsItemDef& aSecond ); + + private: // Reserved exports + + /** + * Reserved for future use. + * + * @since 2.0 + */ + IMPORT_C void Reserved1(); + + /** + * Reserved for future use. + * + * @since 2.0 + */ + IMPORT_C void Reserved2(); + + protected: // C++ protected constructor for derived classes + + /** + * C++ constructor for derived classes. + * Constructs item definition object with given item type and ID, + * and localization type ::EAknsIDLTDefault. + * + * @param aType Item type of the new object. + * + * @param aID Item ID of the new object. + * + * @internal + */ + CAknsItemDef( const TAknsItemType aType, const TAknsItemID& aID ); + + private: // C++ private constructor for friend classes + + /** + * C++ constructor for internal use. + * Constructs item definition object with specified ID and item type + * ::EAknsITUnknown, and localization type ::EAknsIDLTDefault. + * + * @param aID Item ID of the new item definition. + * + * @internal + */ + IMPORT_C CAknsItemDef( const TAknsItemID& aID ); + + protected: // Data + + TAknsItemType iType; //!< Item type. + TAknsItemID iID; //!< Item ID. + TInt iSpare1; //!< Reserved for future use. + TInt iSpare2; //!< Reserved for future use. + + private: // Friend classes + friend class CAknsAppSkinInstance; + + }; + +/** +* Image item definition. +* Image item definition consists of (in addition to base class data) +* image attributes and their values. Item type for image item definitions +* is ::EAknsITImage +* +* This is a public class with exported functions. +* The class is not intended for derivation outside the library. +* +* @lib AknSkinSrv.lib +* +* @since 2.0 +*/ +NONSHARABLE_CLASS(CAknsImageItemDef) : public CAknsItemDef + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * Constructs a new image item definition object. + * + * @param aID Item ID of the new object. + * + * @return Newly constructed CAknsImageItemDef object. + * + * @par Exceptions: + * If allocation fails, function leaves with a system-wide error + * code. + */ + IMPORT_C static CAknsImageItemDef* NewL( const TAknsItemID& aID ); + + /** + * Destructor. + */ + virtual ~CAknsImageItemDef(); + + public: // New functions + + /** + * Sets the image attributes for this image definition. + * + * @since 2.0 + */ + IMPORT_C void SetAttributesL( const TAknsImageAttributeData& aAttributes ); + + /** + * Returns the image attributes for this image definition. + * + * @since 2.0 + */ + IMPORT_C const TAknsImageAttributeData* Attributes() const; + + protected: // C++ protected constructor + + /** + * C++ constructor for internal use. + * Constructs an image item definition object with given ID. + * + * @since 2.0 + * + * @param aType Type of the definition object. While this is always + * ::EAknsITImage for CAknsImageItemDef objects, derived classes + * may specify other values. + * + * @param aID Item ID of the new item definition. + * + * @internal + */ + CAknsImageItemDef( const TAknsItemType aType, const TAknsItemID& aID ); + + protected: // Data + + // Image attributes + TAknsImageAttributeData* iAttributeData; + + }; + +/** +* Bitmap item definition. +* Bitmap item definition consists of (in addition to base class data) bitmap +* filename and index in bitmap file. Item type for bitmap item definitions +* is always ::EAknsITBitmap. +* +* This is a public class with exported functions. +* The class is not intended for derivation outside the library. +* +* @lib AknSkinSrv.lib +* +* @since 2.0 +*/ +NONSHARABLE_CLASS(CAknsBitmapItemDef) : public CAknsImageItemDef + { + public: // Constructors and destructor + + /** + * Two-phased constructor, complete initialization. + * Constructs a new bitmap item definition object. + * + * @param aID Item ID of the new object. + * + * @param aFilename Filename of the bitmap. Internal descriptor is + * constructed to point to the same data as the given one. + * Ownership of the original descriptor stays with the caller and + * it must ensure that the lifetime of the descriptor is appropriate. + * + * @param aIndex Index of the bitmap in the bitmap file. + * + * @return Newly constructed CAknsBitmapItemDef object. + * + * @par Exceptions: + * If allocation fails, function leaves with a system-wide error + * code. + */ + IMPORT_C static CAknsBitmapItemDef* NewL( const TAknsItemID& aID, + const TDesC& aFilename, const TInt aIndex ); + + /** + * Two-phased constructor, partial initialization. + * Constructs a new bitmap item definition object. Bitmap filename + * and index must be set by SetFilename or SetFilenameL and SetIndex. + * + * @param aID Item ID of the new object. + * + * @return Newly constructed CAknsBitmapItemDef object. + * + * @par Exceptions: + * If allocation fails, function leaves with a system-wide error + * code. + */ + IMPORT_C static CAknsBitmapItemDef* NewL( const TAknsItemID& aID ); + + /** + * Destructor. + * Deletes the internal buffer reserved for bitmap filename. + */ + virtual ~CAknsBitmapItemDef(); + + public: // New functions + + /** + * Sets the filename, ownership of the descriptor stays with the caller. + * If CAknsBitmapItemDef object already owns a filename descriptor, it + * is deleted. + * + * @since 2.0 + * + * @param aFilename Reference to the descriptor containing new filename. + * Caller still owns the descriptor and must ensure that its lifetime + * is appropriate. + */ + IMPORT_C void SetFilename( const TDesC& aFilename ); + + /** + * Sets the filename, content of the descriptor is copied into an + * internal buffer. If CAknsBitmapItemDef object already owns a filename + * descriptor, it is deleted. + * + * @since 2.0 + * + * @param aFilename Reference to the descriptor containing new filename. + * Content of the descriptor is copied into an internal buffer owned + * by CAknsBitmapItemDef. + * + * @par Exceptions: + * If allocation fails, function leaves with a system-wide error code. + */ + IMPORT_C void SetFilenameL( const TDesC& aFilename ); + + /** + * Returns a reference to filename of this item definition. + * + * @since 2.0 + * + * @return Reference to descriptor containing the filename. Lifetime of + * the descriptor may end when SetFilename or SetFilenameL is called + * or CAknsBitmapItemDef object is deleted. + */ + IMPORT_C const TDesC& Filename() const; + + /** + * Sets bitmap file index of this item definition. + * + * @since 2.0 + * + * @param aIndex New index. + */ + IMPORT_C void SetIndex( const TInt aIndex ); + + /** + * Returns bitmap file index of this item definition. + * + * @since 2.0 + * + * @return Index of the bitmap (in the bitmap file) as integer value. + */ + IMPORT_C TInt Index() const; + + protected: // C++ protected constructor + + /** + * C++ constructor for internal use. + * Constructs bitmap item definition object with given ID and bitmap + * index. Filename needs to be set separately. + * + * @since 2.0 + * + * @param aType Type of the definition object. While this is always + * ::EAknsITBitmap for CAknsBitmapItemDef objects, derived classes + * may specify other values. + * + * @param aID Item ID of the new item definition. + * + * @param aIndex Index of the bitmap of the new item definition. + * + * @internal + */ + CAknsBitmapItemDef( const TAknsItemType aType, const TAknsItemID& aID, + const TInt aIndex ); + + protected: // Data + + TPtrC iFilename; //!< Bitmap filename. + HBufC* iFilenameBuf; //!< Internal filename buffer. + TInt iIndex; //!< Index of bitmap in bitmap file. + + }; + +/** +* Masked bitmap item definition. +* Masked bitmap item definition is derived from CAknsBitmapItemDef +* but additionally contains a second index specifying the mask. +* Item type for masked bitmap item definitions is always ::EAknsITMaskedBitmap. +* +* This is a public class with exported functions. +* The class is not intended for derivation outside the library. +* +* @lib AknSkinSrv.lib +* +* @since 2.0 +*/ +NONSHARABLE_CLASS(CAknsMaskedBitmapItemDef) :public CAknsBitmapItemDef + { + public: // Constructors and destructor + + /** + * Two-phased constructor, complete initialization. + * Constructs a new masked bitmap item definition object. + * + * @param aID Item ID of the new object. + * + * @param aFilename Filename of the bitmap. Internal descriptor is + * constructed to point to the same data as the given one. + * Ownership of the original descriptor stays with the caller and + * it must ensure that the lifetime of the descriptor is appropriate. + * + * @param aIndex Index of the bitmap in the bitmap file. + * + * @param aMaskIndex Index of the mask in the same bitmap file. + * + * @return Newly constructed CAknsMaskedBitmapItemDef object. + * + * @par Exceptions: + * If allocation fails, function leaves with a system-wide error + * code. + */ + IMPORT_C static CAknsMaskedBitmapItemDef* NewL( const TAknsItemID& aID, + const TDesC& aFilename, const TInt aIndex, const TInt aMaskIndex ); + + /** + * Two-phased constructor, partial initialization. + * Constructs a new masked bitmap item definition object. Bitmap + * filename and indices must be set by SetFilename or SetFilenameL, + * SetIndex and SetMaskIndex. + * + * @param aID Item ID of the new object. + * + * @return Newly constructed CAknsMaskedBitmapItemDef object. + * + * @par Exceptions: + * If allocation fails, function leaves with a system-wide error + * code. + */ + IMPORT_C static CAknsMaskedBitmapItemDef* NewL( const TAknsItemID& aID ); + + /** + * Destructor. + * Provided for completeness, does not actually do anything. + */ + virtual ~CAknsMaskedBitmapItemDef(); + + public: // New functions + + /** + * Sets index of mask in the bitmap file for this item definition. + * + * @since 2.0 + * + * @param aMaskIndex New index. + */ + IMPORT_C void SetMaskIndex( const TInt aMaskIndex ); + + /** + * Returns bitmap file index for bitmap mask. + * + * @since 2.0 + * + * @return Index of the mask (in the bitmap file) as integer value. + */ + IMPORT_C TInt MaskIndex() const; + + protected: // C++ protected constructor + + /** + * C++ constructor for internal use. + * Constructs masked bitmap item definition object with given ID and + * bitmap indices. Filename needs to be set separately. + * + * @param aType Type of the definition object. While this is always + * ::EAknsITMaskedBitmap for CAknsMaskedBitmapItemDef objects, + * derived classes may specify other values. + * + * @param aID Item ID of the new item definition. + * + * @param aIndex Index of the bitmap of the new item definition. + * + * @param aMaskIndex Index of the bitmap mask of the new definition. + * + * @internal + */ + CAknsMaskedBitmapItemDef( const TAknsItemType aType, + const TAknsItemID& aID, const TInt aIndex, const TInt aMaskIndex ); + + protected: // Data + + TInt iMaskIndex; //!< Index of mask in bitmap file. + + }; + +/** +* Data structure for color values. +* +* @since 2.0 +* +* @internal +*/ +struct TAknsColorTableEntry + { + /** + * Indexed color value, or -1 if RGB value is used instead. + */ + TInt iIndex; + + /** + * RGB-value, used only if iIndex is -1. + */ + TUint32 iRgb; + }; + +/** +* Color table item definition. +* Color table item definition contains (in addition to base class data) an +* array of color values. Item type for color table item definitions is always +* ::EAknsITColorTable. +* +* This is a public class with exported functions. +* The class is not intended for derivation outside the library. +* +* @lib AknSkinSrv.lib +* +* @since 2.0 +*/ +NONSHARABLE_CLASS(CAknsColorTableItemDef) :public CAknsImageItemDef + { + public: // Constructors and destructor + + /** + * Two-phased constructor, complete initialization. + * Constructs a new color table item definition object. + * + * @param aID Item ID of the new object. + * + * @param aNumberOfColors Number of colors available in aColors. + * + * @param aColors Pointer to the first color. Internal pointer is set + * to point to the same place as the given one. Ownership of the + * color array stays with the caller and it must ensure that its + * lifetime is appropriate. + * + * @return Newly constructed CAknsColorTableItemDef object. + * + * @par Exceptions: + * If allocation fails, function leaves with a system-wide error + * code. + */ + IMPORT_C static CAknsColorTableItemDef* NewL( const TAknsItemID& aID, + const TInt aNumberOfColors, + const TAknsColorTableEntry *const aColors ); + + /** + * Two-phased constructor, partial initialization. + * Constructs a new color table item definition object. Colors must + * be set separately by using SetColorsL or SetColors. + * + * @param aID Item ID of the new object. + * + * @return Newly constructed CAknsColorTableItemDef object. + * + * @par Exceptions: + * If allocation fails, function leaves with a system-wide error + * code. + */ + IMPORT_C static CAknsColorTableItemDef* NewL( const TAknsItemID& aID ); + + /** + * Destructor. + * If the object owns a color array, it is destroyed. + */ + virtual ~CAknsColorTableItemDef(); + + public: // New functions + + /** + * Sets the colors, ownership of the color array stays with the caller. + * If this object already owns a color array, it is destroyed. + * + * @since 2.0 + * + * @param aNumberOfColors Number of colors in aColors. + * + * @param aColors Pointer to the first color. The caller still owns + * the color array and must ensure that its lifetime is appropriate. + */ + IMPORT_C void SetColors( const TInt aNumberOfColors, + const TAknsColorTableEntry *const aColors ); + + /** + * Sets the colors, content of the array is copied to an internal + * array. If this object already owns a color array, it is destroyed. + * + * @since 2.0 + * + * @param aNumberOfColors Number of colors in aColors. + * + * @param aColors Pointer to the first color. + * + * @par Exceptions: + * If allocation fails, returns with an error code. + */ + IMPORT_C void SetColorsL( const TInt aNumberOfColors, + const TAknsColorTableEntry *const aColors ); + + /** + * Returns pointer to color values. + * + * @since 2.0 + * + * @return Pointer to color values. The array is still owned by this + * object. + */ + IMPORT_C const TAknsColorTableEntry* Colors() const; + + /** + * Returns the number of colors. + * + * @since 2.0 + * + * @return Number of colors. + */ + IMPORT_C TInt NumberOfColors() const; + + protected: // C++ protected constructor + + /** + * C++ constructor for internal use. + * Constructs color item definition object with given ID. Color + * array must be set separately. + * + * @param aType Type of the definition object. While this is always + * ::EAknsITColorTable for CAknsColorTableItemDef objects, derived + * classes may specify other values. + * + * @param aID Item ID of the new item definition. + * + * @internal + */ + CAknsColorTableItemDef( const TAknsItemType aType, + const TAknsItemID& aID ); + + protected: // Data + + // Color array + const TAknsColorTableEntry* iColorArray; + // Internal (owned) color array + TAknsColorTableEntry* iInternalColorArray; + // Number of colors + TInt iNumberOfColors; + }; + +/** +* Image table item definition. +* Image table item definition contains (in addition to base class data) +* an array containing image IDs. Item type for image table item definitions is +* always ::EAknsITImageTable. +* +* This is a public class with exported functions. +* The class is not intended for derivation outside the library. +* +* @lib AknSkinSrv.lib +* +* @since 2.0 +*/ +NONSHARABLE_CLASS(CAknsImageTableItemDef) : public CAknsImageItemDef + { + public: // Constructors and destructor + + /** + * Two-phased constructor, complete initialization. + * Constructs an image table item definition object. + * + * @param aID Item ID of the new object. + * + * @param aNumberOfImages Number of entries in aImages. + * + * @param aImages Pointer to the first item ID. + * An internal pointer is set to point to the same place as the + * given one. Ownership of the array stays with the caller and it + * must ensure that its lifetime is appropriate. + * + * @return Newly constructed CAknsImageTableItemDef object. + * + * @par Exceptions: + * If allocation fails, function leaves with a system-wide error + * code. + */ + IMPORT_C static CAknsImageTableItemDef* NewL( const TAknsItemID& aID, + const TInt aNumberOfImages, const TAknsItemID *const aImages ); + + /** + * Two-phased constructor, partial initialization. + * Constructs a new image table item definition object. Images must + * be set separately by using SetImagesL or SetImages. + * + * @param aID Item ID of the new object. + * + * @return Newly constructed CAknsImageTableItemDef object. + * + * @par Exceptions: + * If allocation fails, function leaves with a system-wide error + * code. + */ + IMPORT_C static CAknsImageTableItemDef* NewL( const TAknsItemID& aID ); + + /** + * Destructor. + * If the object owns an array, it is destroyed. + */ + virtual ~CAknsImageTableItemDef(); + + public: // New functions + + /** + * Sets the images, ownership of the image item ID array stays with + * the caller. If this object already owns an array, it is destroyed. + * + * @since 2.0 + * + * @param aNumberOfImages Number of images in aImages. + * + * @param aImages Pointer to the first TAknsItemID. The caller + * still owns the array and must ensure that its lifetime is + * appropriate. + */ + IMPORT_C void SetImages( const TInt aNumberOfImages, + const TAknsItemID *const aImages ); + + /** + * Sets the images, content of the array is copied to an internal + * array. If this object already owns an array, it is destroyed. + * + * @since 2.0 + * + * @param aNumberOfImages Number of images in aImages. + * + * @param aImages Pointer to the first image item ID. + * + * @par Exceptions: + * If allocation fails, returns with an error code. + */ + IMPORT_C void SetImagesL( const TInt aNumberOfImages, + const TAknsItemID *const aImages ); + + /** + * Returns pointer to the first element of the image array. + * + * @since 2.0 + * + * @return Pointer to the first entry. The array is still owned + * by this object. + */ + IMPORT_C const TAknsItemID* Images() const; + + /** + * Returns the number of images. + * + * @since 2.0 + * + * @return Number of images. + */ + IMPORT_C TInt NumberOfImages() const; + + protected: // C++ protected constructor + + /** + * C++ constructor for internal use. + * Constructs image table item definition object with given ID. + * The image array must be set separately. + * + * @param aType Type of the definition object. While this is always + * ::EAknsITImageTable for CAknsImageTableItemDef objects, derived + * classes may specify other values. + * + * @param aID Item ID of the new item definition. + * + * @internal + */ + CAknsImageTableItemDef( const TAknsItemType aType, + const TAknsItemID& aID ); + + protected: // Data + + const TAknsItemID* iImageArray; //!< Image ID array. + TAknsItemID* iInternalImageArray; //!< Internal (owned) image ID array. + TInt iNumberOfImages; //!< Number of images in the array. + }; + +/** +* Data structure for animation frame properties. +* +* @since 2.0 +* +* @internal +*/ +struct TAknsBmpAnimFrameInfo + { + /** + * Frame time in milliseconds or -1 if not defined. + */ + TInt16 iTime; + + /** + * Frame position X-coordinate. + */ + TInt16 iPosX; + + /** + * Frame position Y-coordinate. + */ + TInt16 iPosY; + }; + +/** +* Bitmap animation item definition. +* Bitmap animationitem definition contains (in addition to base class data) +* animation properties and an array containing frame properties. +* Item type for image table item definitions is +* always ::EAknsITBmpAnim. +* +* This is a public class with exported functions. +* The class is not intended for derivation outside the library. +* +* @lib AknSkinSrv.lib +* +* @since 2.0 +*/ +NONSHARABLE_CLASS(CAknsBmpAnimItemDef) : public CAknsImageTableItemDef + { + public: // Constructors and destructor + + /** + * Two-phased constructor, complete initialization. + * Constructs a bitmap animation item definition object. + * + * @param aID Item ID of the new object. + * + * @param aNumberOfImages Number of entries in aImages. + * + * @param aImages Pointer to the first item ID. + * An internal pointer is set to point to the same place as the + * given one. Ownership of the array stays with the caller and it + * must ensure that its lifetime is appropriate. + * + * @param aFrameInfos Pointer to the first frame info. + * Ownership is handled as with aImages. + * + * @return Newly constructed CAknsBmpAnimItemDef object. + * + * @par Exceptions: + * If allocation fails, function leaves with a system-wide error + * code. + */ + IMPORT_C static CAknsBmpAnimItemDef* NewL( const TAknsItemID& aID, + const TInt aNumberOfImages, const TAknsItemID *const aImages, + const TAknsBmpAnimFrameInfo *const aFrameInfos ); + + /** + * Two-phased constructor, partial initialization. + * Constructs a new bitmap animation item definition object. Images must + * be set separately by using SetImagesL and SetFrameInfosL or SetImages + * and SetFrameInfos. + * + * @param aID Item ID of the new object. + * + * @return Newly constructed CAknsBmpAnimItemDef object. + * + * @par Exceptions: + * If allocation fails, function leaves with a system-wide error + * code. + */ + IMPORT_C static CAknsBmpAnimItemDef* NewL( const TAknsItemID& aID ); + + /** + * Destructor. + * If the object owns an array, it is destroyed. + */ + virtual ~CAknsBmpAnimItemDef(); + + public: // New functions + + /** + * Sets frame properties, ownership of the frame info array stays with + * the caller. If this object already owns an array, it is destroyed. + * + * The number of frame info objects in the array must match the number + * of images. This implies that SetFrameInfos can not be called before + * images have been set. + * + * @since 2.0 + * + * @param aFrameInfos Pointer to the first TAknsBmpAnimFrameInfo. The + * caller still owns the array and must ensure that its lifetime is + * appropriate. + */ + IMPORT_C void SetFrameInfos( + const TAknsBmpAnimFrameInfo *const aFrameInfos ); + + /** + * Sets frame propertis, content of the array is copied to an internal + * array. If this object already owns an array, it is destroyed. + * + * The number of frame info objects in the array must match the number + * of images. This implies that SetFrameInfosL can not be called before + * images have been set. + * + * @since 2.0 + * + * @param aFrameInfos Pointer to the first TAknsBmpAnimFrameInfo. + * + * @par Exceptions: + * If allocation fails, returns with an error code. + */ + IMPORT_C void SetFrameInfosL( + const TAknsBmpAnimFrameInfo *const aFrameInfos ); + + /** + * Returns pointer to the first element of the frame info array. + * + * @since 2.0 + * + * @return Pointer to the first entry. The array is still owned + * by this object. + */ + IMPORT_C const TAknsBmpAnimFrameInfo* FrameInfos() const; + + /** + * Sets the flag indicating whether the last frame should be + * interpreted as the background (i.e. excluded from the animation + * itself). + * + * @since 2.0 + * + * @param aLastFrameBg Boolean value. + */ + IMPORT_C void SetLastFrameBackground( TBool aLastFrameBg ); + + /** + * Retrieves the flag value indicating whether the last frame + * should be interpreted as the background. + * + * @since 2.0 + * + * @return Boolean value. + */ + IMPORT_C TBool LastFrameBackground() const; + + /** + * Sets the frame interval for the entire animation. + * + * @since 2.0 + * + * @param aFrameInterval Frame interval in milliseconds or -1. + */ + IMPORT_C void SetFrameInterval( const TInt16 aFrameInterval ); + + /** + * Retrieves the frame interval. + * + * @since 2.0 + * + * @return Frame interval in milliseconds or -1. + */ + IMPORT_C TInt16 FrameInterval() const; + + /** + * Sets the play mode for the entire animation. + * + * @since 2.0 + * + * @param aPlayMode Play mode. + */ + IMPORT_C void SetPlayMode( const TInt16 aPlayMode ); + + /** + * Retrieves the play mode. + * + * @since 2.0 + * + * @return Play mode. + */ + IMPORT_C TInt16 PlayMode() const; + + /** + * Sets the flash property for the entire animation. + * + * @since 2.0 + * + * @param aFlash Flash flag value. + */ + IMPORT_C void SetFlash( const TBool aFlash ); + + /** + * Retrieves the flash property. + * + * @since 2.0 + * + * @return Flash flag value. + */ + IMPORT_C TBool Flash() const; + + protected: // C++ protected constructor + + /** + * C++ constructor for internal use. + * Constructs bitmap animation item definition object with given ID. + * The image array and frame properties must be set separately. + * + * @param aType Type of the definition object. While this is always + * ::EAknsITBmpAnim for CAknsBmpAnimItemDef objects, derived + * classes may specify other values. + * + * @param aID Item ID of the new item definition. + * + * @internal + */ + CAknsBmpAnimItemDef( const TAknsItemType aType, + const TAknsItemID& aID ); + + protected: // Data + + const TAknsBmpAnimFrameInfo* iFrameArray; //!< Frame array. + TAknsBmpAnimFrameInfo* iInternalFrameArray; //!< Internal (owned) image frame array. + + TBool iLastFrameBackground; //!< Last frame used as background flag. + TInt16 iFrameInterval; //!< Frame interval. + TInt16 iPlayMode; //!< Play mode. + TBool iFlash; //!< Flash flag. + }; + +/** +* String item definition. +* String item definition consists of (in addition to base class data) +* a single string value. Item type for string item definitions is +* ::EAknsITString +* +* This is a public class with exported functions. +* The class is not intended for derivation outside the library. +* +* @lib AknSkinSrv.lib +* +* @since 2.6 +*/ +NONSHARABLE_CLASS(CAknsStringItemDef) : public CAknsItemDef + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * Constructs a new string item definition object. + * + * @since 2.6 + * + * @param aID Item ID of the new object. + * + * @return Newly constructed CAknsStringItemDef object. + * + * @par Exceptions: + * If allocation fails, function leaves with a system-wide error + * code. + */ + IMPORT_C static CAknsStringItemDef* NewL( const TAknsItemID& aID ); + + /** + * Destructor. + */ + virtual ~CAknsStringItemDef(); + + public: // New functions + + /** + * Sets the string, content of the descriptor is copied into an + * internal buffer. If CAknsStringItemDef object already owns a filename + * descriptor, it is deleted. + * + * @since 2.6 + * + * @param aString Reference to the descriptor containing new value. + * Content of the descriptor is copied into an internal buffer owned + * by CAknsStringItemDef. + * + * @par Exceptions: + * If allocation fails, function leaves with a system-wide error code. + */ + IMPORT_C void SetStringL( const TDesC& aString ); + + /** + * Returns a reference to the string value of this item definition. + * + * @since 2.6 + * + * @return Reference to descriptor containing the value. Lifetime of + * the descriptor may end when SetStringL is called + * or CAknsStringItemDef object is deleted. + */ + IMPORT_C const TDesC& String() const; + + protected: // C++ protected constructor + + /** + * C++ constructor for internal use. + * Constructs an string item definition object with given ID. + * + * @since 2.6 + * + * @param aType Type of the definition object. While this is always + * ::EAknsITString for CAknsStringItemDef objects, derived classes + * may specify other values. + * + * @param aID Item ID of the new item definition. + * + * @internal + */ + CAknsStringItemDef( const TAknsItemType aType, const TAknsItemID& aID ); + + protected: // Data + + HBufC* iString; // String value, owned + + }; + +/** +* +* @since 2.8 +*/ +NONSHARABLE_CLASS(CAknsEffectParamDef) : public CBase + { + public: + IMPORT_C static CAknsEffectParamDef* NewL(); + virtual ~CAknsEffectParamDef(); + + public: + IMPORT_C void SetType(TUint32 aType); + IMPORT_C TUint32 GetType(); + + IMPORT_C void SetNameL(const TDesC& aName); + IMPORT_C const TDesC* GetName(); + + IMPORT_C void SetValue(TUint32 aParam); + IMPORT_C void SetValueL(const TDesC& aParam); + IMPORT_C void SetValueL(const TDesC& aFilename, + TUint32 aBitmapIndex, TUint32 aMaskIndex); + + IMPORT_C TUint32 GetNumber(); + IMPORT_C const TDesC* GetString(); + IMPORT_C const TDesC* GetFilename(); + IMPORT_C TUint32 GetBitmapIndex(); + IMPORT_C TUint32 GetMaskIndex(); + + protected: + CAknsEffectParamDef(); + + private: + TUint32 iParamType; + TUint32 iParam; + TUint32 iBitmapIndex; + TUint32 iMaskIndex; + HBufC* iParamName; + HBufC* iParamString; + HBufC* iFilename; + }; + +/** +* +* @since 2.8 +*/ +NONSHARABLE_CLASS(CAknsEffectItemDef) : public CBase + { + public: + IMPORT_C static CAknsEffectItemDef* NewL(); + virtual ~CAknsEffectItemDef(); + + public: // New functions + + IMPORT_C void SetEffectUid( const TUid aUid ); + IMPORT_C TUid EffectUid() const; + + IMPORT_C void AddParameterL(CAknsEffectParamDef* aParam); + IMPORT_C CAknsEffectParamDef* GetParameter(TInt32 aIndex) const ; + IMPORT_C TInt ParameterCount() const; + + IMPORT_C void SetLayerIndexesAndModes( + TUint32 aInputLayerAIndex, TUint32 aInputLayerAMode, + TUint32 aInputLayerBIndex, TUint32 aInputLayerBMode, + TUint32 aOutputLayerIndex, TUint32 aOutputLayerMode ); + + protected: + CAknsEffectItemDef(); + + public: + TUint32 iInputLayerAIndex; + TUint32 iInputLayerAMode; + TUint32 iInputLayerBIndex; + TUint32 iInputLayerBMode; + TUint32 iOutputLayerIndex; + TUint32 iOutputLayerMode; + + private: + TUid iUid; //!< Effect UID. + RPointerArray iParamArray; + }; + +/** +* +* @since 2.8 +*/ +NONSHARABLE_CLASS(CAknsEffectQueueItemDef) : public CAknsItemDef + { + public: // Constructors and destructor + IMPORT_C static CAknsEffectQueueItemDef* NewL(const TAknsItemID& aID); + virtual ~CAknsEffectQueueItemDef(); + + public: + IMPORT_C void AddEffectL(CAknsEffectItemDef* aItemDef); + IMPORT_C CAknsEffectItemDef* GetEffect( TInt32 aIndex ) const; + IMPORT_C TUint32 EffectCount() const; + + IMPORT_C void SetLayerIndexesAndModes( + TUint32 aInputLayerIndex, TUint32 aInputLayerMode, + TUint32 aOutputLayerIndex, TUint32 aOutputLayerMode ); + IMPORT_C void SetReference(const TAknsItemID& aID); + + protected: + CAknsEffectQueueItemDef( const TAknsItemType aType, + const TAknsItemID& aID); + + public: + TUint32 iInputLayerIndex; + TUint32 iInputLayerMode; + TUint32 iOutputLayerIndex; + TUint32 iOutputLayerMode; + TAknsItemID iReference; + + private: + RPointerArray iEffectArray; + }; + +// ============================================================================= +// Animation related definitions +// ============================================================================= + +/** +* @since 3.0 +*/ +class CAknsSizeBoundParamDef: public CBase + { + public: // Constructors and destructor + IMPORT_C static CAknsSizeBoundParamDef* NewL(); + virtual ~CAknsSizeBoundParamDef(); + + public: // New functions + IMPORT_C void SetDataL( const TDesC& aName, + TUint32 aAnimationValueId, + TUint32 aParamFlags ); + + IMPORT_C const TDesC* Name() const; + IMPORT_C TUint32 AnimationValueId() const; + IMPORT_C TUint32 ParamFlags() const; + + protected: + CAknsSizeBoundParamDef(); + + private: + TDesC* iName; + TUint32 iAnimationValueId; + TUint32 iParamFlags; + }; + +/** +* @since 3.0 +*/ +class CAknsNamedReferenceDef: public CBase + { + public: // Constructors and destructor + IMPORT_C static CAknsNamedReferenceDef* NewL(); + virtual ~CAknsNamedReferenceDef(); + + public: // New functions + IMPORT_C void SetDataL( const TDesC& aName, + TUint32 aAnimationValueId ); + + IMPORT_C const TDesC* Name() const; + IMPORT_C TUint32 AnimationValueId() const; + + protected: + CAknsNamedReferenceDef(); + + private: + TDesC* iName; + TUint32 iAnimationValueId; + }; + +/** +* @since 3.0 +*/ +class CAknsTimingModelDef: public CBase + { + public: // Constructors and destructor + IMPORT_C static CAknsTimingModelDef* NewL(); + virtual ~CAknsTimingModelDef(); + + public: // New functions + IMPORT_C void SetTimingModelUid( const TUid aUid ); + IMPORT_C TUid TimingModelUid() const; + + IMPORT_C void AddParameterL( CAknsEffectParamDef* aParam ); + IMPORT_C CAknsEffectParamDef* Parameter( TInt32 aIndex ) const; + IMPORT_C TInt ParameterCount() const; + + protected: + CAknsTimingModelDef(); + + private: + TUid iTimingModelUid; + RPointerArray iParamArray; + }; + +/** +* @since 3.0 +*/ +class CAknsAnimationValueDef: public CBase + { + public: // Constructors and destructor + IMPORT_C static CAknsAnimationValueDef* NewL(); + virtual ~CAknsAnimationValueDef(); + + public: // New functions + IMPORT_C void SetAnimationValueUid( const TUid aUid ); + IMPORT_C TUid AnimationValueUid() const; + + IMPORT_C void SetTimingModelId( TUint32 aId ); + IMPORT_C TUint32 TimingModelId() const; + + IMPORT_C void AddParameterL( CAknsEffectParamDef* aParam ); + IMPORT_C CAknsEffectParamDef* Parameter( TInt32 aIndex ) const; + IMPORT_C TInt ParameterCount() const; + + protected: + CAknsAnimationValueDef(); + + private: + TUid iAnimationValueUid; + TUint32 iTimingModelId; + RPointerArray iParamArray; + }; + +/** +* Note inheritance relationship with CAknsEffectItemDef. +* +* @since 3.0 +*/ +class CAknsAnimationCommandItemDef: public CAknsEffectItemDef + { + public: // Constructors and destructor + IMPORT_C static CAknsAnimationCommandItemDef* NewL(); + virtual ~CAknsAnimationCommandItemDef(); + + public: // New functions + IMPORT_C void AddNamedReferenceL( CAknsNamedReferenceDef* aRef ); + IMPORT_C CAknsNamedReferenceDef* NamedReference( TInt32 aIndex ) const; + IMPORT_C TInt NamedReferenceCount() const; + + protected: + CAknsAnimationCommandItemDef(); + + private: + RPointerArray iNamedReferenceArray; + }; + +/** +* @since 3.0 +*/ +class CAknsAnimationItemDef: public CAknsItemDef + { + public: // Constructors and destructor + IMPORT_C static CAknsAnimationItemDef* NewL( const TAknsItemID& aID ); + virtual ~CAknsAnimationItemDef(); + + public: // New functions + + IMPORT_C void SetLayerIndexesAndModes( + TUint32 aInputLayerIndex, TUint32 aInputLayerMode, + TUint32 aOutputLayerIndex, TUint32 aOutputLayerMode ); + + IMPORT_C void SetMinInterval( TUint32 aMinInterval ); + IMPORT_C TUint32 MinInterval() const; + + IMPORT_C void SetMorphing( TBool aMorphing ); + IMPORT_C TBool Morphing() const; + + IMPORT_C void AddPreprocessCommandL( CAknsEffectItemDef* aItemDef ); + IMPORT_C CAknsEffectItemDef* PreprocessCommand( TInt32 aIndex ) const; + IMPORT_C TInt PreprocessCommandCount() const; + + IMPORT_C void AddAnimationCommandItemL( CAknsAnimationCommandItemDef* aCommand ); + IMPORT_C CAknsAnimationCommandItemDef* AnimationCommandItem( TInt32 aIndex ) const; + IMPORT_C TInt AnimationCommandItemCount() const; + + IMPORT_C void AddAnimationValueL( CAknsAnimationValueDef* aValue ); + IMPORT_C CAknsAnimationValueDef* AnimationValue( TInt32 aIndex ) const; + IMPORT_C TInt AnimationValueCount() const; + + IMPORT_C void AddTimingModelL( CAknsTimingModelDef* aModel ); + IMPORT_C CAknsTimingModelDef* TimingModel( TInt32 aIndex ) const; + IMPORT_C TInt TimingModelCount() const; + + IMPORT_C void AddSizeBoundParamL( CAknsSizeBoundParamDef* aParam ); + IMPORT_C CAknsSizeBoundParamDef* SizeBoundParam( TInt32 aIndex ) const; + IMPORT_C TInt SizeBoundParamCount() const; + + protected: + CAknsAnimationItemDef( const TAknsItemType aType, const TAknsItemID& aID ); + + public: + TUint32 iInputLayerIndex; + TUint32 iInputLayerMode; + TUint32 iOutputLayerIndex; + TUint32 iOutputLayerMode; + + private: + TUint32 iMinInterval; + TBool iMorphing; + + RPointerArray iPreprocessCommandArray; + RPointerArray iCommandArray; + RPointerArray iAnimationValueArray; + RPointerArray iTimingModelArray; + RPointerArray iSizeBoundParamArray; + }; + +#endif // AKNSITEMDEF_H + +// End of File diff -r 690b4f151c12 -r fd868a928992 dependencies/AknsPkgID.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/AknsPkgID.h Thu Apr 01 12:18:40 2010 +0100 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Defines the package ID class used to identify skin packages +* +*/ + + +#ifndef AKNSPKGID_H +#define AKNSPKGID_H + +// INCLUDES +#include +#include + +// CONSTANTS + +static const TInt KAknsPkgIDDesSize = 23; + +// DATA TYPES + +typedef TBuf TAknsPkgIDBuf; + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Package identifier used to identify skin packages. Package ID may be either +* a UID or a timestamp and random number pair. +* +* Note that the class does not define any constructors. This ensures that +* @c TAknsPkgID can be used in ROM constants. +* +* @lib AknSkinSrv.lib +* +* @since 2.0 +*/ +class TAknsPkgID + { + public: // New functions + + /** + * Sets skin package ID by giving a UID. + * + * @param aUid New UID to be set as the value of the package ID. + */ + inline void Set( const TUid aUid ); + + /** + * Sets skin package ID by giving a timestamp and a random number. + * + * @param aTimestamp Timestamp as an integer. Must be non-zero. + * + * @param aNumber Random number. + */ + inline void Set( const TInt aTimestamp, const TInt aNumber ); + + /** + * Sets skin package ID by an existing package ID. + * + * @param aID Skin package ID. + */ + inline void Set( const TAknsPkgID& aID ); + + /** + * Checks whether the skin package ID is a UID. + * + * @return ETrue if the skin package ID is a UID, EFalse otherwise. + */ + inline TBool IsUid() const; + + /** + * Returns the skin package ID as a UID. If the package ID is not a + * UID, the result is undefined. + * + * @return Skin packge ID as a UID. + */ + inline TUid Uid() const; + + public: // New functions - String conversions + + /** + * Copies the content of the package ID to the given descriptor. + * The size of the descriptor must be at least the size of + * @c TAknsPkgIDBuf. Otherwise the method may panic. + * + * @param aDes Target descriptor. + */ + IMPORT_C void CopyToDes( TDes& aDes ) const; + + /** + * Sets the content of the package ID based on the given character + * representation. The content of the given descriptor must be + * valid (as generated by @c CopyToDes). + * + * If the given descriptor doesn't contain a correctly formatted + * skin package ID the method leaves and the content of the object + * is undefined. + * + * @param aDes Source descriptor. + */ + IMPORT_C void SetFromDesL( const TDesC& aDes ); + + public: // Data + + TInt iNumber; //!< Number or UID. + TInt iTimestamp; //!< Timestamp (or 0 if UID). + + }; + +// CONSTANTS (continued) + +static const TAknsPkgID KAknsNullPkgID = { 0, 0 }; + +// FUNCTION PROTOTYPES + +/** +* C++ equal operator. +* Checks whether two package ID objects have identical content. +* +* @param aFirst First object to be compared. +* +* @param aSecond Second object to be compared. +* +* @return true if objects have identical content, false otherwise. +*/ +inline TBool operator==( const TAknsPkgID& aFirst, const TAknsPkgID& aSecond ); + +/** +* C++ not equal operator. +* Checks whether two package ID objects have identical content. +* +* @param aFirst First object to be compared. +* +* @param aSecond Second object to be compared. +* +* @return false if objects have identical content, true otherwise. +*/ +inline TBool operator!=( const TAknsPkgID& aFirst, const TAknsPkgID& aSecond ); + +// INLINED MEMBERS + +#include "AknsPkgID.inl" + +#endif // AKNSITEMID_H + +// End of File diff -r 690b4f151c12 -r fd868a928992 dependencies/AknsPkgID.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/AknsPkgID.inl Thu Apr 01 12:18:40 2010 +0100 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ?Description +* +*/ + + +// INLINED MEMBERS + +inline void TAknsPkgID::Set( const TUid aUid ) + { + iNumber = aUid.iUid; + iTimestamp = 0; + } + +inline void TAknsPkgID::Set( const TInt aTimestamp, const TInt aNumber ) + { + iNumber = aNumber; + iTimestamp = aTimestamp; + } + +inline void TAknsPkgID::Set( const TAknsPkgID& aID ) + { + iNumber = aID.iNumber; + iTimestamp = aID.iTimestamp; + } + +inline TBool TAknsPkgID::IsUid() const + { + return iTimestamp==0 ? ETrue : EFalse; + } + +inline TUid TAknsPkgID::Uid() const + { + return TUid::Uid(iNumber); + } + +inline TBool operator==( const TAknsPkgID& aFirst, const TAknsPkgID& aSecond ) + { + return (aFirst.iNumber==aSecond.iNumber)&&(aFirst.iTimestamp==aSecond.iTimestamp); + } + +inline TBool operator!=( const TAknsPkgID& aFirst, const TAknsPkgID& aSecond ) + { + return (aFirst.iNumber!=aSecond.iNumber)||(aFirst.iTimestamp!=aSecond.iTimestamp); + } + +// End of File diff -r 690b4f151c12 -r fd868a928992 dependencies/AknsSrvChunkLookup.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/AknsSrvChunkLookup.h Thu Apr 01 12:18:40 2010 +0100 @@ -0,0 +1,251 @@ +/* +* Copyright (c) 2003-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Chunk Lookup. +* +*/ + + +#ifndef AKNSSRVCHUNKLOOKUP_H +#define AKNSSRVCHUNKLOOKUP_H + +// INCLUDES + +#include +#include +#include + +// FORWARD DECLARATIONS +struct TAknsSrvItemDef; + +/** +* A class for looking up and creating item definitions stored in the +* shared memory chunk. +* +* @since 2.0 +*/ +NONSHARABLE_CLASS(CAknsSrvChunkLookup) : public CBase + { + public: // Construction and destruction + + /** + * SymbianOS two-phased constructor. + * + * @since 2.0 + * + * @return A new instance of CAknsSrvChunkLookup. + * + * @par Exceptions: + * If the construction fails, the leaves with one of the system wide + * error codes. + */ + static CAknsSrvChunkLookup* NewL(); + + /** + * Default C++ destructor. + */ + virtual ~CAknsSrvChunkLookup(); + + public: // New methods + + /** + * Returns item definition object matching the given item ID. + * Performs lookup for the given item ID and returns an instance of one + * of the subclasses of CAknsItemDef matching the given ID. If the call + * is successfull, ownership of the item definition object is transferred + * to the caller. + * + * @since 2.0 + * + * @param aID Item ID to be searched. + * + * @return Pointer to the item definition object now owned by the caller, + * or @c NULL if there was no match for the given IID. + * + * @par Exceptions: + * If construction of the item definition object failed, method leaves + * with an error code. + */ + IMPORT_C CAknsItemDef* LookupAndCreateDefL( const TAknsItemID& aID ); + + /** + * Returns stored scalable bitmaps and optionally its mask if it + * was stored. The ownership of the returned bitmap (and mask, if any) + * is transferred to the caller. + * + * Optionally, the caller can give the current copy of the bitmap and + * mask as aBitmap and aMask parameters. If the currently stored + * scalable bitmaps have the same handles, they are not re-duplicated. + * The ownership of the given bitmaps is transferred to chunk lookup. + * + * @since 2.8 + * + * @param aID Item ID to be searched. + * + * @param aLayout The layout id type for the searhed item. + * + * @param aBitmap Current bitmap or @c NULL. Ownership is transferred. + * After return, contains the newly duplicated bitmap, or @c NULL if + * not found. Ownership is transferred. + * + * @param aMask Current mask or @c NULL. Ownership is transferred. + * After return, contains the newly duplicated mask, or @c NULL if + * not found. Ownership is transferred. + */ + IMPORT_C void LookupAndCreateScalableItemL( const TAknsItemID& aID, + const TInt aLayout, const TSize& aLayoutSize, CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask, TInt& aMorphing); + + /** + * Blocks write access to the shared memory chunk. + * + * @since 2.0 + */ + void BeginRead(); + + /** + * Allows write access to the shared memory chunk. + * + * @since 2.0 + */ + void EndRead(); + + /** + * Blocks all rendering. + * + * @since 2.8 + */ + IMPORT_C void BeginRender(); + + /** + * Allows rendering. + * + * @since 2.8 + */ + IMPORT_C void EndRender(); + + private: // Reserved exports + + /** + * Reserved for future use. + * + * @since 2.0 + * + * @return Always returns zero. + */ + IMPORT_C TInt Reserved(); + + protected: // New methods + + /** + * Creates an item definition object (or leaves) based on the given + * item definition structure. + * + * Note that this method does not use the semaphore, and is therefore + * unprotected. + * + * @param aID Item ID of the item. + * + * @param aType Type of the definition. + * + * @param aDef Pointer to the definition. + * + * @param aBasePtr Chunk base pointer. + * + * @return Newly construction item definition object, or @c NULL if + * aDef was @c NULL. + * + * @since 2.0 + */ + CAknsItemDef* CreateUnprotectedL( const TAknsItemID& aID, + const TAny* aDef, const TAknsItemType aType, + const TAny* aBasePtr ); + + /** + * Returns stored scalable bitmaps and optionally its mask if it + * was stored. + * + * Note that this method does not use the semaphore, and is therefore + * unprotected. + * + * @since 2.8 + */ + void LookupAndCreateScalableItemUnprotectedL( const TAknsItemID& aID, + const TInt aLayout, const TSize& aLayoutSize, CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask, TInt& aMorphing); + + /** + * + * @since 3.0 + */ + CAknsEffectQueueItemDef* CreateEffectQueueL( const TAknsItemID& aID, + const TAny* aDefPtr, const TAny* aBasePtr ); + + /** + * + * @since 3.0 + */ + CAknsAnimationItemDef* CreateAnimationL( const TAknsItemID& aID, + const TAny* aDefPtr, const TAny* aBasePtr ); + + /** + * @since 3.0 + */ + CAknsEffectItemDef* CreateEffectL( const TUint8* aData, + const TBool aIsAnimationCommand, const TAny* aBasePtr ); + + /** + * @since 3.0 + */ + CAknsEffectParamDef* CreateParameterL( const TUint8* aData, const TAny* aBasePtr ); + + /** + * @since 3.0 + */ + TUint32 CreateParameterL( CAknsEffectParamDef*& aDef, + const TUint32 aOffset, + const TAny* aDefPtr, + const TAny* aBasePtr ); + + /** + * @since 3.0 + */ + TUint32 CreateEffectL( CAknsEffectItemDef*& aDef, + const TUint32 aOffset, + const TAny* aDefPtr, + const TAny* aBasePtr, + const TBool aIsAnimationCommand ); + + protected: // Protected constructors + + /** + * Default C++ constructor + */ + CAknsSrvChunkLookup(); + + /** + * Second-phase constructor. + */ + void ConstructL(); + + private: // Data + + RChunk iSharedChunk; + RSemaphore iWaitSema; + RMutex iRenderMutex; + + }; + +#endif // AKNSSRVCHUNKLOOKUP_H + +// End of file. diff -r 690b4f151c12 -r fd868a928992 dependencies/AknsSrvClient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/AknsSrvClient.h Thu Apr 01 12:18:40 2010 +0100 @@ -0,0 +1,536 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Defines the public client side interface class to access the + Skin Server and the skin change observer class to listen for + skin changes in the system. +* +*/ + + +#ifndef AKNSSRVCLIENT_H +#define AKNSSRVCLIENT_H + +// INCLUDES +#include +#include +#include +#include +#include + +#include "AknsSrvChunkLookup.h" + +// DATA TYPES + +/** +* Reasons for panicing client thread. +* +* @since 2.0 +*/ +enum TAknSkinSrvPanic + { + EAknsSrvBadRequest = 0, + EAknsSrvNotConnected = 2, + EAknsSrvNotifyHandlerMissing = 3, + EAknsSrvNoActiveScheduler = 4, + EAknsSrvCannotCreateSharedChunk = 6, + EAknsSrvBadAlignment = 8, + EAknsSrvFatalMergeFailure = 10, + EAknsSrvCannotAdjustChunk = 12, + EAknsSrvTooManyItemDefs = 14, + EAknsSrvCannotRestoreDefaults = 16, + EAknsSrvNotifyListImbalance = 18, + EAknsSrvInvalidMessageHandle = 20, + EAknsSrvInvalidBuildConf = 22, + EAknsSrvFatalDRMFailure = 24 + }; + +enum TAknsSrvInifileType + { + EAknsSrvInifileSSWP, + EAknsSrvInifileSSSS, + }; + +enum TAknsSrcScreenMode + { + EAknsSrcScrModeNone = 0, + EAknsSrvScrModePortrait = 1, + EAknsSrvScrModeLandscape = 2, + EAknsSrvScrModeSquare = 3 + }; + +/** +* Skin server panic category string. +* +* @since 2.0 +*/ +_LIT( KAknSkinSrvPanicCategory, "AknSkinServer" ); + +/** +* Enumeration of skin item definition classes. +* +* @since 2.0 +*/ +enum TAknsItemDefClass + { + /** + * Skin item definition class enumeration value for bitmaps, + * including layout backgrounds but excluding application icons. + */ + EAknsItemDefClassBitmaps = 1, + + /** + * Skin item definition class enumeration value for application icons. + */ + EAknsItemDefClassAppIcons = 2, + + /** + * Skin item definition class enumeration value for color sets. + */ + EAknsItemDefClassColorSets = 4 + }; + +/** +* Skin package change reason codes used by +* @c MAknsSkinChangeObserver::SkinPackageChanged +* +* @since 2.5 +*/ +enum TAknsSkinStatusPackageChangeReason + { + /** + * Enumeration value that indicates change in skin package list. + * + * @since 2.5 + */ + EAknsSkinStatusPackageListUpdate = 1 + }; + +/** +* Skin configuration change reason codes used by +* @c MAknsSkinChangeObserver::SkinConfigurationChanged +* +* @since 2.5 +*/ +enum TAknsSkinStatusConfigurationChangeReason + { + /** + * Enumeration value that indicates completion of skin content merge, + * i.e. the new configuration is available for reading. + * + * @since 2.5 + */ + EAknsSkinStatusConfigurationMerged = 1, + + /** + * Enumeration value that indicates completion of event propagation + * to clients, i.e. the new configuration has been deployed to + * the registered clients. + * + * @since 2.5 + */ + EAknsSkinStatusConfigurationDeployed = 2, + + /** + * Enumeration value that indicates unsuccessful completion of + * skin activation because of an out-of-memory condition. + * + * @since 2.5 + */ + EAknsSkinStatusConfigurationFailedOOM = 3, + + /** + * Enumeration value that indicates unsuccessful completion of + * skin activation because of a corrupted skin package. + * + * @since 2.5 + */ + EAknsSkinStatusConfigurationFailedCorrupt = 4, + /** + * Enumeration value that indicates a change in the + * state of the morphing skin items + * + * @since 3.0 + */ + EAknsSkinStatusMorphingStateChange = 5, + EAknsSkinStatusWallpaperChanged = 6, + + /** + * Enumeration value that indicates a change in the + * state of animation Background + * + * @since 5.2 + */ + EAknsSkinStatusAnimBackgroundChanged = 7, + + EAknsSkinStatusSlideSetWallpaperChanged = 8 + + }; + +// CONSTANTS + +_LIT( KAknsSrvRAMBitmapName, "RAM:BmpHandle"); + +// CLASS DECLARATION + +/** +* An user implementable interface class to handle the skin change +* notifications. +* +* @since 2.0 +*/ +class MAknsSkinChangeObserver + { + public: + + /** + * Called by the skin server when skin content is changed and the + * connected client wants to be informed. + * + * @since 2.0 + */ + virtual void SkinContentChanged() = 0; + + /** + * Called by the skin server to indicate that the current skin + * configuration has changed. + * + * @param aReason Reason code. + * + * @since 2.5 + */ + virtual void SkinConfigurationChanged( + const TAknsSkinStatusConfigurationChangeReason aReason ) = 0; + + /** + * Called by the skin server to indicate that the available + * skin packages have changed. + * + * @param aReason Reason code. + * + * @since 2.5 + */ + virtual void SkinPackageChanged( + const TAknsSkinStatusPackageChangeReason aReason ) = 0; + + /** + * Called by the skin server to ask for local cache cleanup. + * + * @since 3.1 + * + */ + virtual void FlushLocalCaches() {}; + }; + +// FORWARD DECLARATIONS + +class CAknsSkinChangeHandler; +struct TAknsSrvClientMemberData; + +// CLASS DECLARATION + +/** +* The client side interface class for the skins server +* Provides functionality to change the system skin, to retrieve skin content +* definitions from the server and to listen for skin change events. +* +* @lib AknSkinSrv.lib +* +* @since 2.0 +*/ +class RAknsSrvSession : public RSessionBase + { + public: + + /** + * C++ default constructor. + */ + IMPORT_C RAknsSrvSession(); + + /** + * Starts the server if it's not allready started and creates a new + * session. + * + * @since 2.0 + * + * @param aObserver Skin change observer. + * @param aPriority Observer priority. + * + * @return KErrNone if connection was succesfull, or otherwise one of + * the standard system wide error codes. + */ + IMPORT_C TInt Connect( MAknsSkinChangeObserver* aObserver = NULL, + TInt aPriority = CActive::EPriorityStandard ); + + /** + * Closes the session. + * + * @since 2.0 + * + */ + IMPORT_C void Close(); //lint !e1511 Hiding allowed + + /** + * Enables the servers skin change notifications mechanism. If the skin + * definitions have changed, or there are pending notification events, + * SkinContentChanged() is called for all sessions. + * The function affects all sessions. + * + * @since 2.0 + * + */ + IMPORT_C void EnableSkinChangeNotify(); + + + /** + * Disables the servers skin change notification mechanism. After this + * call no notification events are generated until a subsequent + * EnableSkinChangeNotify() is called. The function affects all sessions. + * + * @since 2.0 + * + */ + IMPORT_C void DisableSkinChangeNotify(); + + /** + * Notifies the server that the skin client has encountered an error + * while doing a skin change. After this call the server falls back to + * the system default skin and ignores any calls to this funcion to + * avoid infite loop. + * + * @since 2.0 + * + * @param aErrorCode Error code. + */ + IMPORT_C void ClientError(TInt aErrorCode = 0); + + /** + * Sets all the active item definition sets (including all the classes). + * Item definition sets of the skin with the given package ID are + * activated and clients are notified about the skin change. + * + * @since 2.0 + * + * @param aPID Package ID of the skin to be activated. + * + * @return KErrNone if succesfull or one of the system wide error codes. + */ + IMPORT_C TInt SetAllDefinitionSets( const TAknsPkgID aPID ); + + /** + * Retrieves skin information for all the available skins packages + * in specified location. After a call to this function, the ownewship + * of the array and the items in it is transferred to the caller. + * + * @since 2.0 + * + * @param aLocation the location from where to look for the skin + * packages. Default value is phone (i.e., c and z drives). + * + * @return A pointer to an array containing pointers to + * CAknsSrvSkinInformationPkg instances, or an empty array if no skin + * packages were found in the specified location. If the same skin + * was found multiple times, only the first match is included in the + * array. + * + * @par Exceptions: + * If enumeration failed, method leaves with an error code. + */ + IMPORT_C CArrayPtr* + EnumerateSkinPackagesL( + TAknSkinSrvSkinPackageLocation aLocation = EAknsSrvPhone ); + + /** + * Creates a chunk lookup object. + * + * @since 2.0 + * + * @return Newly created chunk lookup object. + * + * @par Exceptions: + * If construction fails, method leaves with an error code. + */ + IMPORT_C CAknsSrvChunkLookup* CreateChunkLookupL(); + + /** + * Sets the idle state wallpaper. + * + * @since 2.0 + * + * @param aFilename a fully qualified path(incl. path + filename) + * to the mbm file containing the wallpaper + * @param aIndex the index of the bitmap in the mbm file + * @param aMaskIndex the index of the mask bitmap in the mbm file + * + * @return If the call fails, one of the system wide error codes is + * returned. + */ + IMPORT_C TInt SetIdleWallpaper(const TDesC& aFilename); + + /** + * Stores a duplicate of the given bitmap (optionally with mask). + * + * @param aIID Item ID used as a key. + * + * @param aType Layout type used as a key. + * + * @param aBmp Pointer to a bitmap. Must be non-NULL. No ownership + * is transferred. + * + * @param aMask Pointer to a mask, or @c NULL. No ownership is + * transferred. + * + * @since 2.8 + */ + IMPORT_C TInt StoreScalableGraphics(const TAknsItemID& aIID, + const TInt aType, const TSize& aLayoutSize, const CFbsBitmap* aBmp, + const CFbsBitmap* aMask, TBool aMorphing = EFalse ); + + /** + * Instructs the server to cleanup any stored layout bitmaps. + * + * @return Error code. + * + * @since 2.8 + */ + IMPORT_C TInt ClearScalableGraphics(); + + /** + * Acknowledges the skin change notification. + * + * @return Error code. + * + * @since 2.7 + */ + TInt AcknowledgeSkinChangeNotification(); + + IMPORT_C TInt DeleteSkin(const TAknsPkgID aPID, TAknSkinSrvSkinPackageLocation aLocation ); + IMPORT_C TInt CopySkin(const TAknsPkgID aPID, TAknSkinSrvSkinPackageLocation aSourceLocation, TAknSkinSrvSkinPackageLocation aDestLocation); + IMPORT_C TInt OpenBitmapFile( const TDesC& aFilename, TInt &aFileHandle); + IMPORT_C TInt OpenInifile(const TAknsPkgID aPID, TAknSkinSrvSkinPackageLocation aLocation, TInt& aFilehandle, TBool aWriteToFile); + IMPORT_C TInt CopySoundFile(const TDesC& aSourceFilename, const TDesC& aTargetFilename); + IMPORT_C void DecodeWallpaperImageL(const TDesC& aFilename, const TSize& aTargetSize, CFbsBitmap*& aBitmap, CFbsBitmap*& aMask); + IMPORT_C TInt OpenImageInifile(TAknsSrvInifileType aType, TInt& aFilehandle); + IMPORT_C TInt SetSlideSetWallpaper(const CDesCArray& aFilenameArray); +#if defined(RD_SLIDESHOW_WALLPAPER) + void DoWriteInifileL(const CDesCArray& aFilenameArray); +#endif + IMPORT_C void FreeUnnecessaryLayoutBitmaps(TAknsSrcScreenMode aMode); + + /* + * Checks if AppArc has been configured using CenRep for this application UID. If so, skinned icon graphics are NOT + * created when calling AknsUtils::CreateAppIconLC. Instead, configured icon (which is defined in the + * AppArc's CenRep file) is used. Note that icon configuration can wary depending on active language. + * + * @since 5.0 + * + * @param aAppUid - Application UID of application to be checked. + * @return zero, if no cenrep-based configuration is used. + * Non-zero is returned, if application UID is configured using AppArc's CenRep file. + */ + IMPORT_C TInt CheckIconConfiguration( TUid aAppUid ); + + /** + * Add one wallpaper. + * + * @param aFilename a fully qualified path(incl. path + filename) + * of the wallpaper + * @param aTargetSize - Decoded size. + * if not set, Both portait and landscape(base on screen size) will be decoded. + */ + IMPORT_C void AddWallpaperL( const TDesC& aFilename, const TSize& aTargetSize ); + + /** + * Remove one decoded wallpaper. + * + * @param aFilename a fully qualified path(incl. path + filename) + * of the wallpaper + */ + IMPORT_C void RemoveWallpaper( const TDesC& aFilename ); + + /** + * Remove all decoded wallpaper. + */ + IMPORT_C void RemoveAllWallpapers( ); + + /** + * Get a decoded wallpaper. + */ + IMPORT_C CFbsBitmap* WallpaperImageL( const TDesC& aFilename ); + + private: // Reserved exports + + /** + * Reserved for future use. + * + * @since 2.0 + * + * @return Always returns zero. + */ + IMPORT_C TInt Reserved1(); + + /** + * Reserved for future use. + * + * @since 2.0 + * + * @return Always returns zero. + */ + IMPORT_C TInt Reserved2(); + + /** + * Reserved for future use. + * + * @since 2.0 + * + * @return Always returns zero. + */ + IMPORT_C TInt Reserved3(); + + /** + * Reserved for future use. + * + * @since 2.0 + */ + IMPORT_C void Reserved4(); + + private: + + /** + * Gets the server version. + */ + TVersion Version() const; + + /** + * Cancels send operation. + */ + void SendCancel(); + + /** + * Completes event handling. + */ + void EventHandled(); + + private: // Data + + // Holds member variables of this class. + TAknsSrvClientMemberData* iMemberData; + + private: // Friend classes + friend class CAknsSkinChangeHandler; + + }; + +#endif // AKNSSRVCLIENT_H + +// End of File diff -r 690b4f151c12 -r fd868a928992 dependencies/AknsSrvSkinInformationPkg.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/AknsSrvSkinInformationPkg.h Thu Apr 01 12:18:40 2010 +0100 @@ -0,0 +1,336 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Defines constant values for Avkon Skins. +* +*/ + + +#ifndef AKNSSRVSKININFORMATIONPKG_H +#define AKNSSRVSKININFORMATIONPKG_H + +//INCLUDE FILES + +#include + +#include + +// CONSTANTS + +/** +* Enumeration for the skin package locations. +* +* @since 2.0 +* +*/ +enum TAknSkinSrvSkinPackageLocation + { + /** + * Location enum value for phone (drives C:\ and Z:\) + */ + EAknsSrvPhone = 0, + + /** + * Location enum value for MMC (E:\) + */ + EAknsSrvMMC = 2, + + /** + * Location enum value for all drives available.(d:\ ie. RAM disk excluded) + */ + EAknsSrvAll = 4 + }; + +/** +* Enumeration for the skin protection type. +* +* @since 2.6 +* +*/ +enum TAknsSkinSrvSkinProtectionType + { + /** + * The skin is not DRM protected + */ + EAknsSrvNoProtection, + + /** + * The skin is DRM protected + */ + EAknsSrvProtected, + + /** + * The rights object for has no rights for the skin + */ + EAknsSrvNoRights, + + /** + * The rights object for the skin is count based, + * and should not be allowed to activated or + * edited. + * §qtn_drm_prev_rights_set§ should be displayed. + */ + EAknsSrvCountBased, + + /** + * The rights object is valid in the future, + * should not be allowed to be actived or + * edited. + * §qtn_drm_prev_rights_set§ should be displayed. + */ + EAknsSrvFutureRights, + + /** + * The rights object has bee expired + * §qtn_drm_mgr_det_exp§ from drmcommon should be displayed + */ + EAknsSrvExpiredRights + }; + +// CLASS DECLARATIONS + +struct TAknsSrvSkinInfoPkg +{ + public: + TAknsPkgID iPID; // Package ID of the skin + TAknsPkgID iColorSchemePID; // Package ID of the color scheme in the skin + TFileName iSkinDirectoryBuf; // The directory of the skin package + TFileName iSkinIniFileDirectoryBuf; // The directory containing the skin ini file + TFileName iSkinNameBuf; // The name of the skin package. + TFileName iIdleStateWallPaperImageName; // The name of the idle state wallpaper mbm file. + TFileName iFullName; // The fully qualified skn-file name + TBool iIsCopyable; // Boolean value specifying if the skin package copyable + TBool iIsDeletable; // Boolean value specifying if the skin package is deletable + TInt iIdleBgImageIndex; // The index of the idle state background image + TAknsSkinSrvSkinProtectionType iProtectionType; // Specifies the DRM protection type in this skin + TBool iCorrupted; // Specifies if the skin is somehow corrupted + TBool iSupportAnimBg; // Specifies if the skin support animated background +}; + +/** +* A storage class containing skin information. +* +* @since 2.0 +* +**/ +NONSHARABLE_CLASS(CAknsSrvSkinInformationPkg) : public CBase + { + public: // Construction and destruction + + static CAknsSrvSkinInformationPkg* NewL( + const TAknsPkgID aPID, const TAknsPkgID aColorSchemePID, + const TDesC& aDirectory, const TDesC& aInifileDir, + const TDesC& aSkinName, + const TDesC& aIdleStateMbmFilename, + const TDesC& aPinboardWallPaperMbmFilename, + const TDesC& aFullName, + const TInt aIdleBgImageIndex, + const TInt aPinboardBgImageIndex, + const TBool aDeletable, + const TBool aCopyable, + const TBool aHasIconset, + const TAknsSkinSrvSkinProtectionType aProtectionType, + const TBool aCorrupted, + const TBool aSupportAnimBg); + + virtual ~CAknsSrvSkinInformationPkg(); + + public: // New methods + + /** + * Gets the package ID of the skin + * + * @since 2.0 + * + * @return The package ID of the skin + */ + IMPORT_C TAknsPkgID PID() const; + + /** + * Gets the skin package directory + * + * @since 2.0 + * + * @return The skin package directory + */ + IMPORT_C TDesC& Directory() const; + + /** + * Gets the skin package ini file directory + * + * @since 2.0 + * + * @return The skin package ini file directory + */ + IMPORT_C TDesC& IniFileDirectory() const; + + /** + * Gets the skin name. May or may not be empty. + * + * @since 2.0 + * + * @return The skin name, may also be empty + */ + IMPORT_C TDesC& Name() const; + + /** + * Gets the skin idle state wallpaper mbm file name. May or may not be empty. + * The filename is fully qualified (incl. full file path) + * + * @since 2.0 + * + * @return The mbm filename of the skin wallpaper, may also be empty + */ + IMPORT_C TDesC& IdleStateWallPaperImageFileName() const; + + /** + * Gets the skin pinboard wallpaper mbm file name. May or may not be empty. + * The filename is fully qualified (incl. full file path) + * + * @since 2.0 + * + * @return The mbm filename of the pinboard wallpaper, may also be empty + */ + IMPORT_C TDesC& PinboarWallPaperImageFileName() const; + + /** + * Gets the idle state background image index. + * + * @since 2.0 + * + * @return The idle state background image index. + */ + IMPORT_C TInt IdleStateWallPaperImageIndex() const; + + /** + * Gets the pinboard background image index. + * + * @since 2.0 + * + * @return The pinboard background image index. + */ + IMPORT_C TInt PinboardWallPaperImageIndex() const; + + /** + * Indicates if the skin package is deletable. + * + * @since 2.0 + * + * @return ETrue if the skin is deletable, EFalse otherwise. + */ + IMPORT_C TBool IsDeletable() const; + + /** + * Indicates if the skin package is copyable. + * + * @since 2.0 + * + * @return ETrue if the skin is deletable, EFalse otherwise. + */ + IMPORT_C TBool IsCopyable() const; + + /** + * Returns the color scheme package ID for this skin. + * + * @since 2.0 + * + * @return Package ID value of the color scheme associated with this + * skin, or @c KAknsNullPkgID if this skin has no preference over + * color schemes. + * + */ + IMPORT_C TAknsPkgID ColorSchemePID() const; + + /** + * Indicates whether the skin has an iconset. + * + * @since 2.0 + * + * @return ETrue if the skin has an iconset, EFalse otherwise. + */ + IMPORT_C TBool HasIconset() const; + + /** + * Gets the protection type for this skin + * + * @since 2.6 + * + * @return The protection type for this skin. + */ + IMPORT_C TAknsSkinSrvSkinProtectionType ProtectionType() const; + + /** + * Indicates whether the skin is corrupted. + * + * @since 2.6 + * + * @return ETrue if the skin is corrupted, EFalse otherwise. + */ + IMPORT_C TBool IsCorrupted() const; + + /** + * Get the fully qualified skin skn-filename (incl. full path). + * + * @since 2.6 + * + * @return The fully qualified skn-file name. + */ + IMPORT_C TDesC& FullName() const; + + /** + * Indicates whether the skin support animation background. + * + * @since 5.2 + * + * @return The fully qualified skn-file name. + */ + IMPORT_C TBool IsSupportAnimBg() const; + + protected: + CAknsSrvSkinInformationPkg( + const TAknsPkgID aPID, const TAknsPkgID aColorSchemePID, + const TBool aDeletable, const TBool aCopyable, + const TInt aIdleBgImageIndex, + const TInt aPinboardBgImageIndex, const TBool aHasIconset, + const TAknsSkinSrvSkinProtectionType aProtectionType, + const TBool aCorrupted, + const TBool aSupportAnimBg); + + void ConstructL( + const TDesC& aDirectory, const TDesC& aInifileDir, + const TDesC& aSkinName, const TDesC& aIdleStateMbmFilename, + const TDesC& aPinboardWallPaperMbmFilename, + const TDesC& aFullName); + + private: + TAknsPkgID iPID; // Package ID of the skin + TAknsPkgID iColorSchemePID; // Package ID of the color scheme in the skin + HBufC* iSkinDirectoryBuf; // The directory of the skin package + HBufC* iSkinIniFileDirectoryBuf; // The directory containing the skin ini file + HBufC* iSkinNameBuf; // The name of the skin package. + HBufC* iIdleStateWallPaperImageName; // The name of the idle state wallpaper mbm file. + HBufC* iPinboardWallPaperImageName; // The name of the pinboard wallpaper mbm file + HBufC* iFullName; // The fully qualified skn-file name + TBool iIsCopyable; // Boolean value specifying if the skin package copyable + TBool iIsDeletable; // Boolean value specifying if the skin package is deletable + TInt iIdleBgImageIndex; // The index of the idle state background image + TInt iPinboardBgImageIndex; // The index of the pinboard backgound image + TBool iHasIconset; // Boolean value indicating whether this skin has an iconset + TAknsSkinSrvSkinProtectionType iProtectionType; // Specifies the DRM protection type in this skin + TBool iCorrupted; // Specifies if the skin is somehow corrupted + TBool iSupportAnimBg; // Specifies if the skin support Animated background + }; + +#endif AKNSSRVSKININFORMATIONPKG_H // AknsSrvSkinInformationPkg.h + +// End of file diff -r 690b4f151c12 -r fd868a928992 dependencies/bld.inf --- a/dependencies/bld.inf Wed Mar 31 12:29:10 2010 +0300 +++ b/dependencies/bld.inf Thu Apr 01 12:18:40 2010 +0100 @@ -65,6 +65,13 @@ AknStatuspaneUtils.h MW_LAYER_PLATFORM_EXPORT_PATH(AknStatuspaneUtils.h) eikcba.h eikcba.h aknlayout.lag aknlayout.lag +AknsSrvClient.h AknsSrvClient.h +AknsEffectAnim.h AknsEffectAnim.h +AknsItemDef.h AknsItemDef.h +AknsSrvSkinInformationPkg.h AknsSrvSkinInformationPkg.h +AknsSrvChunkLookup.h AknsSrvChunkLookup.h +AknsPkgID.h AknsPkgID.h +AknsPkgID.inl AknsPkgID.inl #include "S3libs/bld.inf" diff -r 690b4f151c12 -r fd868a928992 group/ABLD.BAT --- a/group/ABLD.BAT Wed Mar 31 12:29:10 2010 +0300 +++ b/group/ABLD.BAT Thu Apr 01 12:18:40 2010 +0100 @@ -3,7 +3,7 @@ REM Bldmake-generated batch file - ABLD.BAT REM ** DO NOT EDIT ** -perl -S ABLD.PL "\homescreensrv\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +perl -S ABLD.PL "\S60\devices\S60_5th_Edition_SDK_v1.0\homescreensrv\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 if errorlevel==1 goto CheckPerl goto End diff -r 690b4f151c12 -r fd868a928992 homescreensrv_plat/group/ABLD.BAT --- a/homescreensrv_plat/group/ABLD.BAT Wed Mar 31 12:29:10 2010 +0300 +++ b/homescreensrv_plat/group/ABLD.BAT Thu Apr 01 12:18:40 2010 +0100 @@ -3,7 +3,7 @@ REM Bldmake-generated batch file - ABLD.BAT REM ** DO NOT EDIT ** -perl -S ABLD.PL "\homescreensrv\homescreensrv_plat\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +perl -S ABLD.PL "\S60\devices\S60_5th_Edition_SDK_v1.0\homescreensrv\homescreensrv_plat\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 if errorlevel==1 goto CheckPerl goto End