|
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 header file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _INC_CSVGATTRIBUTEVERIFIER_ |
|
20 #define _INC_CSVGATTRIBUTEVERIFIER_ |
|
21 |
|
22 #if !defined(__E32BASE_H__) |
|
23 #include <e32base.h> |
|
24 #endif |
|
25 |
|
26 |
|
27 #include <badesca.h> |
|
28 |
|
29 #define KSVG_COORDINATE_TYPE 2 |
|
30 #define KSVG_LENGTH_TYPE 1 |
|
31 const TInt KMax16BitValue = 32765; |
|
32 |
|
33 /** |
|
34 * This class provides methods to verify attributes values, to reorder |
|
35 * the attributes and to check for required attributes for specific elements, |
|
36 * |
|
37 * @lib SVGEngine.lib |
|
38 * @since 1.0 |
|
39 */ |
|
40 class CSvgAttributeVerifier : public CBase |
|
41 { |
|
42 public: |
|
43 |
|
44 |
|
45 /** |
|
46 * Parse the given string for a decimal value. |
|
47 * |
|
48 * @since 1.0 |
|
49 * @param aNumberString : decimal value string |
|
50 * @param aValueStorage : value storage |
|
51 * @return ETrue if string is a valid decimal value. |
|
52 */ |
|
53 static TBool ParseForDecimalValue( const TDesC& aNum2Str, TReal32& aValue, const TDesC& aAttrValue, TBool isSvgElement ); |
|
54 |
|
55 /** |
|
56 * Verify the range of the value of an attribute based on its type |
|
57 * The string value is converted into the required type and passed back to |
|
58 * the calling function |
|
59 * @since 1.0 |
|
60 * @param aValues : value of the attribute |
|
61 * @param aConvVal : reference parameter to return the converted value |
|
62 * @param aDatatype : flag to determine the type of datatype |
|
63 * @return ETrue if string is a valid decimal value and lies in a valid range. |
|
64 */ |
|
65 |
|
66 static TBool ValidAttrValue ( |
|
67 const TDesC& aValue, |
|
68 TReal32& aConvVal, |
|
69 TUint8 aDatatype, |
|
70 const TDesC& aAttrValue, |
|
71 TBool isSvgElement |
|
72 ); |
|
73 }; |
|
74 |
|
75 #endif |