|
1 /* |
|
2 * Copyright (c) 2006-2007 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: Capsulating resolution propety items |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32std.h> |
|
25 #include <s32mem.h> |
|
26 #include "cmsqlresolutionpropertyitem.h" |
|
27 #include "msdebug.h" |
|
28 |
|
29 // ======== LOCAL FUNCTIONS ======== |
|
30 // --------------------------------------------------------------------------- |
|
31 // NewL |
|
32 // --------------------------------------------------------------------------- |
|
33 // |
|
34 EXPORT_C CCmSqlResolutionPropertyItem* CCmSqlResolutionPropertyItem::NewL() |
|
35 { |
|
36 CCmSqlResolutionPropertyItem* self = |
|
37 CCmSqlResolutionPropertyItem::NewLC(); |
|
38 CleanupStack::Pop( self ); |
|
39 return self; |
|
40 } |
|
41 |
|
42 // --------------------------------------------------------------------------- |
|
43 // NewLC |
|
44 // --------------------------------------------------------------------------- |
|
45 // |
|
46 EXPORT_C CCmSqlResolutionPropertyItem* CCmSqlResolutionPropertyItem::NewLC() |
|
47 { |
|
48 CCmSqlResolutionPropertyItem* self = |
|
49 new ( ELeave ) CCmSqlResolutionPropertyItem(); |
|
50 CleanupStack::PushL( self ); |
|
51 self->ConstructL(); |
|
52 return self; |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------------------------- |
|
56 // Destructor |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
|
59 EXPORT_C CCmSqlResolutionPropertyItem::~CCmSqlResolutionPropertyItem() |
|
60 { |
|
61 } |
|
62 |
|
63 // --------------------------------------------------------------------------- |
|
64 // CCmSqlResolutionPropertyItem::SetWidth |
|
65 // --------------------------------------------------------------------------- |
|
66 // |
|
67 EXPORT_C void CCmSqlResolutionPropertyItem::SetWidth( const TInt aWidth ) |
|
68 { |
|
69 iWidth = aWidth; |
|
70 } |
|
71 |
|
72 // --------------------------------------------------------------------------- |
|
73 // CCmSqlResolutionPropertyItem::SetHeight |
|
74 // --------------------------------------------------------------------------- |
|
75 // |
|
76 EXPORT_C void CCmSqlResolutionPropertyItem::SetHeight( const TInt aHeight ) |
|
77 { |
|
78 iHeight = aHeight; |
|
79 } |
|
80 |
|
81 // --------------------------------------------------------------------------- |
|
82 // CCmSqlResolutionPropertyItem::SetPixelCount |
|
83 // --------------------------------------------------------------------------- |
|
84 // |
|
85 EXPORT_C void CCmSqlResolutionPropertyItem::SetPixelCount( |
|
86 const TInt aPixelCount ) |
|
87 { |
|
88 iPixelCount = aPixelCount; |
|
89 } |
|
90 |
|
91 // --------------------------------------------------------------------------- |
|
92 // CCmSqlResolutionPropertyItem::Width |
|
93 // --------------------------------------------------------------------------- |
|
94 // |
|
95 EXPORT_C TInt CCmSqlResolutionPropertyItem::Width() const |
|
96 { |
|
97 return iWidth; |
|
98 } |
|
99 |
|
100 // --------------------------------------------------------------------------- |
|
101 // CCmSqlResolutionPropertyItem::Height |
|
102 // --------------------------------------------------------------------------- |
|
103 // |
|
104 EXPORT_C TInt CCmSqlResolutionPropertyItem::Height() const |
|
105 { |
|
106 return iHeight; |
|
107 } |
|
108 |
|
109 // --------------------------------------------------------------------------- |
|
110 // CCmSqlResolutionPropertyItem::PixelCount |
|
111 // --------------------------------------------------------------------------- |
|
112 // |
|
113 EXPORT_C TInt CCmSqlResolutionPropertyItem::PixelCount() const |
|
114 { |
|
115 return iPixelCount; |
|
116 } |
|
117 |
|
118 // --------------------------------------------------------------------------- |
|
119 // CompareItemsByName |
|
120 // --------------------------------------------------------------------------- |
|
121 // |
|
122 EXPORT_C TInt CCmSqlResolutionPropertyItem::CompareItemsByName( |
|
123 const CCmSqlResolutionPropertyItem& aFirst, |
|
124 const CCmSqlResolutionPropertyItem& aSecond ) |
|
125 { |
|
126 return aFirst.Name().Compare( aSecond.Name() ); |
|
127 } |
|
128 |
|
129 // --------------------------------------------------------------------------- |
|
130 // CCmSqlResolutionPropertyItem::ExternalizeL |
|
131 // --------------------------------------------------------------------------- |
|
132 // |
|
133 EXPORT_C void CCmSqlResolutionPropertyItem::ExternalizeL( |
|
134 RWriteStream& aStream ) const |
|
135 { |
|
136 aStream.WriteInt32L( iWidth ); |
|
137 aStream.WriteInt32L( iHeight ); |
|
138 aStream.WriteInt32L( iPixelCount ); |
|
139 CCmSqlPropertyItem::ExternalizeL( aStream ); |
|
140 } |
|
141 |
|
142 // --------------------------------------------------------------------------- |
|
143 // CCmSqlResolutionPropertyItem::InternalizeL |
|
144 // --------------------------------------------------------------------------- |
|
145 // |
|
146 EXPORT_C void CCmSqlResolutionPropertyItem::InternalizeL( |
|
147 RReadStream& aStream ) |
|
148 { |
|
149 iWidth = aStream.ReadInt32L(); |
|
150 iHeight = aStream.ReadInt32L(); |
|
151 iPixelCount = aStream.ReadInt32L(); |
|
152 CCmSqlPropertyItem::InternalizeL( aStream ); |
|
153 } |
|
154 |
|
155 // --------------------------------------------------------------------------- |
|
156 // Default constructor |
|
157 // --------------------------------------------------------------------------- |
|
158 // |
|
159 CCmSqlResolutionPropertyItem::CCmSqlResolutionPropertyItem() |
|
160 { |
|
161 } |
|
162 |
|
163 // --------------------------------------------------------------------------- |
|
164 // ConstructL |
|
165 // --------------------------------------------------------------------------- |
|
166 // |
|
167 void CCmSqlResolutionPropertyItem::ConstructL() |
|
168 { |
|
169 } |
|
170 |
|
171 // End of file |
|
172 |