brandingserver/BSClient/cbsbitmap.cpp
author hgs
Sat, 01 May 2010 17:56:09 +0530
changeset 33 bb46c9d56bcb
parent 31 9dbc70490d9a
permissions -rw-r--r--
201017
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  cbsbitmap.cpp
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
hgs
parents:
diff changeset
    20
//  INCLUDE FILES
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
#include "e32base.h"
hgs
parents:
diff changeset
    23
#include "cbsbitmap.h"
hgs
parents:
diff changeset
    24
hgs
parents:
diff changeset
    25
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    26
// CBSBitmap::NewLC
hgs
parents:
diff changeset
    27
// Two-phased constructor.
hgs
parents:
diff changeset
    28
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    29
//
hgs
parents:
diff changeset
    30
EXPORT_C CBSBitmap* CBSBitmap::NewLC( TInt aBitmapId,
hgs
parents:
diff changeset
    31
							TInt aBitmapMaskId,
hgs
parents:
diff changeset
    32
							TInt aSkinId,
hgs
parents:
diff changeset
    33
							TInt aSkinMaskId,
hgs
parents:
diff changeset
    34
							const TDesC8& aBitmapFileId )
hgs
parents:
diff changeset
    35
    {
hgs
parents:
diff changeset
    36
	CBSBitmap* self = new ( ELeave ) CBSBitmap( aBitmapId, aBitmapMaskId,
hgs
parents:
diff changeset
    37
												aSkinId, aSkinMaskId );
hgs
parents:
diff changeset
    38
    CleanupStack::PushL( self );
hgs
parents:
diff changeset
    39
    self->ConstructL( aBitmapFileId );
hgs
parents:
diff changeset
    40
    return self;
hgs
parents:
diff changeset
    41
    }
hgs
parents:
diff changeset
    42
hgs
parents:
diff changeset
    43
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    44
// CBSBitmap::NewL
hgs
parents:
diff changeset
    45
// Two-phased constructor.
hgs
parents:
diff changeset
    46
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    47
//
hgs
parents:
diff changeset
    48
EXPORT_C CBSBitmap* CBSBitmap::NewL( TInt aBitmapId,
hgs
parents:
diff changeset
    49
							TInt aBitmapMaskId,
hgs
parents:
diff changeset
    50
							TInt aSkinIdMajor,
hgs
parents:
diff changeset
    51
							TInt aSkinIdMinor,
hgs
parents:
diff changeset
    52
							const TDesC8& aBitmapFileId )
hgs
parents:
diff changeset
    53
    {
hgs
parents:
diff changeset
    54
    CBSBitmap* self = NewLC( aBitmapId,
hgs
parents:
diff changeset
    55
    						 aBitmapMaskId,
hgs
parents:
diff changeset
    56
    						 aSkinIdMajor,
hgs
parents:
diff changeset
    57
    						 aSkinIdMinor,
hgs
parents:
diff changeset
    58
    						 aBitmapFileId );
hgs
parents:
diff changeset
    59
    CleanupStack::Pop();
hgs
parents:
diff changeset
    60
    return self;
hgs
parents:
diff changeset
    61
    }
hgs
parents:
diff changeset
    62
hgs
parents:
diff changeset
    63
hgs
parents:
diff changeset
    64
// Symbian OS default constructor can leave.
hgs
parents:
diff changeset
    65
void CBSBitmap::ConstructL( const TDesC8& aBitmapFileId )
hgs
parents:
diff changeset
    66
    {
hgs
parents:
diff changeset
    67
	iBitmapFileId = aBitmapFileId.AllocL();
hgs
parents:
diff changeset
    68
    }
hgs
parents:
diff changeset
    69
hgs
parents:
diff changeset
    70
// destructor
hgs
parents:
diff changeset
    71
CBSBitmap::~CBSBitmap()
hgs
parents:
diff changeset
    72
    {
hgs
parents:
diff changeset
    73
	delete iBitmapFileId;
hgs
parents:
diff changeset
    74
    }
hgs
parents:
diff changeset
    75
hgs
parents:
diff changeset
    76
// C++ default constructor can NOT contain any code, that
hgs
parents:
diff changeset
    77
// might leave.
hgs
parents:
diff changeset
    78
//
hgs
parents:
diff changeset
    79
CBSBitmap::CBSBitmap( TInt aBitmapId,
hgs
parents:
diff changeset
    80
					  TInt aBitmapMaskId,
hgs
parents:
diff changeset
    81
					  TInt aSkinIdMajor,
hgs
parents:
diff changeset
    82
					  TInt aSkinIdMinor )
hgs
parents:
diff changeset
    83
: iBitmapId( aBitmapId), iBitmapMaskId( aBitmapMaskId ),
hgs
parents:
diff changeset
    84
  iSkinIdMajor( aSkinIdMajor ), iSkinIdMinor( aSkinIdMinor )
hgs
parents:
diff changeset
    85
	{
hgs
parents:
diff changeset
    86
	}
hgs
parents:
diff changeset
    87
hgs
parents:
diff changeset
    88
hgs
parents:
diff changeset
    89
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    90
// CBSBitmap::BitmapId()
hgs
parents:
diff changeset
    91
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    92
//
hgs
parents:
diff changeset
    93
EXPORT_C TInt CBSBitmap::BitmapId() const
hgs
parents:
diff changeset
    94
	{
hgs
parents:
diff changeset
    95
	return iBitmapId;
hgs
parents:
diff changeset
    96
	}
hgs
parents:
diff changeset
    97
hgs
parents:
diff changeset
    98
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    99
// CBSBitmap::BitmapMaskId()
hgs
parents:
diff changeset
   100
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   101
//
hgs
parents:
diff changeset
   102
EXPORT_C TInt CBSBitmap::BitmapMaskId() const
hgs
parents:
diff changeset
   103
	{
hgs
parents:
diff changeset
   104
	return iBitmapMaskId;
hgs
parents:
diff changeset
   105
	}
hgs
parents:
diff changeset
   106
hgs
parents:
diff changeset
   107
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   108
// CBSBitmap::SkinId()
hgs
parents:
diff changeset
   109
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   110
//
hgs
parents:
diff changeset
   111
EXPORT_C TInt CBSBitmap::SkinIdMajor() const
hgs
parents:
diff changeset
   112
	{
hgs
parents:
diff changeset
   113
	return iSkinIdMajor;
hgs
parents:
diff changeset
   114
	}
hgs
parents:
diff changeset
   115
hgs
parents:
diff changeset
   116
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   117
// CBSBitmap::SkinMaskId()
hgs
parents:
diff changeset
   118
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   119
//
hgs
parents:
diff changeset
   120
EXPORT_C TInt CBSBitmap::SkinIdMinor() const
hgs
parents:
diff changeset
   121
	{
hgs
parents:
diff changeset
   122
	return iSkinIdMinor;
hgs
parents:
diff changeset
   123
	}
hgs
parents:
diff changeset
   124
hgs
parents:
diff changeset
   125
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   126
// CBSBitmap::BitmapFileId()
hgs
parents:
diff changeset
   127
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   128
//
hgs
parents:
diff changeset
   129
EXPORT_C const TDesC8& CBSBitmap::BitmapFileId() const
hgs
parents:
diff changeset
   130
	{
hgs
parents:
diff changeset
   131
	return *iBitmapFileId;
hgs
parents:
diff changeset
   132
	}
hgs
parents:
diff changeset
   133
hgs
parents:
diff changeset
   134
hgs
parents:
diff changeset
   135
hgs
parents:
diff changeset
   136
//  END OF FILE