|
1 /* |
|
2 * Copyright (c) 2003 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: SVG Implementation source file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifdef _DEBUG |
|
20 #if !defined(__E32DEBUG_H__) |
|
21 #include <e32debug.h> |
|
22 #endif |
|
23 #endif |
|
24 #include "SVGStrCssValueImpl.h" |
|
25 |
|
26 |
|
27 |
|
28 // --------------------------------------------------------------------------- |
|
29 // |
|
30 // --------------------------------------------------------------------------- |
|
31 CStrCssValueImpl::~CStrCssValueImpl() |
|
32 { |
|
33 if ( iCssText ) |
|
34 { |
|
35 delete iCssText; |
|
36 iCssText = NULL; |
|
37 } |
|
38 } |
|
39 |
|
40 // --------------------------------------------------------------------------- |
|
41 // |
|
42 // --------------------------------------------------------------------------- |
|
43 TInt CStrCssValueImpl::SetValueL( const TDesC& aValue ) |
|
44 { |
|
45 if ( iCssText ) |
|
46 { |
|
47 delete iCssText; |
|
48 iCssText = NULL; |
|
49 } |
|
50 |
|
51 iCssText = aValue.AllocL(); |
|
52 |
|
53 return KErrNone; |
|
54 } |
|
55 |
|
56 // --------------------------------------------------------------------------- |
|
57 // |
|
58 // --------------------------------------------------------------------------- |
|
59 const TDesC& CStrCssValueImpl::Value() |
|
60 { |
|
61 return *iCssText; |
|
62 } |
|
63 |
|
64 // --------------------------------------------------------------------------- |
|
65 // |
|
66 // --------------------------------------------------------------------------- |
|
67 |
|
68 void CStrCssValueImpl::SetL(CStrCssValueImpl* aValue) |
|
69 { |
|
70 |
|
71 SetValueL(aValue->Value()); |
|
72 |
|
73 } |
|
74 |
|
75 // ******************************************************* |
|
76 // Private |
|
77 |
|
78 |
|
79 |
|
80 // --------------------------------------------------------------------------- |
|
81 // |
|
82 // --------------------------------------------------------------------------- |
|
83 |
|
84 CStrCssValueImpl::CStrCssValueImpl( ) |
|
85 { |
|
86 } |
|
87 |
|
88 // --------------------------------------------------------------------------- |
|
89 // |
|
90 // --------------------------------------------------------------------------- |
|
91 TBool CStrCssValueImpl::IsEqual( CCssValue* aValue ) |
|
92 { |
|
93 if (((CStrCssValueImpl*)aValue)->iCssText == iCssText) |
|
94 { |
|
95 return ETrue; |
|
96 } |
|
97 |
|
98 return EFalse; |
|
99 } |
|
100 |
|
101 // --------------------------------------------------------------------------- |
|
102 // |
|
103 // --------------------------------------------------------------------------- |
|
104 void CStrCssValueImpl::Print() |
|
105 { |
|
106 #ifdef _DEBUG |
|
107 if (iCssText && iCssText->Length() > 0) |
|
108 { |
|
109 HBufC8* buf = NULL; |
|
110 buf = HBufC8::New( Value().Length() + 1); |
|
111 buf->Des().Copy( Value() ); |
|
112 buf->Des().ZeroTerminate(); |
|
113 RDebug::Printf("%s", buf->Ptr()); |
|
114 delete buf; |
|
115 } |
|
116 else |
|
117 { |
|
118 RDebug::Printf("NULL"); |
|
119 } |
|
120 #endif |
|
121 } |