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