xmlsrv_plat/cxml_library_api/inc/nw_dom_text.h
branchRCL_3
changeset 21 604ca70b6235
parent 20 889504eac4fb
equal deleted inserted replaced
20:889504eac4fb 21:604ca70b6235
     1 /*
       
     2 * Copyright (c) 2000 - 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 /** ----------------------------------------------------------------------- **
       
    20     @package:     NW_DOM
       
    21 
       
    22     @synopsis:    default
       
    23 
       
    24     @description: default
       
    25 
       
    26  ** ----------------------------------------------------------------------- **/
       
    27 #ifndef NW_DOM_TEXT_H
       
    28 #define NW_DOM_TEXT_H
       
    29 
       
    30 #include <xml/cxml/cxml_proj.h>
       
    31 #include <xml/cxml/nw_dom_node.h>
       
    32 
       
    33 #ifdef __cplusplus
       
    34 extern "C" {
       
    35 #endif /* __cplusplus */
       
    36 
       
    37 
       
    38 /** ----------------------------------------------------------------------- **
       
    39     @typedef:     NW_DOM_TextItemIterator
       
    40 
       
    41     @synopsis:    Used to iterate over the components of a WBXML text item.
       
    42 
       
    43     @scope:       public
       
    44      
       
    45     @type:        NW_TinyDom_TextHandle_t
       
    46 
       
    47     @description: Used to iterate over the components of a WBXML text item.
       
    48 
       
    49  ** ----------------------------------------------------------------------- **/
       
    50 typedef NW_TinyDom_TextHandle_t NW_DOM_TextItemIterator_t;
       
    51 
       
    52 
       
    53 /** ----------------------------------------------------------------------- **
       
    54     @typedef:     NW_DOM_TextItem
       
    55 
       
    56     @synopsis:    Extension to support text nodes.
       
    57 
       
    58     @scope:       public
       
    59      
       
    60     @type:        NW_TinyDom_Text_t
       
    61 
       
    62     @description: DOM_TextItem_t is an extension to support text nodes in 
       
    63                   WBXML. Text nodes in WBXML can be composed of a list of 
       
    64                   string, extension, opaque, or entitity data types. 
       
    65 
       
    66  ** ----------------------------------------------------------------------- **/
       
    67 typedef NW_TinyDom_Text_t NW_DOM_TextItem_t;
       
    68 
       
    69 /*  ----------------------------------------------------------------------- **
       
    70     TEXT - SPECIFIC methods 
       
    71  ** ----------------------------------------------------------------------- **/
       
    72   
       
    73 
       
    74 /** ----------------------------------------------------------------------- **
       
    75     @function:    NW_DOM_TextNode_getData
       
    76 
       
    77     @synopsis:    Gets the value of the text node as a string.
       
    78 
       
    79     @scope:       public
       
    80 
       
    81     @parameters:
       
    82        [in] NW_DOM_TextNode_t* node
       
    83                   The text node.
       
    84 
       
    85        [out] NW_String_t* valueString
       
    86                   The value of the node
       
    87 
       
    88     @description: Gets the value of the text node as a string.
       
    89 
       
    90     @returns:     NW_Status_t
       
    91                   Status of operation.
       
    92 
       
    93        [NW_STAT_SUCCESS]
       
    94                   Data returned successfully.
       
    95 
       
    96        [NW_STAT_DOM_NODE_TYPE_ERR]
       
    97                   Not a text node
       
    98 
       
    99        [NW_STAT_OUT_OF_MEMORY]
       
   100                   Unable to allocate memory for string storage.
       
   101 
       
   102        [NW_STAT_DOM_NO_STRING_RETURNED]
       
   103                   String storage is not assigned.
       
   104 
       
   105  ** ----------------------------------------------------------------------- **/
       
   106 IMPORT_C NW_Status_t
       
   107 NW_DOM_TextNode_getData(NW_DOM_TextNode_t* node, 
       
   108                         NW_String_t* valueString);
       
   109 
       
   110 
       
   111 /** ----------------------------------------------------------------------- **
       
   112     @function:    NW_DOM_TextNode_setData
       
   113 
       
   114     @synopsis:    Creates a new TextNode and replaces the previous one.
       
   115 
       
   116     @scope:       public
       
   117 
       
   118     @parameters:
       
   119        [in-out] NW_DOM_TextNode_t** node
       
   120                   The text node.
       
   121 
       
   122        [in] NW_String_t* val
       
   123                   Value of the text node.
       
   124 
       
   125     @description: Creates a new TextNode and replaces the previous one.
       
   126 
       
   127     @returns:     NW_Status_t
       
   128                   Status of operation.
       
   129 
       
   130        [NW_STAT_SUCCESS]
       
   131                   New text node created.
       
   132 
       
   133        [NW_STAT_BAD_INPUT_PARAM]
       
   134                   Required parameter was NULL.
       
   135 
       
   136  ** ----------------------------------------------------------------------- **/
       
   137 IMPORT_C NW_Status_t
       
   138 NW_DOM_TextNode_setData(NW_DOM_TextNode_t** node, 
       
   139                         NW_String_t* val);
       
   140 
       
   141 
       
   142 /*  ----------------------------------------------------------------------- **
       
   143     TextItem Methods 
       
   144     In XML a text node has only string data, but in WBXML a TextNode consists 
       
   145     of a list of one or more text items including strings, text entities, etc.
       
   146  ** ----------------------------------------------------------------------- **/
       
   147 
       
   148 /** ----------------------------------------------------------------------- **
       
   149     @typedef:     NW_DOM_TextItemType
       
   150 
       
   151     @synopsis:    Enumerated text item type.
       
   152 
       
   153     @scope:       public
       
   154      
       
   155     @type:        NW_Uint8
       
   156 
       
   157     @description: Enumerated text item type.
       
   158 
       
   159  ** ----------------------------------------------------------------------- **/
       
   160 typedef NW_Uint8 NW_DOM_TextItemType_t;
       
   161 
       
   162 #define NW_DOM_TEXT_ITEM_STRING       1
       
   163 #define NW_DOM_TEXT_ITEM_EXTENSION    2
       
   164 #define NW_DOM_TEXT_ITEM_ENTITY       3
       
   165 #define NW_DOM_TEXT_ITEM_OPAQUE       4
       
   166 
       
   167 
       
   168 /** ----------------------------------------------------------------------- **
       
   169     @function:    NW_DOM_TextItem_new
       
   170 
       
   171     @synopsis:    Creates net TextItem
       
   172 
       
   173     @scope:       public
       
   174 
       
   175     @description: Creates new text item.
       
   176 
       
   177     @returns:     NW_DOM_TextItem_t*
       
   178                   New text item.
       
   179  ** ----------------------------------------------------------------------- **/
       
   180 NW_DOM_TextItem_t*
       
   181 NW_DOM_TextItem_new(void);
       
   182 
       
   183 
       
   184 /** ----------------------------------------------------------------------- **
       
   185     @function:    NW_DOM_TextItem_initFromString
       
   186 
       
   187     @synopsis:    Initializes a text item with a string.
       
   188 
       
   189     @scope:       public
       
   190 
       
   191     @parameters:
       
   192        [in] NW_DOM_TextItem_t* item
       
   193                   The text item.
       
   194 
       
   195        [in] NW_String_t* string
       
   196                   Data from which item will be initialized.
       
   197 
       
   198     @description: Initializes a text item with a string.
       
   199 
       
   200     @returns:     NW_Status_t
       
   201                   Status of operation.
       
   202 
       
   203        [NW_STAT_SUCCESS]
       
   204                   Always returns success.
       
   205 
       
   206  ** ----------------------------------------------------------------------- **/
       
   207 IMPORT_C NW_Status_t
       
   208 NW_DOM_TextItem_initFromString (NW_DOM_TextItem_t* item, 
       
   209                                 NW_String_t* string);
       
   210 
       
   211  
       
   212 /** ----------------------------------------------------------------------- **
       
   213     @function:    NW_DOM_TextItem_initFromEntity
       
   214 
       
   215     @synopsis:    Initializes a text item with an entity.
       
   216 
       
   217     @scope:       public
       
   218 
       
   219     @parameters:
       
   220        [in-out] NW_DOM_TextItem_t* item
       
   221                   The text item.
       
   222 
       
   223        [in] NW_Uint32 entity
       
   224                   default
       
   225 
       
   226     @description: Initializes a Text Item of type NW_DOM_TEXT_ITEM_ENTITY
       
   227                   with an entity.
       
   228 
       
   229     @returns:     NW_Status_t
       
   230                   Status of operation.
       
   231 
       
   232        [NW_STAT_SUCCESS]
       
   233                   Always returns success.
       
   234 
       
   235  ** ----------------------------------------------------------------------- **/
       
   236 IMPORT_C NW_Status_t
       
   237 NW_DOM_TextItem_initFromEntity (NW_DOM_TextItem_t* item, 
       
   238                                 NW_Uint32 entity);
       
   239 
       
   240 
       
   241 /** ----------------------------------------------------------------------- **
       
   242     @function:    NW_DOM_TextItem_initFromExtension
       
   243 
       
   244     @synopsis:    Initializes a text item with an extension.
       
   245 
       
   246     @scope:       public
       
   247 
       
   248     @parameters:
       
   249        [in] NW_DOM_TextItem_t* item
       
   250                   The text item.
       
   251 
       
   252        [in] NW_Uint16 token
       
   253                   Token from which the item will be initialized.
       
   254 
       
   255        [in] NW_String_t* str
       
   256                   Data from which item will be initialized.
       
   257 
       
   258     @description: Initializes a text item with an extension.
       
   259 
       
   260     @returns:     NW_Status_t
       
   261                   Status of operation.
       
   262 
       
   263        [NW_STAT_SUCCESS]
       
   264                   Always returns success.
       
   265 
       
   266  ** ----------------------------------------------------------------------- **/
       
   267 IMPORT_C NW_Status_t
       
   268 NW_DOM_TextItem_initFromExtension (NW_DOM_TextItem_t* item, 
       
   269                                    NW_Uint16 token, 
       
   270                                    NW_String_t* str);
       
   271 
       
   272 
       
   273 /** ----------------------------------------------------------------------- **
       
   274     @function:    NW_DOM_TextItem_initFromExtensionInt
       
   275 
       
   276     @synopsis:    Initializes a text item with the particular extension
       
   277                   types EXT_T_[0,1,2] + uint32 where uint32 is not an
       
   278                   index into the string table.
       
   279 
       
   280     @scope:       public
       
   281 
       
   282     @parameters:
       
   283        [in] NW_DOM_TextItem_t* item
       
   284                   The text item.
       
   285 
       
   286        [in] NW_Uint16 token
       
   287                   Token from which the item will be initialized.
       
   288                   The token must be one of EXT_T_[0,1,2].
       
   289 
       
   290        [in] NW_Uint32 x
       
   291                   The associated 32-bit unsigned value.
       
   292 
       
   293     @description: Initializes a text item with the particular extension
       
   294                   types EXT_T_[0,1,2] + uint32 where uint32 is not an
       
   295                   index into the string table.
       
   296 
       
   297     @returns:     NW_Status_t
       
   298                   Status of operation.
       
   299 
       
   300        [NW_STAT_SUCCESS]
       
   301                   Success.
       
   302 
       
   303        [NW_STAT_FAILURE]
       
   304                   Failure if token is not one of EXT_T_[0,1,2].
       
   305 
       
   306  ** ----------------------------------------------------------------------- **/
       
   307 IMPORT_C NW_Status_t
       
   308 NW_DOM_TextItem_initFromExtensionInt (NW_DOM_TextItem_t* item,
       
   309                                       NW_Uint16 token,
       
   310                                       NW_Uint32 x);
       
   311 
       
   312 
       
   313 /** ----------------------------------------------------------------------- **
       
   314     @function:    NW_DOM_TextItem_initFromOpaque
       
   315 
       
   316     @synopsis:    Initializes a text item with an opaque value.
       
   317 
       
   318     @scope:       public
       
   319 
       
   320     @parameters:
       
   321        [in-out] NW_DOM_TextItem_t* item
       
   322                   The text item.
       
   323 
       
   324        [in] NW_Uint32 length
       
   325                   default
       
   326 
       
   327        [in] NW_Byte* data
       
   328                   default
       
   329 
       
   330     @description: Initializes a Text Item of type NW_DOM_TEXT_ITEM_OPAQUE
       
   331                   with an opaque value.
       
   332 
       
   333     @returns:     NW_Status_t
       
   334                   Status of operation.
       
   335 
       
   336        [NW_STAT_SUCCESS]
       
   337                   Always returns success.
       
   338 
       
   339  ** ----------------------------------------------------------------------- **/
       
   340 IMPORT_C NW_Status_t
       
   341 NW_DOM_TextItem_initFromOpaque (NW_DOM_TextItem_t* item, 
       
   342                                 NW_Uint32 length, 
       
   343                                 NW_Byte* data);
       
   344 
       
   345 
       
   346 /** ----------------------------------------------------------------------- **
       
   347     @function:    NW_DOM_TextItem_delete
       
   348 
       
   349     @synopsis:    Deallocates a text item.
       
   350 
       
   351     @scope:       public
       
   352 
       
   353     @parameters:
       
   354        [in-out] NW_DOM_TextItem_t* item
       
   355                   The text item.
       
   356 
       
   357     @description: Deallocates a text item.
       
   358 
       
   359     @returns:     NW_Status_t
       
   360                   Status of operation.
       
   361 
       
   362        [NW_STAT_SUCCESS]
       
   363                   Always returns success.
       
   364 
       
   365  ** ----------------------------------------------------------------------- **/
       
   366 NW_Status_t
       
   367 NW_DOM_TextItem_delete(NW_DOM_TextItem_t* item);
       
   368 
       
   369 
       
   370 /** ----------------------------------------------------------------------- **
       
   371     @function:    NW_DOM_TextItem_getType
       
   372 
       
   373     @synopsis:     Finds the type of a text item. 
       
   374 
       
   375     @scope:       public
       
   376 
       
   377     @parameters:
       
   378        [in] NW_DOM_TextItem_t* item
       
   379                   The text item.
       
   380 
       
   381     @description: Finds the type of a text item (one of: extension, string, 
       
   382                  opaque, or entity).
       
   383 
       
   384     @returns:     NW_DOM_TextItemType_t
       
   385                   Type returned. or zero if unknown.
       
   386 
       
   387  ** ----------------------------------------------------------------------- **/
       
   388 IMPORT_C NW_DOM_TextItemType_t 
       
   389 NW_DOM_TextItem_getType(NW_DOM_TextItem_t* item);
       
   390 
       
   391 
       
   392 /** ----------------------------------------------------------------------- **
       
   393     @function:    NW_DOM_TextItem_setType
       
   394 
       
   395     @synopsis:    Sets the type of TextItem.
       
   396 
       
   397     @scope:       public
       
   398 
       
   399     @parameters:
       
   400        [in-out] NW_DOM_TextItem_t* item
       
   401                   The text item.
       
   402 
       
   403        [in] NW_DOM_TextItemType_t type
       
   404                   Type to which to set the text item.
       
   405 
       
   406     @description: Sets the type of TextItem
       
   407 
       
   408     @returns:     NW_Status_t
       
   409                   Status of operation.
       
   410 
       
   411        [NW_STAT_SUCCESS]
       
   412                   Value set.
       
   413 
       
   414        [NW_STAT_BAD_INPUT_PARAM]
       
   415                   Invalid type.
       
   416 
       
   417  ** ----------------------------------------------------------------------- **/
       
   418 NW_Status_t 
       
   419 NW_DOM_TextItem_setType(NW_DOM_TextItem_t* item, 
       
   420                         NW_DOM_TextItemType_t type);
       
   421 
       
   422 
       
   423 /** ----------------------------------------------------------------------- **
       
   424     @function:    NW_DOM_TextItem_toString
       
   425 
       
   426     @synopsis:    Creates a string representation of the item. 
       
   427 
       
   428     @scope:       public
       
   429 
       
   430     @parameters:
       
   431        [in] NW_DOM_TextItem_t* item
       
   432                   The text item.
       
   433 
       
   434        [out] NW_String_t* string
       
   435                   String value.
       
   436 
       
   437        [in] NW_Uint32 encoding
       
   438                   Encoding to apply.
       
   439 
       
   440     @description: Creates a string representation of the item.
       
   441 
       
   442     @returns:     NW_Status_t
       
   443                   Status of operation.
       
   444 
       
   445        [NW_STAT_SUCCESS]
       
   446                   String returned.
       
   447 
       
   448        [NW_STAT_WBXML_ERROR_CHARSET_UNSUPPORTED]
       
   449                   If encoding is not supported.
       
   450 
       
   451        [NW_STAT_DOM_NO_STRING_RETURNED]
       
   452                   Error extracting string.
       
   453 
       
   454  ** ----------------------------------------------------------------------- **/
       
   455 IMPORT_C NW_Status_t
       
   456 NW_DOM_TextItem_toString(NW_DOM_TextItem_t* item, 
       
   457                          NW_String_t* string, 
       
   458                          NW_Uint32 encoding);
       
   459 
       
   460 /*  ----------------------------------------------------------------------- **
       
   461     The following methods return the a text item component
       
   462  ** ----------------------------------------------------------------------- **/
       
   463 
       
   464 /** ----------------------------------------------------------------------- **
       
   465     @function:    NW_DOM_TextItem_getEntity
       
   466 
       
   467     @synopsis:    Gets TextItem entity.
       
   468 
       
   469     @scope:       public
       
   470 
       
   471     @parameters:
       
   472        [in] NW_DOM_TextItem_t* item
       
   473                   The text item.
       
   474 
       
   475     @description: If item is of type NW_DOM_TEXT_ITEM_ENTITY returns entity
       
   476                   otherwise returns zero.
       
   477 
       
   478     @returns:     NW_Uint32
       
   479                   Entity or 0 if not NW_DOM_TEXT_ITEM_ENTITY
       
   480 
       
   481  ** ----------------------------------------------------------------------- **/
       
   482 IMPORT_C NW_Uint32
       
   483 NW_DOM_TextItem_getEntity(NW_DOM_TextItem_t* item);
       
   484 
       
   485 
       
   486 /** ----------------------------------------------------------------------- **
       
   487     @function:    NW_DOM_TextItem_getString
       
   488 
       
   489     @synopsis:    Gets Text Item string.
       
   490 
       
   491     @scope:       public
       
   492 
       
   493     @parameters:
       
   494        [in] NW_DOM_TextItem_t* item
       
   495                   The text item.
       
   496 
       
   497        [out] NW_String_t* string
       
   498                   String associated with the text item.
       
   499 
       
   500     @description:  Gets Text Item string if item is of type 
       
   501                    NW_DOM_TEXT_ITEM_STRING returns and modifies string.
       
   502 
       
   503     @returns:     NW_Status_t
       
   504                   Status of operation.
       
   505 
       
   506        [NW_STAT_SUCCESS]
       
   507                   Success default.
       
   508 
       
   509        [NW_STAT_BAD_INPUT_PARAM]
       
   510                   Not NW_DOM_TEXT_ITEM_STRING.
       
   511 
       
   512        [NW_STAT_OUT_OF_MEMORY]
       
   513                   Could not allocate memory for string.
       
   514 
       
   515  ** ----------------------------------------------------------------------- **/
       
   516 IMPORT_C NW_Status_t
       
   517 NW_DOM_TextItem_getString(NW_DOM_TextItem_t* item, 
       
   518                           NW_String_t* string);
       
   519 
       
   520 
       
   521 /** ----------------------------------------------------------------------- **
       
   522     @function:    NW_DOM_TextItem_getExtensionToken
       
   523 
       
   524     @synopsis:    Returns extension token.
       
   525 
       
   526     @scope:       public
       
   527 
       
   528     @parameters:
       
   529        [in] NW_DOM_TextItem_t* item
       
   530                   The text item.
       
   531 
       
   532        [out] NW_Uint16* token
       
   533                   The token.
       
   534 
       
   535     @description: If TextItem is of type NW_DOM_TEXT_ITEM_EXTENSION then
       
   536                   assigns token to out parameter and returns NW_STAT_SUCCESS.
       
   537                   If not, it returns NW_STAT_FAILURE.
       
   538 
       
   539     @returns:     NW_Status_t
       
   540                   Status of operation.
       
   541 
       
   542        [NW_STAT_SUCCESS]
       
   543                   Success.
       
   544 
       
   545        [NW_STAT_FAILURE]
       
   546                   If text item is of wrong type.
       
   547 
       
   548  ** ----------------------------------------------------------------------- **/
       
   549 IMPORT_C NW_Status_t
       
   550 NW_DOM_TextItem_getExtensionToken(NW_DOM_TextItem_t* item,
       
   551                                   NW_Uint16* token);
       
   552 
       
   553 
       
   554 /** ----------------------------------------------------------------------- **
       
   555     @function:    NW_DOM_TextItem_getExtension
       
   556 
       
   557     @synopsis:    Returns extension token and string.
       
   558 
       
   559     @scope:       public
       
   560 
       
   561     @parameters:
       
   562        [in] NW_DOM_TextItem_t* item
       
   563                   The text item.
       
   564 
       
   565        [out] NW_String_t* str
       
   566                   String associated with extension if it is a text extension,
       
   567                   otherwise string cleared.
       
   568 
       
   569     @description: If TextItem is of type NW_DOM_TEXT_ITEM_EXTENSION returns 
       
   570                   token  ans string for extension. If not, it returns zero 
       
   571                   and clears the string.  Some extensions do not have text 
       
   572                   associated with them. The string is cleared for these as 
       
   573                   well. If this is a single token extension then the string 
       
   574                   is cleared first.
       
   575 
       
   576     @returns:     NW_Uint16
       
   577                   Token or zero if not NW_DOM_TEXT_ITEM_EXTENSION.
       
   578 
       
   579  ** ----------------------------------------------------------------------- **/
       
   580 IMPORT_C NW_Uint16
       
   581 NW_DOM_TextItem_getExtension(NW_DOM_TextItem_t* item, 
       
   582                              NW_String_t* str);
       
   583 
       
   584 
       
   585 /** ----------------------------------------------------------------------- **
       
   586     @function:    NW_DOM_TextItem_getExtensionInt
       
   587 
       
   588     @synopsis:    Only for EXT_T_[0,1,2] where associated value is not
       
   589                   a reference to the string table, returns value
       
   590 
       
   591     @scope:       public
       
   592 
       
   593     @parameters:
       
   594        [in] NW_DOM_TextItem_t* item
       
   595                   The text item.
       
   596 
       
   597        [out] NW_Uint32* x
       
   598                   Value associated with extension if it is a text extension,
       
   599                   otherwise undefined.
       
   600 
       
   601     @description: If TextItem is of type NW_DOM_TEXT_ITEM_EXTENSION and
       
   602                   it was created as EXT_T_[0,1,2] with an associated
       
   603                   value that is not a reference to the string table
       
   604                   (i.e., created with
       
   605                   NW_DOM_TextItem_initFromExtensionInt()), then it
       
   606                   returns the value via the out parameter x and
       
   607                   returns NW_STAT_SUCCESS.  Otherwise returns
       
   608                   NW_STAT_FAILURE and the value of x is undefined.
       
   609 
       
   610     @returns:     NW_Status_t
       
   611 
       
   612        [NW_STAT_SUCCESS]
       
   613                   Success.
       
   614 
       
   615        [NW_STAT_FAILURE]
       
   616                   Failure.
       
   617 
       
   618  ** ----------------------------------------------------------------------- **/
       
   619 IMPORT_C NW_Status_t
       
   620 NW_DOM_TextItem_getExtensionInt(NW_DOM_TextItem_t* item,
       
   621                                 NW_Uint32* x);
       
   622 
       
   623 
       
   624 
       
   625 /** ----------------------------------------------------------------------- **
       
   626     @function:    NW_DOM_TextItem_getOpaque
       
   627 
       
   628     @synopsis:    Returns opaque pointer.
       
   629 
       
   630     @scope:       public
       
   631 
       
   632     @parameters:
       
   633        [in] NW_DOM_TextItem_t* item
       
   634                   The text item.
       
   635 
       
   636        [out] NW_Uint32* opaqueLen
       
   637                   Length of the opaque data.Not set if NULL pointer returned.
       
   638 
       
   639     @description: If TextItem is of type NW_DOM_TEXT_ITEM_OPAQUE returns 
       
   640                   pointer to opaque.
       
   641 
       
   642     @returns:     NW_Byte*
       
   643                   Opaque data if item is of type opaque; otherwise NULL.
       
   644 
       
   645  ** ----------------------------------------------------------------------- **/
       
   646 IMPORT_C NW_Byte*
       
   647 NW_DOM_TextItem_getOpaque(NW_DOM_TextItem_t* item, 
       
   648                           NW_Uint32* opaqueLen);
       
   649 
       
   650 
       
   651 /*  ----------------------------------------------------------------------- **
       
   652     TEXT ITEM ITERATORS - iterate over different text items
       
   653  ** ----------------------------------------------------------------------- **/
       
   654 
       
   655 
       
   656 /** ----------------------------------------------------------------------- **
       
   657     @function:    NW_DOM_TextItemIterator_new
       
   658 
       
   659     @synopsis:    Create new TextItemIterator.
       
   660 
       
   661     @scope:       public
       
   662 
       
   663     @description: Create new TextItemIterator.
       
   664 
       
   665     @returns:     NW_DOM_TextItemIterator_t*
       
   666                   POinter to new iterator.
       
   667 
       
   668  ** ----------------------------------------------------------------------- **/
       
   669 NW_DOM_TextItemIterator_t*
       
   670 NW_DOM_TextItemIterator_new(void);
       
   671 
       
   672 
       
   673 /** ----------------------------------------------------------------------- **
       
   674     @function:    NW_DOM_TextItemIterator_delete
       
   675 
       
   676     @synopsis:    Delete TextItemIterator.
       
   677 
       
   678     @scope:       public
       
   679 
       
   680     @parameters:
       
   681        [in] NW_DOM_TextItemIterator_t* handle
       
   682                   The text item iterator.
       
   683 
       
   684     @description: Delete TextItemIterator.
       
   685 
       
   686     @returns:     NW_Status_t
       
   687                   Status of operation.
       
   688 
       
   689        [NW_STAT_SUCCESS]
       
   690                   Always returns success.
       
   691 
       
   692  ** ----------------------------------------------------------------------- **/
       
   693 NW_Status_t
       
   694 NW_DOM_TextItemIterator_delete(NW_DOM_TextItemIterator_t* handle);
       
   695 
       
   696 
       
   697 /** ----------------------------------------------------------------------- **
       
   698     @function:    NW_DOM_TextNode_getTextItemIterator
       
   699 
       
   700     @synopsis:    Returns TextItemIterator.
       
   701 
       
   702     @scope:       public
       
   703 
       
   704     @parameters:
       
   705        [in] NW_DOM_TextNode_t* node
       
   706                   The text item iterator.
       
   707 
       
   708        [out] NW_DOM_TextItemIterator_t* iterator
       
   709                   Iterator to iterate over the text items in a text node.
       
   710 
       
   711     @description: Returns TextItemIterator.
       
   712 
       
   713     @returns:     NW_Status_t
       
   714                   Status of operation.
       
   715 
       
   716        [NW_STAT_SUCCESS]
       
   717                   Success.
       
   718 
       
   719        [NW_STAT_DOM_NODE_TYPE_ERR]
       
   720                   Node is not a text node.
       
   721 
       
   722   ** ----------------------------------------------------------------------- **/
       
   723 IMPORT_C NW_Status_t
       
   724 NW_DOM_TextNode_getTextItemIterator(NW_DOM_TextNode_t* node, 
       
   725                                     NW_DOM_TextItemIterator_t* iterator);
       
   726 
       
   727 
       
   728 /** ----------------------------------------------------------------------- **
       
   729     @function:    NW_DOM_TextItemIterator_getNextTextItem
       
   730 
       
   731     @synopsis:    Iterates to the next text item.
       
   732 
       
   733     @scope:       public
       
   734 
       
   735     @parameters:
       
   736        [in] NW_DOM_TextItemIterator_t* handle
       
   737                   The text item iterator.
       
   738 
       
   739        [out] NW_DOM_TextItem_t* textItem
       
   740                   Next text item.
       
   741 
       
   742     @description: Iterates to the next text item.
       
   743 
       
   744     @returns:     NW_Status_t
       
   745                   Status of operation.
       
   746 
       
   747        [NW_STAT_WBXML_ITERATE_MORE]
       
   748                   More to be returned.
       
   749 
       
   750        [NW_STAT_WBXML_ITERATE_DONE]
       
   751                   Last item returned.
       
   752 
       
   753  ** ----------------------------------------------------------------------- **/
       
   754 IMPORT_C NW_Status_t
       
   755 NW_DOM_TextItemIterator_getNextTextItem(NW_DOM_TextItemIterator_t* handle, 
       
   756                                         NW_DOM_TextItem_t* textItem);
       
   757 
       
   758 
       
   759 /** ----------------------------------------------------------------------- **
       
   760     @function:    NW_DOM_TextNode_setDataFromTextItem
       
   761 
       
   762     @synopsis:    Sets new data for the given text node. 
       
   763 
       
   764     @scope:       public
       
   765 
       
   766     @parameters:
       
   767        [in-out] NW_DOM_TextNode_t** node
       
   768                   The text node.
       
   769 
       
   770        [in] NW_DOM_TextItem_t* val
       
   771                   Value of the text node.
       
   772 
       
   773     @description: Sets new data for the given text node by creating a new 
       
   774                   TextNode and replaces the previous one.
       
   775 
       
   776     @returns:     NW_Status_t
       
   777                   Status of operation.
       
   778 
       
   779        [NW_STAT_SUCCESS]
       
   780                   Data set.
       
   781 
       
   782        [NW_STAT_BAD_INPUT_PARAM]
       
   783                   Invalid parameter entered.
       
   784 
       
   785        [NW_STAT_DOM_HEIRARCHY_REQUEST_ERR]
       
   786                   Internal error.
       
   787 
       
   788  ** ----------------------------------------------------------------------- **/
       
   789 IMPORT_C NW_Status_t
       
   790 NW_DOM_TextNode_setDataFromTextItem(NW_DOM_TextNode_t** node, 
       
   791                                     NW_DOM_TextItem_t* val);
       
   792 
       
   793 /** ----------------------------------------------------------------------- **
       
   794     @function:    NW_DOM_TextNode_addDataFromTextItem
       
   795 
       
   796     @synopsis:    Adds new data to the given text node.
       
   797 
       
   798     @scope:       public
       
   799 
       
   800     @parameters:
       
   801        [in-out] NW_DOM_TextNode_t* node
       
   802                   The text node.
       
   803 
       
   804        [in] NW_DOM_TextItem_t* val
       
   805                   Value of the text node.
       
   806 
       
   807     @description: Adds new data to the given text node.
       
   808 
       
   809     @returns:     NW_Status_t
       
   810                   Status of operation.
       
   811 
       
   812        [NW_STAT_SUCCESS]
       
   813                   Data set.
       
   814 
       
   815        [NW_STAT_BAD_INPUT_PARAM]
       
   816                   Invalid parameter entered.
       
   817 
       
   818        [NW_STAT_DOM_HEIRARCHY_REQUEST_ERR]
       
   819                   Internal error.
       
   820 
       
   821  ** ----------------------------------------------------------------------- **/
       
   822 IMPORT_C NW_Status_t
       
   823 NW_DOM_TextNode_addDataFromTextItem(NW_DOM_TextNode_t* node,
       
   824                                     NW_DOM_TextItem_t* val);
       
   825 
       
   826 
       
   827 /*  ----------------------------------------------------------------------- **
       
   828     COMMENT_NODE SPECIFIC METHODS - Unsupported
       
   829  ** ----------------------------------------------------------------------- **/
       
   830 
       
   831 
       
   832 /** ----------------------------------------------------------------------- **
       
   833     @function:    NW_DOM_CommentNode_getData
       
   834 
       
   835     @synopsis:    Gets the data associated with the node.
       
   836 
       
   837     @scope:       public
       
   838 
       
   839     @parameters:
       
   840        [in] NW_DOM_CommentNode_t* comment
       
   841                   The comment node.
       
   842 
       
   843        [out] NW_String_t* c
       
   844                   Data for the node.
       
   845 
       
   846     @description: Gets the data associated with the node.
       
   847 
       
   848     @returns:     NW_Status_t
       
   849                   Status of operation.
       
   850 
       
   851        [NW_STAT_SUCCESS]
       
   852                   Data returned.
       
   853 
       
   854        [NW_STAT_BAD_INPUT_PARAM]
       
   855                   Invalid parameter entered.
       
   856 
       
   857        [NW_STAT_DOM_HEIRARCHY_REQUEST_ERR]
       
   858                   Internal error.
       
   859 
       
   860  ** ----------------------------------------------------------------------- **/
       
   861 NW_Status_t
       
   862 NW_DOM_CommentNode_getData(NW_DOM_CommentNode_t* comment, 
       
   863                            NW_String_t* c);
       
   864 
       
   865 
       
   866 /** ----------------------------------------------------------------------- **
       
   867     @function:    NW_DOM_CommentNode_setData
       
   868 
       
   869     @synopsis:    Sets text for node.
       
   870 
       
   871     @scope:       public
       
   872 
       
   873     @parameters:
       
   874        [in] NW_DOM_CommentNode_t* comment
       
   875                   The comment node.
       
   876 
       
   877        [in] NW_String_t* c
       
   878                   Data to set into node.
       
   879 
       
   880     @description: Sets text for node.
       
   881 
       
   882     @returns:     NW_Status_t
       
   883                   Status of operation.
       
   884 
       
   885        [NW_STAT_SUCCESS]
       
   886                   Data set.
       
   887 
       
   888        [NW_STAT_BAD_INPUT_PARAM]
       
   889                   Invalid parameter entered.
       
   890 
       
   891        [NW_STAT_DOM_HEIRARCHY_REQUEST_ERR]
       
   892                   Internal error.
       
   893 
       
   894  ** ----------------------------------------------------------------------- **/
       
   895 NW_Status_t
       
   896 NW_DOM_CommentNode_setData(NW_DOM_CommentNode_t* comment, 
       
   897                            NW_String_t* c);
       
   898 
       
   899 
       
   900 /*  ----------------------------------------------------------------------- **
       
   901     CHARACTER_DATA_NODE SPECIFIC METHODS - Unsupported
       
   902  ** ----------------------------------------------------------------------- **/
       
   903 
       
   904 
       
   905 /** ----------------------------------------------------------------------- **
       
   906     @function:    NW_DOM_CDATASectionNode_getData
       
   907 
       
   908     @synopsis:    Gets the data associated with the node.
       
   909 
       
   910     @scope:       public
       
   911 
       
   912     @parameters:
       
   913        [in] NW_DOM_CDATASectionNode_t* cdata
       
   914                   The CDATA node.
       
   915 
       
   916        [out] NW_String_t* c
       
   917                   Data for the node.
       
   918 
       
   919     @description: Gets the data associated with the node.
       
   920 
       
   921     @returns:     NW_Status_t
       
   922                   Status of operation.
       
   923 
       
   924        [NW_STAT_SUCCESS]
       
   925                   Data returned.
       
   926 
       
   927        [NW_STAT_BAD_INPUT_PARAM]
       
   928                   Invalid parameter entered.
       
   929 
       
   930        [NW_STAT_DOM_HEIRARCHY_REQUEST_ERR]
       
   931                   Internal error.
       
   932 
       
   933  ** ----------------------------------------------------------------------- **/
       
   934 NW_Status_t
       
   935 NW_DOM_CDATASectionNode_getData(NW_DOM_CDATASectionNode_t* cdata, 
       
   936                                 NW_String_t* c);
       
   937 
       
   938 
       
   939 /** ----------------------------------------------------------------------- **
       
   940     @function:    NW_DOM_CDATASectionNode_setData
       
   941 
       
   942     @synopsis:    Sets text for node.
       
   943 
       
   944     @scope:       public
       
   945 
       
   946     @parameters:
       
   947        [in-out] NW_DOM_CDATASectionNode_t* cdata
       
   948                   The CDATA node.
       
   949 
       
   950        [in] NW_String_t* c
       
   951                   Data to set into node.
       
   952 
       
   953     @description: Sets text for node.
       
   954 
       
   955     @returns:     NW_Status_t
       
   956                   Status of operation.
       
   957 
       
   958        [NW_STAT_SUCCESS]
       
   959                   Data set.
       
   960 
       
   961        [NW_STAT_BAD_INPUT_PARAM]
       
   962                   Invalid parameter entered.
       
   963 
       
   964        [NW_STAT_DOM_HEIRARCHY_REQUEST_ERR]
       
   965                   Internal error.
       
   966 
       
   967  ** ----------------------------------------------------------------------- **/
       
   968 NW_Status_t
       
   969 NW_DOM_CDATASectionNode_setData(NW_DOM_CDATASectionNode_t* cdata, 
       
   970                                 NW_String_t* c);
       
   971 
       
   972 
       
   973 #ifdef __cplusplus
       
   974 } /* extern "C" { */
       
   975 #endif /* __cplusplus */
       
   976 
       
   977 #endif  /* NW_DOM_TEXT_H */