idlehomescreen/xmluirendering/renderingplugins/xnbitmapfactory/inc/xnimagedecoder.h
branchRCL_3
changeset 26 1b758917cafc
equal deleted inserted replaced
25:137ebc85284b 26:1b758917cafc
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Image decoder
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _XNIMAGEDECODER_H
       
    20 #define _XNIMAGEDECODER_H
       
    21 
       
    22 // System includes
       
    23 #include <e32base.h>
       
    24 
       
    25 // User includes
       
    26 class CXnBitmapAdapter;
       
    27 class CFbsBitmap;
       
    28 class CImageDecoder;
       
    29 class RFs;
       
    30 
       
    31 // Forward declarations
       
    32 
       
    33 /**
       
    34  * Image decoder
       
    35  * 
       
    36  * @ingroup group_xnbitmapfactory
       
    37  * @lib xn3bitmapfactory.lib
       
    38  * @since S60 5.2
       
    39  */
       
    40 NONSHARABLE_CLASS( CXnImageDecoder ) : public CActive
       
    41     {
       
    42 public:    
       
    43     // Constructors and destructor
       
    44     
       
    45     /**
       
    46      * Two-phased constructor.
       
    47      */
       
    48     static CXnImageDecoder* NewL( CXnBitmapAdapter& aAdapter, RFs& aFs );        
       
    49 
       
    50     /**
       
    51      * Two-phased constructor. Leaving on stack
       
    52      */
       
    53     static CXnImageDecoder* NewLC( CXnBitmapAdapter& aAdapter, RFs& aFs );         
       
    54 
       
    55     /**
       
    56      * Destructor
       
    57      */
       
    58     ~CXnImageDecoder();
       
    59 
       
    60 private:
       
    61     // private constructors
       
    62 
       
    63     /**
       
    64      * Leaving constructor
       
    65      */
       
    66     void ConstructL();
       
    67     
       
    68     /**
       
    69      * C++ default constructor
       
    70      */
       
    71     CXnImageDecoder( CXnBitmapAdapter& aAdapter, RFs& aFs );         
       
    72         
       
    73 private:
       
    74     // from CActive
       
    75     
       
    76     /**
       
    77      * @see CActive
       
    78      */
       
    79     void RunL();
       
    80 
       
    81     /**
       
    82      * @see CActive
       
    83      */    
       
    84     TInt RunError( TInt aError );
       
    85     
       
    86     /**
       
    87      * @see CActive
       
    88      */    
       
    89     void DoCancel();
       
    90     
       
    91 public: 
       
    92     // new functions
       
    93     
       
    94     /**
       
    95      * Starts decode.
       
    96      * 
       
    97      * @param aFile Image file
       
    98      */
       
    99     void DecodeL( TFileName& aFilename );
       
   100             
       
   101 private:
       
   102     // new functions
       
   103     
       
   104     void Cleanup();
       
   105     
       
   106 private:
       
   107     // data
       
   108 
       
   109     /** Bitmapadapter, not owned */
       
   110     CXnBitmapAdapter& iAdapter; 
       
   111     /** File server session, not owned */
       
   112     RFs& iFs;
       
   113     /** Image decoder, owned */
       
   114     CImageDecoder* iDecoder;
       
   115     /** Bitmap, owned during conversion */
       
   116     CFbsBitmap* iBitmap;
       
   117     /** Mask, owned during conversion */
       
   118     CFbsBitmap* iMask;    
       
   119     };
       
   120 
       
   121 #endif // _XNIMAGEDECODER_H
       
   122 
       
   123 // End of file