uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsimagedecoder.h
changeset 0 5e5d6b214f4f
child 3 3aab497fdbb7
equal deleted inserted replaced
-1:000000000000 0:5e5d6b214f4f
       
     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:  Utility class for asynchronously decoding the header thumbnail image
       
    15  *
       
    16 */
       
    17 
       
    18  
       
    19 #ifndef CVIMPSTDETAILSIMAGEDECODER_H_
       
    20 #define CVIMPSTDETAILSIMAGEDECODER_H_
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <f32file.h>
       
    24 
       
    25 class CVIMPSTDetailsHeaderControl;
       
    26 class CImageDecoder;
       
    27 class CFbsBitmap;
       
    28 
       
    29 /**
       
    30  * Utility class for asynchronously decoding the header thumbnail image
       
    31  *
       
    32  *  @lib vimpstdetailsviewplugin.dll
       
    33  *  @since S60 v5.0
       
    34  */
       
    35 class CVIMPSTDetailsImageDecoder : public CActive
       
    36     {
       
    37 public:
       
    38     /**
       
    39      * Two-phased constructor
       
    40      * 
       
    41      * @param aHeader The header control to which the bitmap is to be inserted after loading
       
    42      * @param aBitmapData Descriptor containing the bitmap data stream
       
    43      * @return a instance of same class
       
    44      * @since S60 v5.0 
       
    45      */
       
    46     static CVIMPSTDetailsImageDecoder* NewL(CVIMPSTDetailsHeaderControl& aHeader, const TDesC8& aBitmapData);
       
    47     
       
    48     /**
       
    49      * Destructor
       
    50 	 * @since S60 v5.0 
       
    51      */
       
    52     ~CVIMPSTDetailsImageDecoder();
       
    53     
       
    54     /**
       
    55      * Starts the decoding process
       
    56      * @since S60 v5.0 
       
    57      *
       
    58      */
       
    59     void Start();
       
    60     
       
    61     /**
       
    62      * From CActive
       
    63      * (see details from baseclass )
       
    64      * @since S60 v5.0 
       
    65      */
       
    66     void RunL();
       
    67     
       
    68     /**
       
    69      * From CActive
       
    70      * (see details from baseclass )
       
    71      * @since S60 v5.0 
       
    72      */
       
    73     void DoCancel();
       
    74 private:
       
    75     /**
       
    76      * First-phase (C++) constructor
       
    77      * @param aHeader The header control to which the bitmap is to be inserted after loading
       
    78      * @since S60 v5.0  
       
    79      */
       
    80     CVIMPSTDetailsImageDecoder(CVIMPSTDetailsHeaderControl& aHeader);
       
    81     
       
    82     /**
       
    83      * Second phase constructor
       
    84      * @since S60 v5.0 
       
    85      * @param aBitmapData Descriptor containing the bitmap data stream
       
    86      */
       
    87     void ConstructL(const TDesC8& aBitmapData);
       
    88   
       
    89  private : // data  
       
    90     
       
    91   
       
    92     /**
       
    93      * Not Owns : The header control to which the bitmap is to be inserted after loading
       
    94      */
       
    95     CVIMPSTDetailsHeaderControl& iHeader;
       
    96 
       
    97 
       
    98     /**
       
    99      * Owns : The image decoder whose service is called to decode the image
       
   100      */
       
   101     CImageDecoder* iImgDecoder;
       
   102       
       
   103     /**
       
   104      * Owns : Handle to the file server session for loading the bitmap
       
   105      */ 
       
   106     RFs iFs;
       
   107     
       
   108     /**
       
   109      * The bitmap.
       
   110      * Owned until decoding is complete, then ownersip is transferred to header control.
       
   111      */
       
   112     CFbsBitmap* iBitmap; // owned until completion
       
   113     
       
   114     /**
       
   115      * Owns : Copy of the bitmap data stream
       
   116      */
       
   117     HBufC8* iBitmapData;
       
   118     };
       
   119 
       
   120 #endif /*CVIMPSTDETAILSIMAGEDECODER_H_*/