Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

mlview-parsing-utils.h

Go to the documentation of this file.
00001 /*
00002  *This file is part of MlView
00003  *
00004  *MlView is free software; you can redistribute it and/or modify it under the terms of 
00005  *the GNU General Public License as published by the Free Software Foundation; either version 2, 
00006  *or (at your option) any later version.
00007  *
00008  *MlView is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
00009  *without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00010  *See the GNU General Public License for more details.
00011  *
00012  *You should have received a copy of the GNU General Public License along with MlView; 
00013  *see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00014  *
00015  *
00016  *Copyright 2001-2002 Dodji Seketeli.
00017  */
00018 
00019 #ifndef __MLVIEW_PARSING_UTILS_H__
00020 #define __MLVIEW_PARSING_UTILS_H__
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif /*__cplusplus*/
00025 
00026 #include <gnome.h>
00027 #include <libxml/tree.h>
00028 #include "mlview-app-context.h"
00029 
00030 
00031         enum NODE_INSERTION_SCHEME {
00032                 /*Insert node before current selected node*/
00033                 INSERT_BEFORE,
00034 
00035                 /*insert node after current selected node*/
00036                 INSERT_AFTER,
00037 
00038                 /*add a child node*/
00039                 ADD_CHILD
00040         };
00041 
00042         enum MLVIEW_PARSING_UTILS_STATUS {
00043                 OK = 0,
00044                 NOK,
00045                 GENERIC_ASSERTION_ERROR,
00046                 /*GENERIC VALUES*/
00047 
00048                 BAD_PARAMETER,
00049                 APP_SETTINGS_NOT_AVAILABLE,
00050                 VALIDATION_IS_OFF,
00051 
00052                 /*function specific values*/
00053 
00054                 NO_SUBTREE_REQUIRED_BY_SCHEMA,
00055                 ELEMENT_DESC_NOT_FOUND,
00056                 ATTRIBUTE_DESC_NOT_FOUND,
00057                 NULL_ELEMENT_CONTENT
00058         } ;
00059 
00060 
00061         typedef struct _MlViewExternalSubsetDefinition MlViewExternalSubsetDefinition ;
00062 /*a data structure to define an external subset.*/
00063         struct _MlViewExternalSubsetDefinition{
00064                 gchar * external_id ; /*the entity public id*/
00065                 gchar * system_id ;
00066                 gchar * root_element_name ;
00067         } ;
00068 
00069         MlViewExternalSubsetDefinition * 
00070         mlview_external_subset_definition_new(const gchar *a_root_element_name,
00071                                               const gchar * a_external_id,
00072                                               const gchar * a_system_id) ;
00073 
00074         void 
00075         mlview_external_subset_definition_destroy (MlViewExternalSubsetDefinition * a_def) ;
00076 
00077         MlViewExternalSubsetDefinition * 
00078         mlview_utils_get_a_copy_of_last_external_subset_def (void) ;
00079 
00080         xmlDoc * 
00081         mlview_parsing_utils_load_xml_file (gchar * a_file_name, 
00082                                             MlViewAppContext *a_app_context) ;
00083 
00084         xmlDtd * 
00085         mlview_parsing_utils_load_a_dtd (MlViewExternalSubsetDefinition * a_subset_def,
00086                                          MlViewAppContext * a_app_context) ;
00087 
00088         gint 
00089         mlview_parsing_utils_validate_dtd (xmlDoc * a_doc, xmlDtd * a_dtd, 
00090                                            MlViewAppContext * a_app_context) ;
00091 
00092         gint 
00093         mlview_parsing_utils_save_xml_doc (xmlDoc * a_xml_doc, gchar * a_file_path,
00094                                            MlViewAppContext * a_app_context);
00095 
00096         MlViewExternalSubsetDefinition  * 
00097         mlview_parsing_utils_let_user_choose_a_dtd (MlViewAppContext * a_app_context,
00098                                                     gchar *a_title) ;
00099 
00100         gint 
00101         mlview_parsing_utils_build_element_name_completion_list (MlViewAppContext *a_app_context,
00102                                                                  enum NODE_INSERTION_SCHEME a_insertion_scheme,
00103                                                                  xmlNode *a_current_xml_node,
00104                                                                  GList ** a_feasible_names_ptr) ;
00105 
00106         gint 
00107         mlview_parsing_utils_build_attribute_name_completion_list (MlViewAppContext *a_app_context,
00108                                                                    xmlNode * a_current_xml_node,
00109                                                                    GList**a_attr_names_compl_list,
00110                                                                    gboolean a_required_attributes_only) ;
00111         
00112         enum MLVIEW_PARSING_UTILS_STATUS
00113         mlview_parsing_utils_get_element_content_table (MlViewAppContext * a_app_context,
00114                                                         xmlElementContent *a_element_content,
00115                                                         GHashTable **a_element_content_table) ;
00116 
00117         enum MLVIEW_PARSING_UTILS_STATUS
00118         mlview_parsing_utils_build_required_children_tree (MlViewAppContext * a_app_context,
00119                                                            xmlNode **a_node) ;
00120 
00121         enum MLVIEW_PARSING_UTILS_STATUS
00122         mlview_parsing_utils_build_required_attributes_list (MlViewAppContext * a_app_context,
00123                                                              xmlNode *a_node) ;
00124 
00125         GList *
00126         mlview_parsing_utils_build_attribute_value_set (MlViewAppContext *a_app_context, 
00127                                                         xmlAttribute * a_attribute_desc,
00128                                                         gint *a_last_id) ;
00129 
00130         GList *
00131         mlview_parsing_utils_build_graphical_attribute_value_set (MlViewAppContext *a_app_context,
00132                                                                   xmlAttribute * a_attribute_desc,
00133                                                                   gint *a_last_id) ;
00134 
00135 #ifdef __cplusplus
00136 }
00137 #endif /*__cplusplus*/
00138 
00139 #endif

Generated on Sat Jul 6 09:57:35 2002 for Gnome-MlView by doxygen1.2.16