brandingserver/BSClient/cbsbitmap.cpp
changeset 31 9dbc70490d9a
equal deleted inserted replaced
30:1fa9b890f29c 31:9dbc70490d9a
       
     1 /*
       
     2 * Copyright (c) 2006-2006 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:  cbsbitmap.cpp
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 //  INCLUDE FILES
       
    21 
       
    22 #include "e32base.h"
       
    23 #include "cbsbitmap.h"
       
    24 
       
    25 // -----------------------------------------------------------------------------
       
    26 // CBSBitmap::NewLC
       
    27 // Two-phased constructor.
       
    28 // -----------------------------------------------------------------------------
       
    29 //
       
    30 EXPORT_C CBSBitmap* CBSBitmap::NewLC( TInt aBitmapId,
       
    31 							TInt aBitmapMaskId,
       
    32 							TInt aSkinId,
       
    33 							TInt aSkinMaskId,
       
    34 							const TDesC8& aBitmapFileId )
       
    35     {
       
    36 	CBSBitmap* self = new ( ELeave ) CBSBitmap( aBitmapId, aBitmapMaskId,
       
    37 												aSkinId, aSkinMaskId );
       
    38     CleanupStack::PushL( self );
       
    39     self->ConstructL( aBitmapFileId );
       
    40     return self;
       
    41     }
       
    42 
       
    43 // -----------------------------------------------------------------------------
       
    44 // CBSBitmap::NewL
       
    45 // Two-phased constructor.
       
    46 // -----------------------------------------------------------------------------
       
    47 //
       
    48 EXPORT_C CBSBitmap* CBSBitmap::NewL( TInt aBitmapId,
       
    49 							TInt aBitmapMaskId,
       
    50 							TInt aSkinIdMajor,
       
    51 							TInt aSkinIdMinor,
       
    52 							const TDesC8& aBitmapFileId )
       
    53     {
       
    54     CBSBitmap* self = NewLC( aBitmapId,
       
    55     						 aBitmapMaskId,
       
    56     						 aSkinIdMajor,
       
    57     						 aSkinIdMinor,
       
    58     						 aBitmapFileId );
       
    59     CleanupStack::Pop();
       
    60     return self;
       
    61     }
       
    62 
       
    63 
       
    64 // Symbian OS default constructor can leave.
       
    65 void CBSBitmap::ConstructL( const TDesC8& aBitmapFileId )
       
    66     {
       
    67 	iBitmapFileId = aBitmapFileId.AllocL();
       
    68     }
       
    69 
       
    70 // destructor
       
    71 CBSBitmap::~CBSBitmap()
       
    72     {
       
    73 	delete iBitmapFileId;
       
    74     }
       
    75 
       
    76 // C++ default constructor can NOT contain any code, that
       
    77 // might leave.
       
    78 //
       
    79 CBSBitmap::CBSBitmap( TInt aBitmapId,
       
    80 					  TInt aBitmapMaskId,
       
    81 					  TInt aSkinIdMajor,
       
    82 					  TInt aSkinIdMinor )
       
    83 : iBitmapId( aBitmapId), iBitmapMaskId( aBitmapMaskId ),
       
    84   iSkinIdMajor( aSkinIdMajor ), iSkinIdMinor( aSkinIdMinor )
       
    85 	{
       
    86 	}
       
    87 
       
    88 
       
    89 // -----------------------------------------------------------------------------
       
    90 // CBSBitmap::BitmapId()
       
    91 // -----------------------------------------------------------------------------
       
    92 //
       
    93 EXPORT_C TInt CBSBitmap::BitmapId() const
       
    94 	{
       
    95 	return iBitmapId;
       
    96 	}
       
    97 
       
    98 // -----------------------------------------------------------------------------
       
    99 // CBSBitmap::BitmapMaskId()
       
   100 // -----------------------------------------------------------------------------
       
   101 //
       
   102 EXPORT_C TInt CBSBitmap::BitmapMaskId() const
       
   103 	{
       
   104 	return iBitmapMaskId;
       
   105 	}
       
   106 
       
   107 // -----------------------------------------------------------------------------
       
   108 // CBSBitmap::SkinId()
       
   109 // -----------------------------------------------------------------------------
       
   110 //
       
   111 EXPORT_C TInt CBSBitmap::SkinIdMajor() const
       
   112 	{
       
   113 	return iSkinIdMajor;
       
   114 	}
       
   115 
       
   116 // -----------------------------------------------------------------------------
       
   117 // CBSBitmap::SkinMaskId()
       
   118 // -----------------------------------------------------------------------------
       
   119 //
       
   120 EXPORT_C TInt CBSBitmap::SkinIdMinor() const
       
   121 	{
       
   122 	return iSkinIdMinor;
       
   123 	}
       
   124 
       
   125 // -----------------------------------------------------------------------------
       
   126 // CBSBitmap::BitmapFileId()
       
   127 // -----------------------------------------------------------------------------
       
   128 //
       
   129 EXPORT_C const TDesC8& CBSBitmap::BitmapFileId() const
       
   130 	{
       
   131 	return *iBitmapFileId;
       
   132 	}
       
   133 
       
   134 
       
   135 
       
   136 //  END OF FILE