aknsutils.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : AknsUtils.h
00004 *  Part of     : Avkon Skins / Skin Library
00005 *  Interface   : ?Interface_category, ?Interface_name
00006 *  Description : Defines a public static utility class AknsUtils.
00007 *  Version     : ?Version
00008 *
00009 *  Copyright © 2002-2004 Nokia Corporation.
00010 *  This material, including documentation and any related 
00011 *  computer programs, is protected by copyright controlled by 
00012 *  Nokia Corporation. All rights are reserved. Copying, 
00013 *  including reproducing, storing, adapting or translating, any 
00014 *  or all of this material requires the prior written consent of 
00015 *  Nokia Corporation. This material also contains confidential 
00016 *  information which may not be disclosed to others without the 
00017 *  prior written consent of Nokia Corporation.
00018 * ==============================================================================
00019 */
00020 
00021 #ifndef AKNSUTILS_H
00022 #define AKNSUTILS_H
00023 
00024 //  INCLUDES
00025 #include <AknsSkinInstance.h>
00026 #include <apgicnfl.h>
00027 #include <AknIconUtils.h>
00028 
00029 // FORWARD DECLARATIONS
00030 class CFbsBitmap;
00031 class CAknsItemDef;
00032 class CCoeControl;
00033 class CGulIcon;
00034 
00035 // TYPE DEFINITIONS
00036 
00042 enum TAknsAppIconType
00043     {
00044     EAknsAppIconTypeList    = 0,
00045     EAknsAppIconTypeContext = 1,
00046     EAknsAppIconType3D      = 2
00047     };
00048 
00049 // CLASS DECLARATION
00050 
00064 class AknsUtils
00065     {    
00066 
00067     public: // New functions - Creators
00068         
00085         IMPORT_C static void InitSkinSupportL();
00086 
00098         IMPORT_C static MAknsDataContext* CreateDataContextForContainerL();
00099 
00116         IMPORT_C static CAknsItemDef* CreateBitmapItemDefL( 
00117             const TAknsItemID& aID, const TDesC& aFilename, 
00118             const TInt aIndex );
00119 
00139         IMPORT_C static CAknsItemDef* CreateMaskedBitmapItemDefL( 
00140             const TAknsItemID& aID, const TDesC& aFilename, 
00141             const TInt aIndex, const TInt aMaskIndex );
00142 
00143     public: // New functions - Skin access
00144 
00155         IMPORT_C static MAknsSkinInstance* SkinInstance();
00156 
00173         IMPORT_C static MAknsDataContext* DataContext( MObjectProvider* aMop );
00174 
00175     public: // New functions - Item access w/ fallback support
00176 
00217         IMPORT_C static void CreateIconL(
00218             MAknsSkinInstance* aInstance, const TAknsItemID& aID,
00219             CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
00220             const TDesC& aFilename,
00221             const TInt aFileBitmapId, const TInt aFileMaskId );
00222 
00235         IMPORT_C static void CreateIconLC(
00236             MAknsSkinInstance* aInstance, const TAknsItemID& aID,
00237             CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
00238             const TDesC& aFilename,
00239             const TInt aFileBitmapId, const TInt aFileMaskId );
00240 
00273         IMPORT_C static void CreateIconL(
00274             MAknsSkinInstance* aInstance, const TAknsItemID& aID,
00275             CFbsBitmap*& aBitmap,
00276             const TDesC& aFilename,
00277             const TInt aFileBitmapId );
00278 
00290         IMPORT_C static void CreateIconLC(
00291             MAknsSkinInstance* aInstance, const TAknsItemID& aID,
00292             CFbsBitmap*& aBitmap,
00293             const TDesC& aFilename,
00294             const TInt aFileBitmapId );
00295 
00334         IMPORT_C static CApaMaskedBitmap* CreateMaskedBitmapL(
00335             MAknsSkinInstance* aInstance, const TAknsItemID& aID,
00336             const TDesC& aFilename,
00337             const TInt aFileIndex, const TInt aFileMaskIndex );
00338 
00374         IMPORT_C static CGulIcon* CreateGulIconL(
00375             MAknsSkinInstance* aInstance, const TAknsItemID& aID,
00376             const TDesC& aFilename,
00377             const TInt aFileIndex, const TInt aFileMaskIndex );
00378 
00423         IMPORT_C static void CreateAppIconLC(
00424             MAknsSkinInstance* aInstance, TUid aAppUid,
00425             TAknsAppIconType aType,
00426             CFbsBitmap*& aBitmap, CFbsBitmap*& aMask );
00427 
00454         IMPORT_C TInt OpenAppIconFile(
00455             MAknsSkinInstance* aInstance, TUid aAppUid,
00456             TAknsAppIconType aType, RFile& aFile );
00457 
00517         IMPORT_C static void CreateColorIconL(
00518             MAknsSkinInstance* aInstance, const TAknsItemID& aID,
00519             const TAknsItemID& aColorID, const TInt aColorIndex,
00520             CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
00521             const TDesC& aFilename,
00522             const TInt aFileBitmapId, const TInt aFileMaskId,
00523             const TRgb aDefaultColor );
00524 
00539         IMPORT_C static void CreateColorIconLC(
00540             MAknsSkinInstance* aInstance, const TAknsItemID& aID,
00541             const TAknsItemID& aColorID, const TInt aColorIndex,
00542             CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
00543             const TDesC& aFilename,
00544             const TInt aFileBitmapId, const TInt aFileMaskId,
00545             const TRgb aDefaultColor );
00546 
00555         IMPORT_C static void CreateColorIconL(
00556             MAknsSkinInstance* aInstance, const TAknsItemID& aID,
00557             const TAknsItemID& aColorID, const TInt aColorIndex,
00558             CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
00559             const TDesC& aFilename,
00560             const TInt aFileBitmapId, const TInt aFileMaskId,
00561             const TRgb aDefaultColor,
00562             const TSize& aSize, const TScaleMode aScaleMode );
00563 
00578         IMPORT_C static void CreateColorIconLC(
00579             MAknsSkinInstance* aInstance, const TAknsItemID& aID,
00580             const TAknsItemID& aColorID, const TInt aColorIndex,
00581             CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
00582             const TDesC& aFilename,
00583             const TInt aFileBitmapId, const TInt aFileMaskId,
00584             const TRgb aDefaultColor,
00585             const TSize& aSize, const TScaleMode aScaleMode );
00586 
00587     public: // New functions - Item access w/o support for scalable graphics
00588 
00617         IMPORT_C static TInt GetAppIcon(
00618             MAknsSkinInstance* aInstance, TUid aAppUid, TSize aSize, 
00619             CApaMaskedBitmap& aAppBitmap );
00620 
00621     public: // New functions - Item access w/ ownership
00622 
00641         IMPORT_C static CFbsBitmap* CreateBitmapL( 
00642             MAknsSkinInstance* aInstance, const TAknsItemID& aID );
00643 
00681         IMPORT_C static CApaMaskedBitmap* CreateMaskedBitmapL(
00682             MAknsSkinInstance* aInstance, const TAknsItemID& aID );
00683 
00714         IMPORT_C static CGulIcon* CreateGulIconL(
00715             MAknsSkinInstance* aInstance, const TAknsItemID& aID,
00716             const TBool aRequireMask );
00717 
00718     public: // New functions - Item access w/o ownership
00719 
00743         IMPORT_C static CFbsBitmap* GetCachedBitmap( 
00744             MAknsSkinInstance* aInstance, const TAknsItemID& aID );
00745 
00776         IMPORT_C static void GetCachedMaskedBitmap(
00777             MAknsSkinInstance* aInstance, const TAknsItemID& aID,
00778             CFbsBitmap*& aBitmap, CFbsBitmap*& aMask );
00779 
00801         IMPORT_C static TInt GetCachedColor(
00802             MAknsSkinInstance* aInstance, TRgb& aRgb, const TAknsItemID& aID,
00803             const TInt aIndex );
00804 
00822         IMPORT_C static TBool BooleanPropertyL( MAknsSkinInstance* aInstance, 
00823             const TAknsItemID& aID );
00824 
00839         static TBool IsDerivedType( const TAknsItemType aBaseType, 
00840             const TAknsItemType aDerivedType );
00841 
00842     public: // New functions - Avkon parameters
00843 
00857         IMPORT_C static void SetAvkonSkinEnabledL( const TBool aEnabled );
00858 
00881         IMPORT_C static TBool AvkonSkinEnabled();
00882 
00895         IMPORT_C static void SetAvkonHighlightAnimationEnabledL( const TBool aEnabled );
00896 
00906         IMPORT_C static TBool AvkonHighlightAnimationEnabled();
00907 
00908     public: // New functions - Control position list
00909 
00928         IMPORT_C static void RegisterControlPosition( 
00929             const CCoeControl* aControl );
00930 
00952         IMPORT_C static void RegisterControlPosition( 
00953             const CCoeControl* aControl, const TPoint& aPoint );
00954 
00966         IMPORT_C static void DeregisterControlPosition( 
00967             const CCoeControl* aControl );
00968 
00982         IMPORT_C static TInt GetControlPosition( const CCoeControl* aControl,
00983             TPoint& aScreenPos );
00984 
00985     private: // Internal methods
00986 
00994         static TInt GetAppIconFromSkin(
00995             MAknsSkinInstance* aInstance, TUid aAppUid, TSize aSize, 
00996             CFbsBitmap*& aBitmap, CFbsBitmap*& aMask );
00997 
01013         static TAknsItemID SelectBestAppIconBitmapL(
01014             const TSize& aSize, MAknsSkinInstance* aSkin,
01015             const TAknsItemID& aAppIconIID );
01016 
01017     private: // Reserved exports
01018 
01026         IMPORT_C static TInt Reserved();
01027 
01028     private: // Prohibited constructors and destructor
01029         
01030         // Construction prohibited (static class)
01031         AknsUtils();
01032         // Destruction prohibited (static class)
01033         ~AknsUtils();
01034     };
01035 
01036 // AKNSUTILS_H   
01037 #endif
01038             
01039 // End of File

Copyright © Nokia Corporation 2001-2008
Back to top