axiom_node.h

Go to the documentation of this file.
00001 /*
00002  * Licensed to the Apache Software Foundation (ASF) under one or more
00003  * contributor license agreements.  See the NOTICE file distributed with
00004  * this work for additional information regarding copyright ownership.
00005  * The ASF licenses this file to You under the Apache License, Version 2.0
00006  * (the "License"); you may not use this file except in compliance with
00007  * the License.  You may obtain a copy of the License at
00008  *
00009  *      http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef AXIOM_NODE_H
00019 #define AXIOM_NODE_H
00020 
00038 #include <axis2_env.h>
00039 #include <axis2_utils.h>
00040 
00041 
00042 #ifdef __cplusplus
00043 extern "C"
00044 {
00045 #endif
00046 
00047     typedef struct axiom_node axiom_node_t;
00048     struct axiom_node_ops;
00049     struct axiom_output;
00050     struct axiom_document;
00051     struct axiom_stax_builder;
00061     typedef enum axiom_types_t
00062     {
00064         AXIOM_INVALID = 0,
00066         AXIOM_DOCUMENT,
00068         AXIOM_ELEMENT,
00070         AXIOM_DOCTYPE,
00072         AXIOM_COMMENT,
00074         AXIOM_ATTRIBUTE,
00076         AXIOM_NAMESPACE,
00078         AXIOM_PROCESSING_INSTRUCTION,
00080         AXIOM_TEXT
00081     } axiom_types_t;
00082 
00087    typedef struct axiom_node_ops
00088 {
00095     axis2_status_t (AXIS2_CALL *
00096     free) (axiom_node_t *om_node,
00097            const axis2_env_t *env);
00106     axis2_status_t (AXIS2_CALL *
00107     add_child) (axiom_node_t* om_node,
00108                 const axis2_env_t *env,
00109                 axiom_node_t *child);
00110 
00118     axiom_node_t  *(AXIS2_CALL *
00119     detach) (axiom_node_t  *om_node,
00120              const axis2_env_t *env);
00121 
00129     axis2_status_t (AXIS2_CALL *
00130     insert_sibling_after)(axiom_node_t  *om_node,
00131                           const axis2_env_t *env,
00132                           axiom_node_t  * node_to_insert);
00133 
00141     axis2_status_t (AXIS2_CALL *
00142     insert_sibling_before)(axiom_node_t  *om_node,
00143                            const axis2_env_t *env,
00144                            axiom_node_t  * node_to_insert);
00145 
00154     axis2_status_t (AXIS2_CALL *
00155     serialize)(axiom_node_t  * om_node,
00156                const axis2_env_t *env,
00157               struct axiom_output *om_output);
00158               
00166     axiom_node_t * (AXIS2_CALL *
00167     get_parent)(axiom_node_t  *om_node,
00168                 const axis2_env_t *env);
00169 
00177     axiom_node_t * (AXIS2_CALL *
00178     get_first_child)(axiom_node_t  *om_node,
00179                      const axis2_env_t *env);
00186     axiom_node_t * (AXIS2_CALL *
00187     get_last_child)(axiom_node_t  *om_node,
00188                     const axis2_env_t *env);
00196     axiom_node_t * (AXIS2_CALL *
00197     get_previous_sibling)(axiom_node_t  *om_node,
00198                           const axis2_env_t *env);
00205     axiom_node_t * (AXIS2_CALL *
00206     get_next_sibling)(axiom_node_t  *om_node,
00207                       const axis2_env_t *env);
00216     axiom_types_t (AXIS2_CALL *
00217     get_node_type)(axiom_node_t  *om_node,
00218                    const axis2_env_t *env);
00228     void* (AXIS2_CALL *
00229     get_data_element)(axiom_node_t  *om_node,
00230                       const axis2_env_t *env);    
00238     axis2_bool_t (AXIS2_CALL *
00239     is_complete)(axiom_node_t  *om_node,
00240                       const axis2_env_t *env); 
00249     struct axiom_document* (AXIS2_CALL *
00250     get_document)(axiom_node_t *om_node,
00251                   const axis2_env_t *env);
00252                   
00253     axis2_char_t* (AXIS2_CALL *
00254     to_string)(axiom_node_t *om_node,
00255                const axis2_env_t *env);                  
00256                                                                         
00257 } axiom_node_ops_t;
00258 
00259 
00264     struct axiom_node
00265     {
00267         axiom_node_ops_t *ops;
00268                
00269     };
00270 
00276 AXIS2_EXTERN axiom_node_t * AXIS2_CALL 
00277 axiom_node_create (const axis2_env_t *env);
00278 
00280 #define AXIOM_NODE_FREE_TREE(om_node,env) \
00281         ((om_node)->ops->free(om_node,env))
00282 
00283 #define AXIOM_NODE_ADD_CHILD(om_node, env, child) \
00284         ((om_node)->ops->add_child(om_node, env, child))
00285 
00286 #define AXIOM_NODE_DETACH(om_node,env) \
00287         ((om_node)->ops->detach(om_node,env))
00288 
00289 #define AXIOM_NODE_INSERT_SIBLING_AFTER(om_node,env,node_to_insert) \
00290         ((om_node)->ops->insert_sibling_after(om_node,env,node_to_insert))
00291 
00292 #define AXIOM_NODE_INSERT_SIBLING_BEFORE(om_node,env,node_to_insert) \
00293         ((om_node)->ops->insert_sibling_before(om_node,env,node_to_insert))
00294 
00295 #define AXIOM_NODE_SERIALIZE(om_node,env, om_output) \
00296         ((om_node)->ops->serialize(om_node,env,om_output))
00297 
00298 #define AXIOM_NODE_GET_PARENT(om_node,env) \
00299         ((om_node)->ops->get_parent(om_node,env))
00300 
00301 #define AXIOM_NODE_GET_FIRST_CHILD(om_node,env) \
00302         ((om_node)->ops->get_first_child(om_node,env))
00303 
00304 #define AXIOM_NODE_GET_LAST_CHILD(om_node,env) \
00305         ((om_node)->ops->get_last_child(om_node,env))
00306 
00307 #define AXIOM_NODE_GET_NEXT_SIBLING(om_node,env) \
00308         ((om_node)->ops->get_next_sibling(om_node,env))
00309 
00310 #define AXIOM_NODE_GET_PREVIOUS_SIBLING(om_node,env) \
00311         ((om_node)->ops->get_previous_sibling(om_node,env))
00312 
00314 #define AXIOM_NODE_IS_COMPLETE(om_node,env) \
00315         ((om_node)->ops->is_complete(om_node,env))
00316 
00317 #define AXIOM_NODE_GET_DATA_ELEMENT(om_node,env) \
00318         ((om_node)->ops->get_data_element(om_node,env))
00319 
00320 #define AXIOM_NODE_GET_NODE_TYPE(om_node,env) \
00321         ((om_node)->ops->get_node_type(om_node,env))       
00322 
00323 #define AXIOM_NODE_GET_DOCUMENT(om_node, env) \
00324         ((om_node)->ops->get_document(om_node, env))
00325 
00326 #define AXIOM_NODE_TO_STRING(om_node, env) \
00327         ((om_node)->ops->to_string(om_node, env))        
00328 
00330 #ifdef __cplusplus
00331 }
00332 #endif
00333 
00334 #endif                          /* AXIOM_NODE_H */

Generated on Wed Dec 20 20:14:09 2006 for Axis2/C by  doxygen 1.5.1