videofeeds/livetvutils/inc/CIptvLiveUIImageHandler.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2005 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 the License "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 conversion from file to CFbsBitmap in memory*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CIPTV_LIVE_UI_IMAGEHANDLER_H__
       
    21 #define __CIPTV_LIVE_UI_IMAGEHANDLER_H__
       
    22 
       
    23 // INCLUDES
       
    24 #include <AknsItemID.h>
       
    25 // FORWARD DECLARATIONS
       
    26 class CImageDecoder;
       
    27 class MIptvLiveUIImageObserver;
       
    28 class CAknIconArray;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 /**
       
    32 * Live TV Image handler offers interface to convert images from file 
       
    33 * (in JPEG or some other format) to Symbian in-memory representation 
       
    34 * (CFbsBitmap class).
       
    35 *
       
    36 *  @since
       
    37 */
       
    38 class CIptvLiveUIImageHandler : public CActive
       
    39     {
       
    40             
       
    41     public:  // Constructors and destructor
       
    42         
       
    43         /**
       
    44         * Two-phased constructor.
       
    45         */
       
    46         IMPORT_C static CIptvLiveUIImageHandler* NewL( MIptvLiveUIImageObserver& aObserver );
       
    47         
       
    48         /**
       
    49         * Destructor.
       
    50         */
       
    51         IMPORT_C virtual ~CIptvLiveUIImageHandler();
       
    52 
       
    53     public: // New functions
       
    54         
       
    55         /**
       
    56 		* Starts converting image from file into in-memory CFbsBitmap. 
       
    57 		* The observer is notified with MIptvLiveUIImageObserver::ImageReadyL()
       
    58 		* when the conversion is complete.
       
    59 		* @param aFilePath Image file path.
       
    60 		* @return None.
       
    61 		*/
       
    62 		IMPORT_C void LoadImageL( const TDesC& aFilePath );
       
    63 
       
    64 		
       
    65 		
       
    66         /**
       
    67 		* Loads the constant icons (record, remind, rights_forbid etc.)
       
    68 		* @param aIcons, icon array that the icon will be appended to.
       
    69 		* @param aIconIndex, index of the icon
       
    70 		* @param aMaskIndex, index of the icon mask
       
    71 		* @param aIconSize Icon size.
       
    72 		* @param aMifFileName MIF file name.
       
    73 		* @param aInsert if ETrue insert in to beginning of array, if EFalse
       
    74 		* append to the end of array.
       
    75 		* @since 3.0
       
    76 		*/		
       
    77 		IMPORT_C static void LoadIconL( CAknIconArray* aIcons, const TInt aIconIndex, 
       
    78                                const TInt aMaskIndex, const TSize& aIconSize,
       
    79                                const TDesC& aMifFileName, TBool aInsert );		
       
    80 		
       
    81         /**
       
    82 		* Loads the constant color-customized icons (record, remind, rights_forbid etc.)
       
    83 		* @param aIcons, icon array that the icon will be appended to.
       
    84 		* @param aItemId, item ID of the masked bitmap to be created
       
    85 		* @param aIconIndex, index of the icon
       
    86 		* @param aMaskIndex, index of the icon mask
       
    87 		* @param aIconSize Icon size.
       
    88 		* @param aMifFileName MIF file name.
       
    89 		* @param aInsert if ETrue insert in to beginning of array, if EFalse
       
    90 		* append to the end of array.
       
    91 		* @since 5.0
       
    92 		*/		
       
    93 		IMPORT_C static void LoadIconL( CAknIconArray* aIcons, const TAknsItemID aItemId,
       
    94 		                        const TInt aIconIndex, const TInt aMaskIndex, const TSize& aIconSize,
       
    95                                 const TDesC& aMifFileName, TBool aInsert );		
       
    96 
       
    97     protected: // From CActive
       
    98 
       
    99         /**
       
   100         * From CActive.
       
   101 		* Handles an active object’s request completion event.
       
   102         */
       
   103         void RunL();
       
   104 
       
   105         /**
       
   106         * From CActive.
       
   107 		* Implements cancellation of an outstanding request.
       
   108         * This function is called as part of the active object’s Cancel().
       
   109         */
       
   110         void DoCancel();
       
   111         
       
   112         /**
       
   113         * From CActive.
       
   114 		* Handles a leave occurring in the request completion 
       
   115         * event handler RunL().
       
   116         */
       
   117         TInt RunError( TInt aError );
       
   118 
       
   119     private: // Constructors
       
   120 
       
   121         /**
       
   122         * C++ default constructor.
       
   123         */
       
   124         CIptvLiveUIImageHandler( MIptvLiveUIImageObserver& aObserver );
       
   125 
       
   126         /**
       
   127         * By default Symbian 2nd phase constructor is private.
       
   128         */
       
   129         void ConstructL();
       
   130 
       
   131 	private: // Private methods
       
   132 		
       
   133 		/**
       
   134 		* Resets iBitmap to empty bitmap.
       
   135 		*/
       
   136 		void ResetBitmap();
       
   137 
       
   138         
       
   139     private: // Data
       
   140 
       
   141 		/**
       
   142 		* Live TV Client observer.
       
   143 		*/
       
   144 		MIptvLiveUIImageObserver* iObserver;
       
   145 		
       
   146 		/**
       
   147 		* File server session.
       
   148 		*/
       
   149 		RFs iFs;
       
   150 
       
   151 		/**
       
   152 		* Image decoder.
       
   153 		*/
       
   154 		CImageDecoder* iImageDecoder;
       
   155 		
       
   156 		/**
       
   157 		* Image bitmap.
       
   158 		*/
       
   159 		CFbsBitmap* iBitmap;
       
   160         
       
   161     };
       
   162 
       
   163 #endif      // __CIPTV_LIVE_UI_IMAGEHANDLER_H__
       
   164 // End of File