xml_schema_facet.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 XML_SCHEMA_FACET_H
00019 #define XML_SCHEMA_FACET_H
00020 
00028 #include <xml_schema_annotated.h>
00029 #include <xml_schema_defines.h>
00030 #include <axiom_element.h>
00031 #include <axiom_node.h>
00032 #include <axis2_hash.h>
00033 
00038 #ifdef __cplusplus
00039 extern "C"
00040 {
00041 #endif
00042 
00043 typedef struct xml_schema_facet 
00044                     xml_schema_facet_t;
00045 typedef struct xml_schema_facet_ops 
00046                     xml_schema_facet_ops_t;
00047 
00048 struct xml_schema_facet_ops
00049 {
00054     axis2_status_t (AXIS2_CALL *
00055     free) (void *facet,
00056             const axis2_env_t *env);
00057 
00058     xml_schema_annotated_t *(AXIS2_CALL *
00059     get_base_impl) (void *facet,
00060                     const axis2_env_t *env);
00061     
00062     xml_schema_types_t (AXIS2_CALL*
00063     get_type)(void *facet,
00064           const axis2_env_t *env);
00065           
00066     axis2_hash_t* (AXIS2_CALL *
00067     super_objs)(void *facet,
00068                 const axis2_env_t *env);          
00069 
00070     axis2_bool_t (AXIS2_CALL *
00071     is_fixed)(void *facet,
00072                 const axis2_env_t *env);
00073     
00074     axis2_status_t (AXIS2_CALL *
00075     set_fixed)(void *facet,
00076                     const axis2_env_t *env,
00077                     axis2_bool_t fixed);
00078     
00079     axis2_char_t *(AXIS2_CALL *
00080     get_value)(void *facet,
00081                const axis2_env_t *env);
00082     
00083     axis2_status_t (AXIS2_CALL *
00084     set_value)(void *facet,
00085                const axis2_env_t *env,
00086                axis2_char_t *value);
00087     
00088     axis2_status_t (AXIS2_CALL *
00089     set_facet_type)(void *facet,
00090                     const axis2_env_t *env,
00091                     int facet_type);                    
00092     
00093 };
00094 
00095 struct xml_schema_facet
00096 {
00097     xml_schema_annotated_t base;
00098     xml_schema_facet_ops_t *ops;
00099 };
00100 
00104 AXIS2_EXTERN xml_schema_facet_t * AXIS2_CALL
00105 xml_schema_facet_create(const axis2_env_t *env,
00106                               axis2_char_t *value,
00107                               axis2_bool_t fixed,
00108                               xml_schema_types_t type);
00109 
00110 AXIS2_EXTERN xml_schema_facet_t * AXIS2_CALL
00111 xml_schema_facet_construct(const axis2_env_t *env,
00112                                  axiom_node_t *node);
00113                                                                  
00114 /************************* macros *********************************************/
00115 
00116 #define XML_SCHEMA_FACET_FREE(facet, env) \
00117       (((xml_schema_facet_t *) facet)->ops->\
00118             free(facet, env))
00119 
00120 #define XML_SCHEMA_FACET_GET_BASE_IMPL(facet, env) \
00121       (((xml_schema_facet_t *) facet)->ops->\
00122             get_base_impl(facet, env))
00123 
00124 #define XML_SCHEMA_FACET_GET_TYPE(facet, env) \
00125       (((xml_schema_facet_t *) facet)->ops->\
00126             get_type(facet, env))
00127 
00128 #define XML_SCHEMA_FACET_SUPER_OBJS(facet, env) \
00129         (((xml_schema_facet_t *) facet)->ops->\
00130             super_objs(facet, env))
00131 
00132 #define XML_SCHEMA_FACET_IS_FIXED(facet, env) \
00133       (((xml_schema_facet_t *) facet)->ops->\
00134             is_fixed(facet, env))
00135 
00136 #define XML_SCHEMA_FACET_SET_FIXED(facet, env, fixed) \
00137       (((xml_schema_facet_t *) facet)->ops->\
00138             set_fixed(facet, env, fixed))
00139 
00140 #define XML_SCHEMA_FACET_GET_VALUE(facet, env) \
00141       (((xml_schema_facet_t *) facet)->ops->\
00142             get_value(facet, env))
00143 
00144 #define XML_SCHEMA_FACET_SET_VALUE(facet, env, value) \
00145       (((xml_schema_facet_t *) facet)->ops->\
00146             set_value(facet, env, value))
00147             
00148 #define XML_SCHEMA_FACET_SET_FACET_TYPE(facet, env, facet_type) \
00149         (((xml_schema_facet_t *) facet)->ops->\
00150             set_facet_type(facet, env, facet_type))
00151             
00152 /*************************** macros ************************************************/
00154 #ifdef __cplusplus
00155 }
00156 #endif
00157 #endif /* XML_SCHEMA_FACET_H */

Generated on Wed Dec 20 20:34:51 2006 for Axis2/C by  doxygen 1.5.1