xml_schema_attribute.h

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 XML_SCHEMA_ATTRIBUTE_H
00018 #define XML_SCHEMA_ATTRIBUTE_H
00019 
00028 #include <axis2_qname.h>
00029 #include <xml_schema_particle.h>
00030 #include <xml_schema_form.h>
00031 #include <xml_schema_use.h>
00032 #include <xml_schema_content_processing.h>
00033 #include <xml_schema_simple_type.h>
00034 
00035 
00042 #ifdef __cplusplus
00043 extern "C"
00044 {
00045 #endif
00046 
00047 
00048 typedef struct xml_schema_attribute 
00049                     xml_schema_attribute_t;
00050 typedef struct xml_schema_attribute_ops 
00051                 xml_schema_attribute_ops_t;
00052 
00053 struct xml_schema_attribute_ops
00054 {
00055     axis2_status_t (AXIS2_CALL *
00056     free) (
00057             void *attr,
00058             const axis2_env_t *env);
00059             
00060     xml_schema_types_t (AXIS2_CALL *
00061     get_type)(
00062             void *attr,
00063             const axis2_env_t *env);
00064           
00065     axis2_hash_t* (AXIS2_CALL *
00066     super_objs)(
00067             void *attr,
00068             const axis2_env_t *env);
00069                                       
00070 
00071     xml_schema_annotated_t *(AXIS2_CALL *
00072     get_base_impl)(
00073             void *attr,
00074             const axis2_env_t *env);
00075     
00076     void *(AXIS2_CALL *
00077     get_attr_type)(
00078             void *attr,
00079             const axis2_env_t *env);
00080 
00081     axis2_char_t *(AXIS2_CALL *
00082     get_default_value)(
00083             void *attr,
00084             const axis2_env_t *env);                        
00085 
00086     axis2_status_t (AXIS2_CALL *
00087     set_default_value)(
00088             void *attr,
00089             const axis2_env_t *env,
00090             axis2_char_t *default_value);  
00091     
00092     axis2_char_t* (AXIS2_CALL *
00093     get_fixed_value)(void *attr,
00094                         const axis2_env_t *env);
00095 
00096     axis2_status_t (AXIS2_CALL *
00097     set_fixed_value)(void *attr,
00098                      const axis2_env_t *env,
00099                      axis2_char_t *fixed_value);
00100 
00101     struct xml_schema_form *(AXIS2_CALL *
00102     get_schema_form) (void *attr,
00103                       const axis2_env_t *env);
00104 
00105     axis2_status_t (AXIS2_CALL *
00106     set_schema_form)(void *attr,
00107                      const axis2_env_t *env,
00108                      xml_schema_form_t *schema_form);
00109                      
00110     axis2_qname_t* (AXIS2_CALL *
00111     get_qname)(void *attr,
00112                const axis2_env_t *env);
00113                
00114     axis2_status_t (AXIS2_CALL *
00115     set_qname)(void *attr,
00116                const axis2_env_t *env,
00117                axis2_qname_t *qualified_name);
00118                
00119     axis2_char_t* (AXIS2_CALL *
00120     get_name)(void *attr,
00121               const axis2_env_t *env);
00122               
00123     axis2_status_t (AXIS2_CALL *
00124     set_name)(void *attr,
00125               const axis2_env_t *env,
00126               axis2_char_t *name);
00127               
00128     axis2_qname_t* (AXIS2_CALL *
00129     get_ref_name)(void *attr,
00130                   const axis2_env_t *env);
00131                                               
00132     axis2_status_t (AXIS2_CALL *
00133     set_ref_name)(void *attr,
00134                   const axis2_env_t *env,
00135                   axis2_qname_t *ref_name);
00136                   
00137     xml_schema_simple_type_t* (AXIS2_CALL *
00138     get_schema_type)(void *attr,
00139                      const axis2_env_t *env);
00140                      
00141     axis2_status_t (AXIS2_CALL *
00142     set_schema_type)(void *attr,
00143                      const axis2_env_t *env,
00144                      xml_schema_simple_type_t* sch_type);                     
00145                      
00146     axis2_qname_t* (AXIS2_CALL *
00147     get_schema_type_name)(void *attr,
00148                           const axis2_env_t *env);
00149                           
00150                               
00151     axis2_status_t (AXIS2_CALL *
00152     set_schema_type_name)(void *attr,
00153                           const axis2_env_t *env,
00154                           axis2_qname_t *sch_type_name);
00155                           
00156     xml_schema_use_t* (AXIS2_CALL *
00157     get_use)(void *attr,
00158              const axis2_env_t *env);
00159              
00160     axis2_status_t (AXIS2_CALL *
00161     set_use)(void *attr,
00162              const axis2_env_t *env,
00163              xml_schema_use_t *use);
00164              
00165     axis2_char_t* (AXIS2_CALL*
00166     to_string)(void *attr,
00167                const axis2_env_t *env,
00168                axis2_char_t *prefix,
00169                int tab);                          
00170 };
00171 
00172 struct xml_schema_attribute
00173 {
00174     xml_schema_annotated_t base;
00175     xml_schema_attribute_ops_t *ops;
00176 };
00177 
00178 AXIS2_EXTERN xml_schema_attribute_t * AXIS2_CALL
00179 xml_schema_attribute_create(const axis2_env_t *env);
00180 
00181 
00182 /******************************* Macros *************************************************/ 
00183  
00184 #define XML_SCHEMA_ATTRIBUTE_FREE(attr, env) \
00185       (((xml_schema_attribute_t *) attr)->ops->free(attr, env))
00186 
00187 #define XML_SCHEMA_ATTRIBUTE_GET_BASE_IMPL(attr, env) \
00188       (((xml_schema_attribute_t *) attr)->ops->get_base_impl(attr, env))
00189 
00190 #define XML_SCHEMA_ATTRIBUTE_GET_TYPE(attr, env) \
00191       (((xml_schema_attribute_t *) attr)->ops->get_type(attr, env))
00192       
00193 #define XML_SCHEMA_ATTRIBUTE_SUPER_OBJS(attr, env) \
00194       (((xml_schema_attribute_t *) attr)->ops->super_objs(attr, env))
00195       
00196 
00197 #define XML_SCHEMA_ATTRIBUTE_GET_ATTR_TYPE(attr, env) \
00198       (((xml_schema_attribute_t *) attr)->ops->get_namespace(attr, env))
00199 
00200 #define XML_SCHEMA_ATTRIBUTE_GET_DEFAULT_VALUE(attr, env) \
00201       (((xml_schema_attribute_t *) attr)->ops->\
00202           get_default_value(attr, env))
00203 
00204 #define XML_SCHEMA_ATTRIBUTE_SET_DEFAULT_VALUE(attr, env, default_val) \
00205       (((xml_schema_attribute_t *) attr)->ops->\
00206           set_default_value(attr, env, default_val))
00207 
00208 #define XML_SCHEMA_ATTRIBUTE_GET_FIXED_VALUE(attr, env) \
00209       (((xml_schema_attribute_t *) attr)->ops->\
00210           get_fixed_value(attr, env))
00211 
00212 #define XML_SCHEMA_ATTRIBUTE_SET_FIXED_VALUE(attr, env, default_val) \
00213       (((xml_schema_attribute_t *) attr)->ops->\
00214           set_fixed_value(attr, env, default_val))
00215 
00216 #define XML_SCHEMA_ATTRIBUTE_GET_SCHEMA_FORM(attr, env) \
00217       (((xml_schema_attribute_t *) attr)->ops->\
00218           get_schema_form(attr, env))
00219 
00220 #define XML_SCHEMA_ATTRIBUTE_SET_SCHEMA_FORM(attr, env, form) \
00221       (((xml_schema_attribute_t *) attr)->ops->\
00222           set_schema_form(attr, env, form))
00223 
00224 #define XML_SCHEMA_ATTRIBUTE_GET_QNAME(attr, env) \
00225       (((xml_schema_attribute_t *) attr)->ops->\
00226           get_qname(attr, env))
00227 
00228 #define XML_SCHEMA_ATTRIBUTE_SET_QNAME(attr, env, qualified_name) \
00229       (((xml_schema_attribute_t *) attr)->ops->\
00230           set_qname(attr, env, qualified_name))
00231           
00232 #define XML_SCHEMA_ATTRIBUTE_GET_NAME(attr, env) \
00233       (((xml_schema_attribute_t *) attr)->ops->\
00234           get_name(attr, env))
00235           
00236 #define XML_SCHEMA_ATTRIBUTE_SET_NAME(attr, env, name) \
00237       (((xml_schema_attribute_t *) attr)->ops->\
00238           set_name(attr, env, name))
00239 
00240 #define XML_SCHEMA_ATTRIBUTE_GET_REF_NAME(attr, env) \
00241       (((xml_schema_attribute_t *) attr)->ops->\
00242           get_ref_name(attr, env))
00243           
00244 #define XML_SCHEMA_ATTRIBUTE_SET_REF_NAME(attr, env, ref_name) \
00245       (((xml_schema_attribute_t *) attr)->ops->\
00246           set_ref_name(attr, env, ref_name))
00247 
00248 #define XML_SCHEMA_ATTRIBUTE_GET_SCHEMA_TYPE(attr, env) \
00249       (((xml_schema_attribute_t *) attr)->ops->\
00250           get_schema_type(attr, env))
00251           
00252 #define XML_SCHEMA_ATTRIBUTE_SET_SCHEMA_TYPE(attr, env, sch_type) \
00253       (((xml_schema_attribute_t *) attr)->ops->\
00254           set_schema_type(attr, env, sch_type))
00255           
00256 #define XML_SCHEMA_ATTRIBUTE_GET_SCHEMA_TYPE_NAME(attr, env) \
00257       (((xml_schema_attribute_t *) attr)->ops->\
00258           get_schema_type_name(attr, env))
00259 
00260 #define XML_SCHEMA_ATTRIBUTE_SET_SCHEMA_TYPE_NAME(attr, env, sch_type_name) \
00261       (((xml_schema_attribute_t *) attr)->ops->\
00262           set_schema_type_name(attr, env, sch_type_name))
00263           
00264 #define XML_SCHEMA_ATTRIBUTE_GET_USE(attr, env) \
00265       (((xml_schema_attribute_t *) attr)->ops->\
00266           get_use(attr, env))
00267 
00268 #define XML_SCHEMA_ATTRIBUTE_SET_USE(attr, env, use) \
00269       (((xml_schema_attribute_t *) attr)->ops->\
00270           set_schema_type_name(attr, env, use))   
00271           
00272 #define XML_SCHEMA_ATTRIBUTE_TO_STRING(attr, env, prefix, tab) \
00273       (((xml_schema_attribute_t *) attr)->ops->\
00274           to_string(attr, env, prefix, tab))   
00275                  
00276 
00277 /******************************* end macros ***********************************************/
00279 #ifdef __cplusplus
00280 }
00281 #endif
00282 #endif /* XML_SCHEMA_ATTRIBUTE_H */

Generated on Thu Oct 26 21:11:25 2006 for Axis2/C by  doxygen 1.4.7