uigraphics/AknIcon/inc/AknNvgFormatHandler.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:  
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef AKN_NVG_FORMAT_HANDLER_H
       
    22 #define AKN_NVG_FORMAT_HANDLER_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32std.h>
       
    26 #include <nvg.h>
       
    27 #include "AknIconFormatHandler.h"
       
    28 #include <flogger.h>
       
    29 
       
    30 _LIT( KNVGFileLoggingDir, "nvg" );
       
    31 _LIT( KNVGFileLog, "nvg-log.txt" );
       
    32 
       
    33 static const TUid  KUidNvgProprietaryFormat = { 968435518 };
       
    34 // FORWARD DECLARATIONS
       
    35 
       
    36 class CFbsBitmap;
       
    37 class MAknIconChangeObserver;
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41 * CAknNvgFormatHandler
       
    42 */
       
    43 NONSHARABLE_CLASS(CAknNvgFormatHandler) :
       
    44     public CBase,
       
    45     public MAknIconFormatHandler
       
    46     {
       
    47     public:  // Constructors and destructor
       
    48 
       
    49         static CAknNvgFormatHandler* NewL();
       
    50         ~CAknNvgFormatHandler();
       
    51 
       
    52     public: // From MAknIconFormatHandler
       
    53 
       
    54         void SetScaleMode( TScaleMode aMode );
       
    55 
       
    56         void SetRotation( TInt aAngle );
       
    57 
       
    58         void GetContentDimensionsL( TAknContentDimensions& aContentDimensions );
       
    59 
       
    60         void SetObserver( MAknIconChangeObserver *aObserver );
       
    61 
       
    62         void SupportedDisplayMode(
       
    63             TDisplayMode& aMode, TDisplayMode aPreferredMode );
       
    64 
       
    65         void PrepareIconL( const TDesC8& aIconData, TInt& aHandle );
       
    66 
       
    67         void UsePreparedIconL( TInt aHandle );
       
    68 
       
    69         void RenderPreparedIconL(
       
    70             CFbsBitmap* aBitmap,
       
    71             CFbsBitmap* aMask, TSize Bitmapsize=TSize(0,0),
       
    72             TDisplayMode Bitmapdepth = ENone, TDisplayMode Maskdepth = ENone,
       
    73             TRgb aColor = TRgb(0,0,0), TBool aMarginFlag = EFalse );
       
    74 
       
    75         void UnprepareIcon( TInt aHandle );
       
    76 
       
    77         void SetAnimated( TBool aAnimated );
       
    78 
       
    79         TInt IconFormatType();
       
    80         
       
    81 /*    private: // From MSvgRequestObserver
       
    82     
       
    83 		void UpdateScreen();
       
    84 		TBool ScriptCall( const TDesC& aScript,CSvgElementImpl* aCallerElement );
       
    85 	    TInt FetchImage( const TDesC& aUri, RFs& aSession, RFile& aFileHandle );
       
    86 	    void UpdatePresentation(const TInt32&  aNoOfAnimation);
       
    87 	    TInt FetchFont( const TDesC& aUri, RFs& aSession, RFile& aFileHandle );
       
    88 */
       
    89     private: // New functions
       
    90 
       
    91         void InitializeEngineL();
       
    92     void CheckHandleActivatedL( CFbsBitmap* aBitmap, CFbsBitmap* aMask );
       
    93     static void CleanupNullMaskPointer( TAny* aParam );
       
    94         
       
    95         void SetEngineScaleMode();
       
    96 
       
    97     void FormCommonHeader(const CFbsBitmap *aBitmap, TBool isMask = EFalse,TRgb aColor=TRgb(0,0,0), TBool aIsAppIcon=EFalse);
       
    98     private: // Private constructors
       
    99         CAknNvgFormatHandler();
       
   100         void ConstructL();
       
   101 
       
   102     private: // Data
       
   103 
       
   104 		 CNvgEngine* iNvgEngine;
       
   105         MAknIconChangeObserver* iObserver;
       
   106         CFbsBitmap* iDummyBitmap; // TODO: remove when can
       
   107         CFbsBitmap* iMask; // not owned
       
   108         TInt iMode;
       
   109         TInt iAngle;
       
   110         TBool iAnimated;
       
   111 
       
   112         TInt iHandle;
       
   113 
       
   114         enum
       
   115             {
       
   116             ENotActivated = 0,
       
   117             EActivated = 1,
       
   118             EActivatedWithFrameBuffer = 2
       
   119             };
       
   120 
       
   121         TInt iHandleActivationStatus;
       
   122         public:
       
   123         RArray<TPtrC8> iIconData;
       
   124         HBufC8 *iData;
       
   125     };
       
   126 
       
   127 #endif      // AKN_NVG_FORMAT_HANDLER_H
       
   128             
       
   129 // End of File