Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

mlview-xml-document.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_XML_DOCUMENT_H__
00020 #define __MLVIEW_XML_DOCUMENT_H__
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif /*__cplusplus*/
00025 
00026 #include <libxml/tree.h>
00027 #include <gnome.h>
00028 
00029 #include "mlview-app-context.h"
00030 #include "mlview-file-descriptor.h"
00031 #include "mlview-parsing-utils.h"
00032 
00033 
00034 #define MLVIEW_TYPE_XML_DOCUMENT (mlview_xml_document_get_type ())
00035 #define MLVIEW_XML_DOCUMENT(object) (GTK_CHECK_CAST ((object), MLVIEW_TYPE_XML_DOCUMENT, MlViewXMLDocument))
00036 #define MLVIEW_XML_DOCUMENT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), MLVIEW_TYPE_XML_DOCUMENT, MlViewXMLDocumentClass))
00037 #define MLVIEW_IS_XML_DOCUMENT(object) (GTK_CHECK_TYPE ((object), MLVIEW_TYPE_XML_DOCUMENT))
00038 #define MLVIEW_IS_XML_DOCUMENT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), MLVIEW_TYPE_XML_DOCUMENT))
00039 
00040         typedef struct _MlViewXMLDocument MlViewXMLDocument ;
00041         typedef struct _MlViewXMLDocumentClass MlViewXMLDocumentClass ;
00042         typedef struct _MlViewXMLDocumentPrivate MlViewXMLDocumentPrivate ;
00043 
00044         struct _MlViewXMLDocument {
00045                 GtkObject object ;
00046                 MlViewXMLDocumentPrivate *private;
00047         } ;
00048 
00049         struct _MlViewXMLDocumentClass {
00050                 GtkObjectClass parent_class ;
00051 
00052                 /*Tree Edition signals*/
00053                 void (*document_changed) (MlViewXMLDocument * a_xml_doc,
00054                                           gpointer a_user_data) ;
00055 
00056                 void (*node_cut) (MlViewXMLDocument * a_xml_doc,
00057                                   xmlNode *a_parent_node,
00058                                   xmlNode * a_cut_node,
00059                                   gpointer a_user_data) ;
00060 
00061                 void (*prev_sibling_node_inserted) (MlViewXMLDocument *a_xml_doc,
00062                                                     xmlNode *a_sibling_node,
00063                                                     xmlNode *a_inserted_node,
00064                                                     gpointer a_user_data) ;
00065                 
00066                 void (*next_sibling_node_inserted) (MlViewXMLDocument *a_xml_doc,
00067                                                     xmlNode *a_sibling_node,
00068                                                     xmlNode *a_inserted_node,
00069                                                     gpointer a_user_data) ;
00070 
00071                 void  (*child_node_added) (MlViewXMLDocument * a_xml_doc,
00072                                            xmlNode *a_parent_node,
00073                                            xmlNode * a_added_node,
00074                                            gpointer a_user_data) ;
00075 
00076                 void (*content_changed) (MlViewXMLDocument *a_xml_doc,
00077                                          xmlNode *a_node,
00078                                          gpointer a_user_data) ;
00079 
00080                 void (*name_changed) (MlViewXMLDocument *a_xml_doc,
00081                                          xmlNode *a_node,
00082                                          gpointer a_user_data) ;
00083 
00084                 void (*node_changed) (MlViewXMLDocument *a_xml_doc,
00085                                       xmlNode *a_node,
00086                                       gpointer a_user_data) ;
00087                 
00088                 void (*file_path_changed) (MlViewXMLDocument *a_xml_doc,
00089                                            gpointer a_user_data) ;
00090                 
00091 
00092         } ;
00093 
00094         guint 
00095         mlview_xml_document_get_type (void) ;
00096 
00097         xmlNode *
00098         mlview_xml_document_set_node_content (MlViewXMLDocument * a_xml_document,
00099                                               xmlNode *a_node, gchar * a_content) ;
00100 
00101         xmlNode *
00102         mlview_xml_document_set_node_name (MlViewXMLDocument * a_xml_document,
00103                                            xmlNode *a_node, gchar * a_name);
00104         MlViewXMLDocument * 
00105         mlview_xml_document_new (xmlDocPtr a_xml_doc, MlViewAppContext *a_context) ;    
00106 
00107         MlViewXMLDocument *  
00108         mlview_xml_document_open (gchar * a_file_name, MlViewAppContext *a_context) ;
00109 
00110         MlViewXMLDocument* 
00111         mlview_xml_document_clone (MlViewXMLDocument *a_original) ;
00112 
00113         MlViewFileDescriptor * 
00114         mlview_xml_document_get_file_descriptor (MlViewXMLDocument *a_xml_doc) ;
00115 
00116         xmlNode *
00117         mlview_xml_document_set_node_content (MlViewXMLDocument * a_xml_document,
00118                                               xmlNode *a_node, gchar * a_content) ;
00119 
00120         void 
00121         mlview_xml_document_set_file_descriptor (MlViewXMLDocument *a_xml_doc, 
00122                                                  MlViewFileDescriptor *a_file_desc) ;
00123 
00124         void 
00125         mlview_xml_document_set_file_path (MlViewXMLDocument *a_xml_doc,
00126                                            gchar *a_file_path) ;
00127 
00128         gchar * 
00129         mlview_xml_document_get_file_path (MlViewXMLDocument *a_xml_doc) ;
00130 
00131         MlViewAppContext *
00132         mlview_xml_document_get_app_context (MlViewXMLDocument * a_doc)  ;
00133         
00134         void
00135         mlview_xml_document_set_app_context (MlViewXMLDocument * a_doc, 
00136                                              MlViewAppContext * a_context) ;
00137 
00138         xmlDocPtr 
00139         mlview_xml_document_get_xml_document (MlViewXMLDocument *a_xml_doc) ;
00140 
00141         void 
00142         mlview_xml_document_set_xml_document (MlViewXMLDocument *a_doc, 
00143                                               xmlDocPtr a_mem_doc) ;
00144 
00145         void 
00146         mlview_xml_document_set_app_context (MlViewXMLDocument * a_doc, 
00147                                                   MlViewAppContext * a_context) ;
00148 
00149         gint 
00150         mlview_xml_document_associate_dtd_interactive (MlViewXMLDocument * a_doc) ;
00151 
00152         gint 
00153         mlview_xml_document_associate_dtd ( MlViewXMLDocument * a_doc,
00154                                             MlViewExternalSubsetDefinition * a_ext_subs_def) ;
00155 
00156         gint 
00157         mlview_xml_document_validate (MlViewXMLDocument * a_doc) ;
00158 
00159         gboolean 
00160         mlview_xml_document_needs_saving (MlViewXMLDocument *a_doc) ;
00161 
00162         gint 
00163         mlview_xml_document_save (MlViewXMLDocument * a_doc) ;
00164 
00165         gint 
00166         mlview_xml_document_save_as (MlViewXMLDocument *a_doc, 
00167                                      gchar * a_file_path) ;
00168 
00169 
00170 /**************************************
00171  *Document Edition interfaces.
00172  ***************************************/
00173         void mlview_xml_document_copy_node_to_clipboard (xmlNode *a_xml_node, 
00174                                                          xmlDoc *a_doc) ;
00175 
00176         xmlNode * mlview_xml_document_add_child_node (MlViewXMLDocument *a_xml_doc,
00177                                                       xmlNode *a_parent_xml_node,
00178                                                       xmlNode *a_xml_node, 
00179                                                       gboolean a_subtree_required) ;
00180 
00181         xmlNode * mlview_xml_document_cut_node (MlViewXMLDocument * a_xml_doc, 
00182                                                 xmlNode * a_xml_node) ;
00183 
00184         xmlNode * mlview_xml_document_insert_prev_sibling_node (MlViewXMLDocument *a_xml_document,
00185                                                                 xmlNode *a_sibling_node, xmlNode *a_xml_node,
00186                                                                 gboolean a_subtree_required) ;
00187 
00188         xmlNode * mlview_xml_document_insert_next_sibling_node (MlViewXMLDocument *a_xml_document,
00189                                                                 xmlNode *a_sibling_node, xmlNode *a_xml_node,
00190                                                                 gboolean a_subtree_required) ;
00191 
00192         void mlview_xml_document_paste_node_as_child (MlViewXMLDocument *a_xml_document,
00193                                                       xmlNode *a_parent_node) ;
00194 
00195         void mlview_xml_document_paste_node_as_sibling (MlViewXMLDocument * a_xml_document, xmlNode *a_parent_node,
00196                                                         xmlNode * a_sibling_node, gboolean a_previous) ;
00197 
00198 /*edition functions*/
00199 #ifdef __cplusplus
00200 }
00201 #endif /*__cplusplus*/
00202 #endif

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