|
1 /* |
|
2 * Copyright (c) 1999 - 2001 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 the License "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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef WML_DECODER_H |
|
20 #define WML_DECODER_H |
|
21 |
|
22 #include "nwx_http_header.h" |
|
23 #include "nw_wml_var.h" |
|
24 #include "nwx_buffer.h" |
|
25 #include "wml_elements.h" |
|
26 #include "wml_decoder_iter.h" |
|
27 #include "nw_wml_defs.h" |
|
28 #include "nw_nvpair.h" |
|
29 #include "nw_wml_decoder.h" |
|
30 #include "nw_wae_reader.h" |
|
31 #include "nw_wml_core.h" |
|
32 #include "nw_hed_context.h" |
|
33 #include "BrsrStatusCodes.h" |
|
34 |
|
35 |
|
36 #ifdef __cplusplus |
|
37 extern "C" { |
|
38 #endif |
|
39 |
|
40 /* TODO make this private by moving it to wml_decoder.c */ |
|
41 struct NW_DeckDecoder_s { |
|
42 NW_Wml_Element_t card_el; |
|
43 NW_Wml_Deck_t* domDeck; |
|
44 }; |
|
45 |
|
46 |
|
47 /* deck related */ |
|
48 NW_DeckDecoder_t* NW_DeckDecoder_New (void); |
|
49 |
|
50 void NW_DeckDecoder_Delete (NW_DeckDecoder_t* thisObj); |
|
51 |
|
52 TBrowserStatusCode NW_DeckDecoder_InitializeAndValidate (NW_DeckDecoder_t* thisObj, |
|
53 NW_Buffer_t* domBuffer, |
|
54 NW_Http_CharSet_t charset, |
|
55 NW_Bool contentWasPlainText); |
|
56 |
|
57 TBrowserStatusCode NW_DeckDecoder_GetRootElement (const NW_DeckDecoder_t* thisObj, |
|
58 NW_Wml_Element_t* root); |
|
59 |
|
60 NW_Bool NW_DeckDecoder_GetCardElement (const NW_DeckDecoder_t* thisObj, |
|
61 NW_Wml_Element_t* elem); |
|
62 |
|
63 TBrowserStatusCode NW_DeckDecoder_GetTemplateElement (const NW_DeckDecoder_t* thisObj, |
|
64 NW_Wml_Element_t* elem); |
|
65 |
|
66 TBrowserStatusCode NW_DeckDecoder_GetHeadElement (const NW_DeckDecoder_t *thisObj, |
|
67 NW_Wml_Element_t *elem); |
|
68 |
|
69 TBrowserStatusCode NW_DeckDecoder_SetCardByName (NW_DeckDecoder_t *thisObj, |
|
70 const NW_Ucs2* cardName); |
|
71 |
|
72 TBrowserStatusCode NW_DeckDecoder_SetCardByElement (NW_DeckDecoder_t* thisObj, |
|
73 const NW_Wml_Element_t* newElement); |
|
74 |
|
75 TBrowserStatusCode NW_DeckDecoder_GetCardName (const NW_DeckDecoder_t *thisObj, |
|
76 NW_Ucs2 **cardName); |
|
77 |
|
78 TBrowserStatusCode NW_DeckDecoder_GetCardTitle (const NW_DeckDecoder_t* thisObj, |
|
79 const NW_Wml_VarList_t* varList, |
|
80 NW_Ucs2** title); |
|
81 |
|
82 TBrowserStatusCode NW_DeckDecoder_GetDocumentPublicId (const NW_DeckDecoder_t* thisObj, |
|
83 NW_Uint32* publicId); |
|
84 |
|
85 NW_Uint8 NW_DeckDecoder_GetVersion (const NW_DeckDecoder_t* thisObj); |
|
86 |
|
87 NW_Uint16 NW_DeckDecoder_GetEncoding (const NW_DeckDecoder_t* thisObj); |
|
88 |
|
89 |
|
90 /* element related */ |
|
91 TBrowserStatusCode NW_DeckDecoder_ReadString (const NW_DeckDecoder_t* thisObj, |
|
92 const NW_Wml_Element_t* elem, |
|
93 const NW_Wml_VarList_t* varList, |
|
94 NW_Mem_Segment_Id_t memScope, |
|
95 NW_Ucs2** retString); |
|
96 |
|
97 NW_Bool NW_DeckDecoder_FirstContainedElement (const NW_DeckDecoder_t* thisObj, |
|
98 const NW_Wml_Element_t* container, |
|
99 NW_Wml_Element_t* elem); |
|
100 |
|
101 TBrowserStatusCode NW_DeckDecoder_GetType (const NW_DeckDecoder_t* thisObj, |
|
102 const NW_Wml_Element_t* elem, |
|
103 NW_Wml_ElType_e* type); |
|
104 |
|
105 TBrowserStatusCode NW_DeckDecoder_SearchDoElements(NW_DeckDecoder_t* thisObj, |
|
106 NW_Wml_VarList_t* varList, |
|
107 NW_Wml_Element_t* container, |
|
108 NW_Wml_Attr_t attribute, |
|
109 NW_Ucs2* searchString); |
|
110 |
|
111 TBrowserStatusCode NW_DeckDecoder_GetPostfieldData (const NW_DeckDecoder_t* thisObj, |
|
112 const NW_Wml_VarList_t* varList, |
|
113 const NW_Wml_Element_t* elem, |
|
114 NW_NVPair_t** postfieldsArg); |
|
115 |
|
116 TBrowserStatusCode NW_DeckDecoder_GetAttribute (const NW_DeckDecoder_t* thisObj, |
|
117 const NW_Wml_Element_t* elem, |
|
118 NW_Wml_Attr_t attribute, |
|
119 const NW_Wml_VarList_t* varList, |
|
120 NW_Mem_Segment_Id_t memScope, |
|
121 NW_Ucs2** attributeValue); |
|
122 |
|
123 NW_Bool NW_DeckDecoder_HasAttributeWithValue (const NW_DeckDecoder_t* thisObj, |
|
124 const NW_Wml_Element_t* elem, |
|
125 NW_Wml_Attr_t attribute, |
|
126 const char* attributeValue, |
|
127 const NW_Wml_VarList_t* varList); |
|
128 |
|
129 NW_Bool NW_DeckDecoder_HasContent (const NW_DeckDecoder_t* thisObj, |
|
130 const NW_Wml_Element_t* elem); |
|
131 |
|
132 TBrowserStatusCode NW_DeckDecoder_CopyElement (const NW_DeckDecoder_t* thisObj, |
|
133 const NW_Wml_Element_t* srcEl, |
|
134 NW_Wml_Element_t* destEl); |
|
135 |
|
136 NW_HED_Context_t* |
|
137 NW_DeckDecoder_VarListToContext (const NW_Wml_VarList_t* varList); |
|
138 |
|
139 TBrowserStatusCode |
|
140 NW_DeckDecoder_ContextToVarList (const NW_HED_Context_t* context, |
|
141 NW_Wml_VarList_t* varList, |
|
142 NW_Mem_Segment_Id_t memScope); |
|
143 |
|
144 /* deck-iterator related */ |
|
145 TBrowserStatusCode NW_DeckDecoderIter_Initialize (NW_DeckDecoderIter_t *thisObj, |
|
146 const NW_DeckDecoder_t* decoder, |
|
147 const NW_Wml_Element_t* container); |
|
148 |
|
149 TBrowserStatusCode NW_DeckDecoderIter_InitializeAll_Children (NW_DeckDecoderIter_t *thisObj, |
|
150 const NW_DeckDecoder_t* decoder, |
|
151 const NW_Wml_Element_t* container); |
|
152 NW_Bool NW_DeckDecoderIter_GetNextElement (NW_DeckDecoderIter_t* thisObj, |
|
153 NW_Wml_Element_t* elem); |
|
154 |
|
155 #ifdef __cplusplus |
|
156 } /* extern "C" */ |
|
157 #endif |
|
158 |
|
159 #endif /* WML_DECODER_H */ |