Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Examples

axiom_node.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004,2005 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef AXIOM_NODE_H
00018 #define AXIOM_NODE_H
00019 
00031 #include <axis2_env.h>
00032 #include <axis2_utils.h>
00033 
00034 
00035 #ifdef __cplusplus
00036 extern "C"
00037 {
00038 #endif
00039 
00040     typedef struct axiom_node axiom_node_t;
00041     struct axiom_node_ops;
00042     struct axiom_output;
00043     struct axiom_document;
00044     struct axiom_stax_builder;
00054     typedef enum axiom_types_t
00055     {
00057         AXIOM_INVALID = 0,
00059         AXIOM_DOCUMENT,
00061         AXIOM_ELEMENT,
00063         AXIOM_DOCTYPE,
00065         AXIOM_COMMENT,
00067         AXIOM_ATTRIBUTE,
00069         AXIOM_NAMESPACE,
00071         AXIOM_PROCESSING_INSTRUCTION,
00073         AXIOM_TEXT
00074     } axiom_types_t;
00075 
00080 AXIS2_DECLARE_DATA   typedef struct axiom_node_ops
00081 {
00088     axis2_status_t (AXIS2_CALL *
00089     free) (axiom_node_t *om_node,
00090            const axis2_env_t *env);
00099     axis2_status_t (AXIS2_CALL *
00100     add_child) (axiom_node_t* om_node,
00101                 const axis2_env_t *env,
00102                 axiom_node_t *child);
00103 
00111     axiom_node_t  *(AXIS2_CALL *
00112     detach) (axiom_node_t  *om_node,
00113              const axis2_env_t *env);
00114 
00122     axis2_status_t (AXIS2_CALL *
00123     insert_sibling_after)(axiom_node_t  *om_node,
00124                           const axis2_env_t *env,
00125                           axiom_node_t  * node_to_insert);
00126 
00134     axis2_status_t (AXIS2_CALL *
00135     insert_sibling_before)(axiom_node_t  *om_node,
00136                            const axis2_env_t *env,
00137                            axiom_node_t  * node_to_insert);
00138 
00147     axis2_status_t (AXIS2_CALL *
00148     serialize)(axiom_node_t  * om_node,
00149                const axis2_env_t *env,
00150               struct axiom_output *om_output);
00151               
00159     axiom_node_t * (AXIS2_CALL *
00160     get_parent)(axiom_node_t  *om_node,
00161                 const axis2_env_t *env);
00162 
00170     axiom_node_t * (AXIS2_CALL *
00171     get_first_child)(axiom_node_t  *om_node,
00172                      const axis2_env_t *env);
00179     axiom_node_t * (AXIS2_CALL *
00180     get_last_child)(axiom_node_t  *om_node,
00181                     const axis2_env_t *env);
00189     axiom_node_t * (AXIS2_CALL *
00190     get_previous_sibling)(axiom_node_t  *om_node,
00191                           const axis2_env_t *env);
00198     axiom_node_t * (AXIS2_CALL *
00199     get_next_sibling)(axiom_node_t  *om_node,
00200                       const axis2_env_t *env);
00209     axiom_types_t (AXIS2_CALL *
00210     get_node_type)(axiom_node_t  *om_node,
00211                    const axis2_env_t *env);
00221     void* (AXIS2_CALL *
00222     get_data_element)(axiom_node_t  *om_node,
00223                       const axis2_env_t *env);    
00231     axis2_bool_t (AXIS2_CALL *
00232     is_complete)(axiom_node_t  *om_node,
00233                       const axis2_env_t *env); 
00242     struct axiom_document* (AXIS2_CALL *
00243     get_document)(axiom_node_t *om_node,
00244                   const axis2_env_t *env);
00245                   
00246     axis2_char_t* (AXIS2_CALL *
00247     to_string)(axiom_node_t *om_node,
00248                const axis2_env_t *env);                  
00249                                                                         
00250 } axiom_node_ops_t;
00251 
00252 
00257     struct axiom_node
00258     {
00260         axiom_node_ops_t *ops;
00261                
00262     };
00263 
00269 AXIS2_EXTERN axiom_node_t * AXIS2_CALL 
00270 axiom_node_create (const axis2_env_t *env);
00271 
00273 #define AXIOM_NODE_FREE_TREE(om_node,env) \
00274         ((om_node)->ops->free(om_node,env))
00275 
00276 #define AXIOM_NODE_ADD_CHILD(om_node, env, child) \
00277         ((om_node)->ops->add_child(om_node, env, child))
00278 
00279 #define AXIOM_NODE_DETACH(om_node,env) \
00280         ((om_node)->ops->detach(om_node,env))
00281 
00282 #define AXIOM_NODE_INSERT_SIBLING_AFTER(om_node,env,node_to_insert) \
00283         ((om_node)->ops->insert_sibling_after(om_node,env,node_to_insert))
00284 
00285 #define AXIOM_NODE_INSERT_SIBLING_BEFORE(om_node,env,node_to_insert) \
00286         ((om_node)->ops->insert_sibling_before(om_node,env,node_to_insert))
00287 
00288 #define AXIOM_NODE_SERIALIZE(om_node,env, om_output) \
00289         ((om_node)->ops->serialize(om_node,env,om_output))
00290 
00291 #define AXIOM_NODE_GET_PARENT(om_node,env) \
00292         ((om_node)->ops->get_parent(om_node,env))
00293 
00294 #define AXIOM_NODE_GET_FIRST_CHILD(om_node,env) \
00295         ((om_node)->ops->get_first_child(om_node,env))
00296 
00297 #define AXIOM_NODE_GET_LAST_CHILD(om_node,env) \
00298         ((om_node)->ops->get_last_child(om_node,env))
00299 
00300 #define AXIOM_NODE_GET_NEXT_SIBLING(om_node,env) \
00301         ((om_node)->ops->get_next_sibling(om_node,env))
00302 
00303 #define AXIOM_NODE_GET_PREVIOUS_SIBLING(om_node,env) \
00304         ((om_node)->ops->get_previous_sibling(om_node,env))
00305 
00307 #define AXIOM_NODE_IS_COMPLETE(om_node,env) \
00308         ((om_node)->ops->is_complete(om_node,env))
00309 
00310 #define AXIOM_NODE_GET_DATA_ELEMENT(om_node,env) \
00311         ((om_node)->ops->get_data_element(om_node,env))
00312 
00313 #define AXIOM_NODE_GET_NODE_TYPE(om_node,env) \
00314         ((om_node)->ops->get_node_type(om_node,env))       
00315 
00316 #define AXIOM_NODE_GET_DOCUMENT(om_node, env) \
00317         ((om_node)->ops->get_document(om_node, env))
00318 
00319 #define AXIOM_NODE_TO_STRING(om_node, env) \
00320         ((om_node)->ops->to_string(om_node, env))        
00321 
00323 #ifdef __cplusplus
00324 }
00325 #endif
00326 
00327 #endif                          /* AXIOM_NODE_H */

Generated on Fri Jun 16 18:02:30 2006 for Axis2/C by  doxygen 1.4.2