|
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CHTMLTOCRTCONVHASHTABLE_H__ |
|
17 #define __CHTMLTOCRTCONVHASHTABLE_H__ |
|
18 |
|
19 #include <e32std.h> |
|
20 #include <e32base.h> |
|
21 #include "CHtmlToCrtConvHash.h" |
|
22 #include "CHtmlToCrtConvLookupTable.h" |
|
23 |
|
24 class CHtmlToCrtConvHashTable : public CBase |
|
25 { |
|
26 public: |
|
27 static CHtmlToCrtConvHashTable* NewL(); |
|
28 ~CHtmlToCrtConvHashTable(); |
|
29 /** |
|
30 @fn THtmlToCrtConvTagType LookupTag(const TDesC8& aTag) const |
|
31 Intended Usage : Searches for aTag in KTagHashTable[] and returns |
|
32 corresponding THtmlToCrtConvTagType<br> |
|
33 @param aTag The text to be searched for |
|
34 @return THtmlToCrtConvTagType The corresponding type |
|
35 - EHtmlTagUnknown if not found |
|
36 */ |
|
37 THtmlToCrtConvTagType LookupTag(const TDesC16& aTag) const; |
|
38 /** |
|
39 @fn THtmlToCrtConvAttributeType LookupAttribute(const TDesC8& aAttribute) const |
|
40 Intended Usage : Searches for aAttribute in KAttributeHashTable[] and returns |
|
41 corresponding THtmlToCrtConvAttributeType<br> |
|
42 @param aAttribute The text to be searched for |
|
43 @return THtmlToCrtConvAttributeType The corresponding type |
|
44 - EHtmlAttributeUnknown if not found |
|
45 */ |
|
46 THtmlToCrtConvAttributeType LookupAttribute(const TDesC16& aAttribute) const; |
|
47 |
|
48 /** |
|
49 @fn const TDesC16& LookupEntity(const TDesC16& aEntityName) const |
|
50 Intended Usage : Searches for aEntityName in KEntityHashTable[] and returns the |
|
51 corresponding entity |
|
52 @param aEntityName The entity name to be searched for |
|
53 @return const TDesC16& The corresponding entity |
|
54 - KHtmlEntityUnknown if not found |
|
55 */ |
|
56 const TDesC16& LookupEntity(const TDesC16& aEntityName) const; |
|
57 |
|
58 private: |
|
59 CHtmlToCrtConvHashTable(); |
|
60 void ConstructL(); |
|
61 /** |
|
62 @fn void CreateTagHashTableL() |
|
63 Intended Usage : Used by LookupTag() |
|
64 Populates iTagHashValues with values |
|
65 generated from KTagHashTable[]<br> |
|
66 @return void |
|
67 */ |
|
68 void CreateTagHashTableL(); |
|
69 /** |
|
70 @fn void CreateAttributeHashTableL() |
|
71 Intended Usage : Used by LookupAttribute() |
|
72 Populates iAttributeHashValues with values |
|
73 generated from KAttributeHashTable[]<br> |
|
74 @return void |
|
75 */ |
|
76 void CreateAttributeHashTableL(); |
|
77 /** |
|
78 @fn CreateEntityHashTableL() |
|
79 Intended Usage : Populates iEntityHashValues with values |
|
80 generated from KEntityHashTable[]. iEnitityHashValues |
|
81 is used by LookupEntity() |
|
82 @return void |
|
83 */ |
|
84 |
|
85 void CreateEntityHashTableL(); |
|
86 /** |
|
87 @fn TInt Hash(const TDesC8& aText) const |
|
88 Intended Usage : Used by CreateTagHashTableL(), CreateAttributeHashTableL(), |
|
89 LookupTag() and LookupAttribute() |
|
90 Takes a descriptor, and returns a value determined |
|
91 by the descriptor<br> |
|
92 @param aText the text to be translated into a hash value |
|
93 @return TInt a value determined by aText |
|
94 */ |
|
95 TInt Hash(const TDesC16& aText) const; |
|
96 |
|
97 private: |
|
98 RArray<TInt> iTagHashValues; |
|
99 RArray<TInt> iAttributeHashValues; |
|
100 }; |
|
101 |
|
102 #endif |