idlehomescreen/widgetmanager/inc/wmimageconverter.h
changeset 2 08c6ee43b396
parent 1 5315654608de
child 11 ff572dfe6d86
equal deleted inserted replaced
1:5315654608de 2:08c6ee43b396
    56     enum TState 
    56     enum TState 
    57         {
    57         {
    58         EIdle = 0,
    58         EIdle = 0,
    59         EDecoding,
    59         EDecoding,
    60         EScalingBitmap,
    60         EScalingBitmap,
    61         EScalingMask
    61         EScalingMask,
       
    62         EFailed
    62         };
    63         };
    63 
    64 
    64 public: //contructors/destructors
    65 public: //contructors/destructors
    65     /**
    66     /**
    66      * Two-phased constructor.
    67      * Two-phased constructor.
    82      * Supported values:
    83      * Supported values:
    83      * - skin(<major id> <minor id>):mif(<path> <bitmapid> <maskid>)
    84      * - skin(<major id> <minor id>):mif(<path> <bitmapid> <maskid>)
    84      * - mif(<path> <bitmapid> <maskid>)
    85      * - mif(<path> <bitmapid> <maskid>)
    85      * - uid(<application uid>)
    86      * - uid(<application uid>)
    86      * - <file name>.<png/svg>
    87      * - <file name>.<png/svg>
    87      */
    88      * 
    88     void HandleIconStringL( TInt aWidth, TInt aHeight, const TDesC& aIconStr );
    89      * @return Error code 
       
    90      */
       
    91     TInt HandleIconString( TInt aWidth, TInt aHeight, const TDesC& aIconStr );
    89 
    92 
    90     /**
    93     /**
    91      * Returns converted bitmap. Caller takes ownership
    94      * Returns converted bitmap. Caller takes ownership
    92      * 
    95      * 
    93      * @return CFbsBitmap
    96      * @return CFbsBitmap
   124      * This method can be used to check if correct conversion was used.
   127      * This method can be used to check if correct conversion was used.
   125      * @return conversion method used for current image
   128      * @return conversion method used for current image
   126      */
   129      */
   127     TConversionMethod ConversionMethod();
   130     TConversionMethod ConversionMethod();
   128 
   131 
       
   132     /**
       
   133      * Image convertion status
       
   134      * 
       
   135      * @return ETrue if processing image, false otherwise.
       
   136      */
       
   137     TBool IsProcessing();
       
   138 
   129 protected: // implementation of CActive
   139 protected: // implementation of CActive
   130     /**
   140     /**
   131      * Implements cancellation of an outstanding request.
   141      * Implements cancellation of an outstanding request.
   132      * 
   142      * 
   133      * @see CActive::DoCancel
   143      * @see CActive::DoCancel
   150         
   160         
   151 private:
   161 private:
   152     CWmImageConverter(); 
   162     CWmImageConverter(); 
   153     void ConstructL( MConverterObserver* aObserver );
   163     void ConstructL( MConverterObserver* aObserver );
   154     void CheckSvgErrorL( MSvgError* aError );
   164     void CheckSvgErrorL( MSvgError* aError );
   155     
   165     void HandleIconStringL( TInt aWidth, TInt aHeight, 
       
   166             const TDesC& aIconStr );
       
   167 
   156 private:
   168 private:
   157 
       
   158     void ScaleBitmap( TInt aWidth, TInt aHeight );
   169     void ScaleBitmap( TInt aWidth, TInt aHeight );
   159     void ScaleMask( TInt aWidth, TInt aHeight );
   170     void ScaleMask( TInt aWidth, TInt aHeight );
   160     void CreateIconFromUidL( const TUid& aUid );
   171     void CreateIconFromUidL( const TUid& aUid );
   161     void CreateIconFromSvgL( const TDesC& aFileName );
   172     void CreateIconFromSvgL( const TDesC& aFileName );
   162     void CreateIconFromOtherL( const TDesC& aFileName );
   173     void CreateIconFromOtherL( const TDesC& aFileName );
   170                         TInt& aMaskId, TDes& aFileName );
   181                         TInt& aMaskId, TDes& aFileName );
   171     TBool ResolveSkinIdAndMifId( const TDesC& aPath, TAknsItemID& aItemId,
   182     TBool ResolveSkinIdAndMifId( const TDesC& aPath, TAknsItemID& aItemId,
   172                         TInt& aBitmapId, TInt& aMaskId, TDes& aFileName );
   183                         TInt& aBitmapId, TInt& aMaskId, TDes& aFileName );
   173     TBool EndsWith( const TDesC& aString, const TDesC& aPattern );
   184     TBool EndsWith( const TDesC& aString, const TDesC& aPattern );
   174 
   185 
       
   186     // helpers
       
   187     TInt ParseNextUint( TLex& aLex, TUint& aValue );
       
   188     
   175 private: // from MAknIconFileProvider
   189 private: // from MAknIconFileProvider
   176 
   190 
   177     /** Returns an open file handle to the icon file. */
   191     /** Returns an open file handle to the icon file. */
   178 	void RetrieveIconFileHandleL( RFile& aFile, const TIconFileType aType );
   192 	void RetrieveIconFileHandleL( RFile& aFile, const TIconFileType aType );
   179     
   193