uigraphics/AknIcon/inc/AknNGAFormatHandler.h
changeset 0 05e9090e2422
equal deleted inserted replaced
-1:000000000000 0:05e9090e2422
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Format Handler for NGA(will create an extended bitmap)
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef AKN_NGA_FORMAT_HANDLER_H
       
    22 #define AKN_NGA_FORMAT_HANDLER_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32std.h>
       
    26 #include <SVGEngineInterfaceImpl.h>
       
    27 #include <SVGRequestObserver.h>
       
    28 
       
    29 #include "AknIconFormatHandler.h"
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 
       
    33 class CFbsBitmap;
       
    34 class MAknIconChangeObserver;
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38  * CAknNGAFormatHandler
       
    39  * Format Handler for NGA(will create an extended bitmap)
       
    40  */
       
    41 NONSHARABLE_CLASS(CAknNGAFormatHandler) :
       
    42     public CBase,
       
    43     public MAknIconFormatHandler,
       
    44     public MSvgRequestObserver
       
    45 	{
       
    46 public:
       
    47 
       
    48     static CAknNGAFormatHandler* NewL(TInt aType,TSize aBitmapSize,TDisplayMode aBitmapDspMode,TDisplayMode aMaskDspMode);
       
    49     ~CAknNGAFormatHandler();
       
    50 
       
    51 public: // From MAknIconFormatHandler
       
    52 
       
    53     void SetScaleMode( TScaleMode aMode );
       
    54 
       
    55     void SetRotation( TInt aAngle );
       
    56 
       
    57     void GetContentDimensionsL( TAknContentDimensions& aContentDimensions );
       
    58 
       
    59     void SetObserver( MAknIconChangeObserver *aObserver );
       
    60 
       
    61     void SupportedDisplayMode(
       
    62         TDisplayMode& aMode, TDisplayMode aPreferredMode );
       
    63 
       
    64     void PrepareIconL( const TDesC8& aIconData, TInt& aHandle );
       
    65 
       
    66     void UsePreparedIconL( TInt aHandle );
       
    67 
       
    68     void RenderPreparedIconL(
       
    69         CFbsBitmap* aBitmap,
       
    70         CFbsBitmap* aMask,TSize Bitmapsize=TSize(0,0),TDisplayMode Bitmapdepth=ENone,TDisplayMode Maskdepth=ENone, TRgb aColor = TRgb(0,0,0),  TBool aIsAppIcon = EFalse);
       
    71 
       
    72     void UnprepareIcon( TInt aHandle );
       
    73 
       
    74     void SetAnimated( TBool aAnimated );
       
    75     
       
    76     TInt IconFormatType();
       
    77 private: // From MSvgRequestObserver
       
    78 
       
    79     void UpdateScreen();
       
    80     TBool ScriptCall( const TDesC& aScript,CSvgElementImpl* aCallerElement );
       
    81     TInt FetchImage( const TDesC& aUri, RFs& aSession, RFile& aFileHandle );
       
    82     void UpdatePresentation(const TInt32&  aNoOfAnimation);
       
    83     TInt FetchFont( const TDesC& aUri, RFs& aSession, RFile& aFileHandle );
       
    84 
       
    85 private:
       
    86 
       
    87     void InitializeEngineL();
       
    88     void CheckHandleActivatedL( CFbsBitmap* aBitmap, CFbsBitmap* aMask );
       
    89 
       
    90     static void LeaveIfErrorL( MSvgError* aError );
       
    91     static TInt SvgErrorToSymbianError( const TSvgErrorCode aError );
       
    92     
       
    93     static void CleanupNullMaskPointer( TAny* aParam );
       
    94     
       
    95     void SetEngineScaleMode();
       
    96 
       
    97     private: // Private constructors
       
    98         CAknNGAFormatHandler(TSize aBitmapSize,TDisplayMode aBitmapDspMode,TDisplayMode aMaskDspMode);
       
    99         void ConstructL(TInt aType);
       
   100         void FormCommonHeader(const CFbsBitmap *aBitmap, TBool isMask = EFalse,TRgb aColor=TRgb(0,0,0), TBool aMarginFlag=EFalse);
       
   101 
       
   102 private:
       
   103     CSvgEngineInterfaceImpl* iSvgEngine;
       
   104     MAknIconChangeObserver* iObserver;
       
   105     CFbsBitmap* iDummyBitmap; // TODO: remove when can
       
   106     CFbsBitmap* iMask; // not owned
       
   107     TInt iMode;
       
   108     TInt iAngle;
       
   109     TBool iAnimated;
       
   110     TSize iBitmapSize;
       
   111     TDisplayMode iBitmapDspMode;
       
   112     TDisplayMode iMaskDspMode;
       
   113     TInt iHandle;
       
   114 
       
   115     enum
       
   116         {
       
   117         ENotActivated = 0,
       
   118         EActivated = 1,
       
   119         EActivatedWithFrameBuffer = 2
       
   120         };
       
   121 
       
   122     TInt iHandleActivationStatus;
       
   123     HBufC8 *            iData;
       
   124     };
       
   125 
       
   126 #endif      // AKN_NGA_FORMAT_HANDLER_H
       
   127             
       
   128 // End of File