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