|
1 /* |
|
2 * Copyright (c) 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: Definition of entry attribute |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include <s32mem.h> |
|
20 #include "cainnericondescription.h" |
|
21 |
|
22 // ================= MEMBER FUNCTIONS ======================= |
|
23 |
|
24 // --------------------------------------------------------- |
|
25 // CCaInnerIconDescription::~CCaInnerIconDescription |
|
26 // --------------------------------------------------------- |
|
27 // |
|
28 CCaInnerIconDescription::~CCaInnerIconDescription() |
|
29 { |
|
30 iFileName.Close(); |
|
31 iSkinId.Close(); |
|
32 iApplicationId.Close(); |
|
33 } |
|
34 |
|
35 // --------------------------------------------------------- |
|
36 // CCaInnerIconDescription::NewL |
|
37 // --------------------------------------------------------- |
|
38 // |
|
39 EXPORT_C CCaInnerIconDescription* CCaInnerIconDescription::NewL() |
|
40 { |
|
41 CCaInnerIconDescription* self = NewLC(); |
|
42 CleanupStack::Pop( self ); |
|
43 return self; |
|
44 } |
|
45 |
|
46 // --------------------------------------------------------- |
|
47 // CCaInnerIconDescription::NewLC |
|
48 // --------------------------------------------------------- |
|
49 // |
|
50 EXPORT_C CCaInnerIconDescription* CCaInnerIconDescription::NewLC() |
|
51 { |
|
52 CCaInnerIconDescription* self = new ( ELeave ) CCaInnerIconDescription(); |
|
53 CleanupStack::PushL( self ); |
|
54 self->ConstructL(); |
|
55 return self; |
|
56 } |
|
57 |
|
58 // --------------------------------------------------------- |
|
59 // CCaInnerIconDescription::ConstructL |
|
60 // --------------------------------------------------------- |
|
61 // |
|
62 void CCaInnerIconDescription::ConstructL() |
|
63 { |
|
64 } |
|
65 |
|
66 // --------------------------------------------------------- |
|
67 // CCaInnerIconDescription::CCaInnerIconDescription |
|
68 // --------------------------------------------------------- |
|
69 // |
|
70 CCaInnerIconDescription::CCaInnerIconDescription() |
|
71 { |
|
72 } |
|
73 |
|
74 // --------------------------------------------------------- |
|
75 // CCaInnerIconDescription::SetId |
|
76 // --------------------------------------------------------- |
|
77 // |
|
78 EXPORT_C void CCaInnerIconDescription::SetId( const TInt aId ) |
|
79 { |
|
80 iId = aId; |
|
81 } |
|
82 |
|
83 // --------------------------------------------------------- |
|
84 // CCaInnerIconDescription::SetFileNameL |
|
85 // --------------------------------------------------------- |
|
86 // |
|
87 EXPORT_C void CCaInnerIconDescription::SetFileNameL( const TDesC& aFileName ) |
|
88 { |
|
89 if( iFileName.Length() > 0 ) |
|
90 { |
|
91 iFileName.Close(); |
|
92 } |
|
93 iFileName.CreateL( aFileName ); |
|
94 } |
|
95 |
|
96 // --------------------------------------------------------- |
|
97 // CCaInnerIconDescription::SetSkinIdL |
|
98 // --------------------------------------------------------- |
|
99 // |
|
100 EXPORT_C void CCaInnerIconDescription::SetSkinIdL( const TDesC& aSkinId ) |
|
101 { |
|
102 if( iSkinId.Length() > 0 ) |
|
103 { |
|
104 iSkinId.Close(); |
|
105 } |
|
106 iSkinId.CreateL( aSkinId ); |
|
107 } |
|
108 |
|
109 // --------------------------------------------------------- |
|
110 // CCaInnerIconDescription::SetApplicationIdL |
|
111 // --------------------------------------------------------- |
|
112 // |
|
113 EXPORT_C void CCaInnerIconDescription::SetApplicationIdL( const TDesC& aApplicationId ) |
|
114 { |
|
115 if( iApplicationId.Length() > 0 ) |
|
116 { |
|
117 iApplicationId.Close(); |
|
118 } |
|
119 iApplicationId.CreateL( aApplicationId ); |
|
120 } |
|
121 |
|
122 // --------------------------------------------------------------------------- |
|
123 // CCaInnerIconDescription::ExternalizeL |
|
124 // --------------------------------------------------------------------------- |
|
125 // |
|
126 void CCaInnerIconDescription::ExternalizeL( RWriteStream& aStream ) const |
|
127 { |
|
128 aStream.WriteInt32L( iId ); |
|
129 aStream.WriteUint32L( iFileName.Length() ); |
|
130 aStream.WriteL( iFileName, iFileName.Length() ); |
|
131 aStream.WriteUint32L( iSkinId.Length() ); |
|
132 aStream.WriteL( iSkinId, iSkinId.Length() ); |
|
133 aStream.WriteUint32L( iApplicationId.Length() ); |
|
134 aStream.WriteL( iApplicationId, iApplicationId.Length() ); |
|
135 aStream.CommitL(); |
|
136 } |
|
137 |
|
138 // --------------------------------------------------------------------------- |
|
139 // CCaInnerIconDescription::InternalizeL |
|
140 // --------------------------------------------------------------------------- |
|
141 // |
|
142 void CCaInnerIconDescription::InternalizeL( RReadStream& aStream ) |
|
143 { |
|
144 iId = aStream.ReadInt32L(); |
|
145 |
|
146 TUint length = aStream.ReadUint32L(); |
|
147 iFileName.Close(); |
|
148 iFileName.CreateL( length ); |
|
149 aStream.ReadL( iFileName, length ); |
|
150 |
|
151 length = aStream.ReadUint32L(); |
|
152 iSkinId.Close(); |
|
153 iSkinId.CreateL( length ); |
|
154 aStream.ReadL( iSkinId, length ); |
|
155 |
|
156 length = aStream.ReadUint32L(); |
|
157 iApplicationId.Close(); |
|
158 iApplicationId.CreateL( length ); |
|
159 aStream.ReadL( iApplicationId, length ); |
|
160 } |
|
161 |
|
162 // End of File |