extras/about/src/AboutImage.cpp
branchRCL_3
changeset 21 a7d8840c0b8c
parent 0 3ee3dfdd8d69
equal deleted inserted replaced
19:99b535de1dda 21:a7d8840c0b8c
    18 
    18 
    19 // INCLUDE FILES
    19 // INCLUDE FILES
    20 #include <fbs.h>
    20 #include <fbs.h>
    21 #include "AboutImage.h"
    21 #include "AboutImage.h"
    22 #include <AknIconUtils.h>
    22 #include <AknIconUtils.h>
       
    23 #include <aknenv.h>
       
    24 #include <AknUtils.h>
       
    25 #include <aknconsts.h>
       
    26 #include <AknBidiTextUtils.h>
       
    27 #include <AknsDrawUtils.h> 
       
    28 #include <AknsBasicBackgroundControlContext.h>
       
    29 #include <AknsConstants.h>
       
    30 #include <AknDef.h>
       
    31 
       
    32 
       
    33 const TInt QtnJavaLogoWidth  = 46;
       
    34 const TInt QtnJavaLogoHeight = 70;
    23 
    35 
    24 // ================= MEMBER FUNCTIONS ==========================================
    36 // ================= MEMBER FUNCTIONS ==========================================
    25 
    37 
    26 CAboutImage::CAboutImage()
    38 CAboutImage::CAboutImage()
    27     {
    39     {
    28     }
    40     }
    29 
    41 
    30 CAboutImage::~CAboutImage()
    42 CAboutImage::~CAboutImage()
    31     {
    43     {
    32     delete iBitmap;
    44     delete iBitmap;
       
    45     delete iBitmapMask;
    33     }
    46     }
    34 
    47 
    35 CAboutImage* CAboutImage::NewLC( const TDesC& aFileName,
    48 CAboutImage* CAboutImage::NewLC( const TDesC& aFileName,
    36                                  TInt aBitmapId,
    49                                  TInt aBitmapId,
    37                                  TInt aStartLine,
    50                                  TInt aStartLine,
    38                                  TInt aBaseLineDelta )
    51                                  TInt aBaseLineDelta,
       
    52                                  TBool aTypeFlag )
    39     {
    53     {
    40     CAboutImage* self = new( ELeave ) CAboutImage();
    54     CAboutImage* self = new( ELeave ) CAboutImage();
    41     CleanupStack::PushL( self );
    55     CleanupStack::PushL( self );
    42 
    56 
    43     /*self->iBitmap = new( ELeave ) CFbsBitmap;
    57     if( aTypeFlag )
    44     self->iBitmap->Load( aFileName, aBitmapId );*/
    58     	{
    45 
    59     	// bmp files
    46 	self->iBitmap  = AknIconUtils::CreateIconL(aFileName, aBitmapId );
    60 	self->iBitmap  = AknIconUtils::CreateIconL(aFileName, aBitmapId );
       
    61     	}
       
    62     else
       
    63     	{
       
    64     	// svg files
       
    65     	MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
       
    66     	AknsUtils::CreateIconL( skinInstance, KAknsIIDQgnMenuSmsvoLst, self->iBitmap, self->iBitmapMask, 
       
    67 					aFileName, aBitmapId, aBitmapId + 1 );
       
    68     	AknIconUtils::SetSize( self->iBitmap, TSize( QtnJavaLogoWidth, QtnJavaLogoHeight ) );
       
    69     	AknIconUtils::SetSize( self->iBitmapMask, TSize( QtnJavaLogoWidth, QtnJavaLogoHeight ) );
       
    70     	}
    47     self->iStartLine = aStartLine;
    71     self->iStartLine = aStartLine;
    48 
    72 
    49     // enough lines so that image and margins fit in them.
    73     // enough lines so that image and margins fit in them.
    50 
    74 
    51     TInt lines( ( self->HeightInPixels() + 
    75     TInt lines( ( self->HeightInPixels() + 
   109 const CFbsBitmap* CAboutImage::Bitmap() const
   133 const CFbsBitmap* CAboutImage::Bitmap() const
   110     {
   134     {
   111     return iBitmap;
   135     return iBitmap;
   112     }
   136     }
   113 
   137 
       
   138 // -----------------------------------------------------------------------------
       
   139 // CAboutImage::BitmapMask()
       
   140 // -----------------------------------------------------------------------------
       
   141 
       
   142 const CFbsBitmap* CAboutImage::BitmapMask() const
       
   143 	{
       
   144 	return iBitmapMask;
       
   145 	}
   114 // End of File  
   146 // End of File