internetradio2.0/uicontrolsinc/irstationlogodata.h
changeset 14 896e9dbc5f19
parent 12 608f67c22514
child 15 065198191975
equal deleted inserted replaced
12:608f67c22514 14:896e9dbc5f19
     1 /*
       
     2 * Copyright (c) 2008-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:  Data for single station logo
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CIRSTATIONLOGODATA_H
       
    20 #define C_CIRSTATIONLOGODATA_H
       
    21 
       
    22 #include <alf/alfbitmapprovider.h>
       
    23 #include <alf/alfeventhandler.h>
       
    24 #include <e32base.h>
       
    25 
       
    26 class CAlfTexture;
       
    27 class CFbsBitmap;
       
    28 class CIRImageConverter;
       
    29 
       
    30 /**
       
    31  * Station Logo Data
       
    32  *
       
    33  * @since   S60 v3.2
       
    34  */
       
    35 class CIRStationLogoData : public CBase, 
       
    36                            public MAlfBitmapProvider,
       
    37                            public MAlfEventHandler
       
    38     {
       
    39 public:
       
    40 
       
    41     /**
       
    42      * Logo related custom events
       
    43      */
       
    44     enum TIRLogoCustomEvents
       
    45         {
       
    46         EIRCustomEventLogoFadeOutComplete
       
    47         };
       
    48     
       
    49     /**
       
    50      * Two-phased constructor.
       
    51      * Adds the control to the control group and to layout hierarchy
       
    52      *
       
    53      * @param aId The IID for this logo
       
    54      * @param aRawData The graphics raw data for this logo
       
    55      */
       
    56     static CIRStationLogoData* NewLC( TInt aId, const TDesC8& aRawData );
       
    57 
       
    58     /**
       
    59      * Destructor.
       
    60      */
       
    61     ~CIRStationLogoData();
       
    62 
       
    63     /**
       
    64      * Sets the raw data for the graphics
       
    65      * 
       
    66      * @param aRawData reference to raw data
       
    67      */
       
    68     void SetRawData( const TDesC8& aRawData );
       
    69 
       
    70     /**
       
    71      * Provides the raw data for the graphics
       
    72      * 
       
    73      * @return reference to raw data
       
    74      */
       
    75     const TDesC8& RawData() const;
       
    76     
       
    77     /**
       
    78      * Updates the texture according to the bitmaps provided. 
       
    79      * Ownership of the bitmaps is transfered always, even if this method leaves.
       
    80      * So the bitmap an mask must not be in cleanup stack
       
    81      * 
       
    82      * @param aBitmap The bitmap to be used
       
    83      * @param aMask The mask to be used
       
    84      */
       
    85     void UpdateTextureL( CFbsBitmap* aBitmap, CFbsBitmap* aMask );
       
    86 
       
    87     /**
       
    88      * Destroys the texture and possible bitmaps
       
    89      */
       
    90     void DestroyTexture();
       
    91 
       
    92     /**
       
    93      * Sets the visual for this logo data.
       
    94      * 
       
    95      * @param aVisual The visual to be set. Transfers ownership
       
    96      */
       
    97     void SetVisual( CAlfImageVisual* aVisual );
       
    98 
       
    99     /**
       
   100      * Provides the image visual for this logo
       
   101      * 
       
   102      * @return Pointer to CAlfImageVisual, or NULL
       
   103      */
       
   104     CAlfImageVisual* Visual();
       
   105 
       
   106     /**
       
   107      * Destroys the visual for the logo
       
   108      */
       
   109     void DestroyVisual();
       
   110 
       
   111     /**
       
   112      * Provides the texture for this logo
       
   113      * 
       
   114      * @return The reference to texture
       
   115      */
       
   116     CAlfTexture* Texture();
       
   117 
       
   118     /**
       
   119      * Provides the ID for this logo
       
   120      * 
       
   121      * @return The ID
       
   122      */
       
   123     TInt Id() const ;
       
   124 
       
   125     // from MAlfBitmapProvider
       
   126     void ProvideBitmapL(TInt aId, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap);
       
   127 
       
   128     // from MAlfEventHandler
       
   129     TBool OfferEventL( const TAlfEvent& aEvent );
       
   130 
       
   131 private: // Methods
       
   132 
       
   133     /**
       
   134      * Default constructor
       
   135      *
       
   136      * @param aId The IID for this logo
       
   137      * @param aRawData The graphics raw data for this logo
       
   138      */
       
   139     CIRStationLogoData( TInt aId, const TDesC8& aRawData );
       
   140 
       
   141     /**
       
   142      * Second phase constructor
       
   143      */
       
   144     void ConstructL();
       
   145 
       
   146 private: // Members
       
   147 
       
   148     /**
       
   149      * The logo as a bitmap.
       
   150      * Owned.
       
   151      */
       
   152     CFbsBitmap* iBitmap;
       
   153 
       
   154     /**
       
   155      * The logo bitmap mask.
       
   156      * Owned.
       
   157      */
       
   158     CFbsBitmap* iMask;
       
   159 
       
   160     /**
       
   161      * The logo represented as a texture.
       
   162      * Owned.
       
   163      */
       
   164     CAlfTexture* iTexture;
       
   165 
       
   166     /**
       
   167      * The visual for the logo
       
   168      * Owned.
       
   169      */
       
   170     CAlfImageVisual* iVisual;
       
   171 
       
   172     /**
       
   173      * The raw data of graphics.
       
   174      */
       
   175     TPtrC8 iData;
       
   176     
       
   177     /**
       
   178      * The ID that is used to identify the logo
       
   179      */
       
   180     TInt iId;
       
   181     
       
   182     /**
       
   183      * The texture ID provided by the texture manager
       
   184      */
       
   185     TInt iTextureId;
       
   186     };
       
   187 
       
   188 #endif // C_CIRSTATIONLOGODATA_H