#include <libxml/tree.h>
#include <libxml/valid.h>
#include "mlview-xml-document.h"
#include "mlview-parsing-utils.h"
#include "mlview-settings-management.h"
#include "mlview-file-selection.h"
#include "mlview-file-descriptor.h"
#include "mlview-global-settings.h"
#include "utils.h"
Go to the source code of this file.
Data Structures | |
struct | _MlViewXMLDocumentPrivate |
Defines | |
#define | PRIVATE(mlview_xml_doc) (mlview_xml_doc->private) |
#define | MLVIEW_XML_DOCUMENT_DEFAULT_VALIDATION_ON FALSE ; |
#define | MLVIEW_XML_DOCUMENT_NODE_CLIPBOARD_SIZE 128 |
Enumerations | |
enum | { DOCUMENT_CHANGED = 0, NODE_CUT, CHILD_NODE_ADDED, PREV_SIBLING_NODE_INSERTED, NEXT_SIBLING_NODE_INSERTED, CONTENT_CHANGED, NAME_CHANGED, NODE_CHANGED, FILE_PATH_CHANGED, NUMBER_OF_SIGNALS } |
Functions | |
guint | mlview_xml_document_get_type (void) |
MlViewXMLDocument * | mlview_xml_document_new (xmlDocPtr a_xml_doc, MlViewAppContext *a_context) |
void | mlview_xml_document_set_app_context (MlViewXMLDocument *a_doc, MlViewAppContext *a_context) |
MlViewAppContext * | mlview_xml_document_get_app_context (MlViewXMLDocument *a_doc) |
void | mlview_xml_document_copy_node_to_clipboard (xmlNode *a_xml_node, xmlDoc *a_doc) |
Stores the a copy of the xmlNode given in argument into the node clipboard. | |
xmlNode * | mlview_xml_document_get_node_from_clipboard (xmlDoc *a_xml_doc) |
MlViewXMLDocument * | mlview_xml_document_open (gchar *a_file_name, MlViewAppContext *a_context) |
Opens the xml file contains in the filename given in parameter. | |
gint | mlview_xml_document_associate_dtd_interactive (MlViewXMLDocument *a_doc) |
Associates a Dtd to the current xml document. | |
gint | mlview_xml_document_associate_dtd (MlViewXMLDocument *a_doc, MlViewExternalSubsetDefinition *a_ext_subs_def) |
Associates a the dtd designated by a_ext_subs_def to the current xml document. | |
gint | mlview_xml_document_validate (MlViewXMLDocument *a_doc) |
Validates the document agains the dtd that is associated to it. | |
gint | mlview_xml_document_save (MlViewXMLDocument *a_doc) |
gint | mlview_xml_document_save_as (MlViewXMLDocument *a_doc, gchar *a_file_path) |
MlViewXMLDocument * | mlview_xml_document_clone (MlViewXMLDocument *a_original) |
Clones the current instance of MlViewXMLDocument. | |
void | mlview_xml_document_set_file_path (MlViewXMLDocument *a_xml_doc, gchar *a_file_path) |
gchar * | mlview_xml_document_get_file_path (MlViewXMLDocument *a_xml_doc) |
xmlNode * | mlview_xml_document_add_child_node (MlViewXMLDocument *a_xml_doc, xmlNode *a_parent_xml_node, xmlNode *a_xml_node, gboolean a_subtree_required) |
Adds a child node to the a_parent_node node. | |
xmlNode * | mlview_xml_document_cut_node (MlViewXMLDocument *a_xml_doc, xmlNode *a_xml_node) |
Cuts the node a_xml_node. | |
xmlNode * | mlview_xml_document_set_node_content (MlViewXMLDocument *a_xml_document, xmlNode *a_node, gchar *a_content) |
Sets a new content a_content to a_node. | |
xmlNode * | mlview_xml_document_set_node_name (MlViewXMLDocument *a_xml_document, xmlNode *a_node, gchar *a_name) |
Sets the name of a_node to a_name. | |
xmlNode * | mlview_xml_document_insert_prev_sibling_node (MlViewXMLDocument *a_xml_document, xmlNode *a_sibling_node, xmlNode *a_xml_node, gboolean a_subtree_required) |
Inserts a_sibling_node as the previous sibling node of a_xml_node. | |
xmlNode * | mlview_xml_document_insert_next_sibling_node (MlViewXMLDocument *a_xml_document, xmlNode *a_sibling_node, xmlNode *a_xml_node, gboolean a_subtree_required) |
Inserts a_sibling_node as the next sibling of a_xml_node. | |
void | mlview_xml_document_paste_node_as_child (MlViewXMLDocument *a_xml_document, xmlNode *a_parent_node) |
void | mlview_xml_document_paste_node_as_sibling (MlViewXMLDocument *a_xml_document, xmlNode *a_parent_node, xmlNode *a_sibling_node, gboolean a_previous) |
gboolean | mlview_xml_document_needs_saving (MlViewXMLDocument *a_doc) |
MlViewFileDescriptor * | mlview_xml_document_get_file_descriptor (MlViewXMLDocument *a_xml_doc) |
void | mlview_xml_document_set_file_descriptor (MlViewXMLDocument *a_xml_doc, MlViewFileDescriptor *a_file_desc) |
xmlDocPtr | mlview_xml_document_get_xml_document (MlViewXMLDocument *a_xml_doc) |
void | mlview_xml_document_set_xml_document (MlViewXMLDocument *a_doc, xmlDocPtr a_mem_doc) |
|
Definition at line 66 of file mlview-xml-document.c. |
|
Definition at line 79 of file mlview-xml-document.c. |
|
|
Definition at line 52 of file mlview-xml-document.c. |
|
Adds a child node to the a_parent_node node.
Definition at line 713 of file mlview-xml-document.c. References CHILD_NODE_ADDED, DOCUMENT_CHANGED, mlview_app_context_get_settings_value(), mlview_app_context_settings_exist(), MLVIEW_IS_XML_DOCUMENT, mlview_parsing_utils_build_required_attributes_list(), mlview_parsing_utils_build_required_children_tree(), MLVIEW_PARSING_UTILS_STATUS, and PRIVATE. Referenced by mlview_editor_create_new_xml_document(), mlview_tree_editor_add_child_node(), and mlview_xml_document_paste_node_as_child(). |
|
Associates a the dtd designated by a_ext_subs_def to the current xml document. Note that if the document contains is already associated to a dtd, the function asks the user if she wants to overide it. If the user agrees, the functions frees the former dtd and makes the new association. If not, nothing is done.
Definition at line 487 of file mlview-xml-document.c. References mlview_parsing_utils_load_a_dtd(), PRIVATE, and _MlViewExternalSubsetDefinition::system_id. Referenced by mlview_xml_document_associate_dtd_interactive(). |
|
Associates a Dtd to the current xml document. If the document already contains a Dtd, this functions displays a dialog box to ask the user if he wants to overide that Dtd. Depending on the answer of the user, this function does the association or not.
Definition at line 458 of file mlview-xml-document.c. References mlview_parsing_utils_let_user_choose_a_dtd(), mlview_xml_document_associate_dtd(), and PRIVATE. Referenced by mlview_editor_associate_dtd_interactive(), and mlview_editor_create_new_xml_document(). |
|
Clones the current instance of MlViewXMLDocument.
Definition at line 646 of file mlview-xml-document.c. References mlview_file_descriptor_get_file_path(), mlview_xml_document_get_file_descriptor(), mlview_xml_document_open(), and PRIVATE. |
|
Stores the a copy of the xmlNode given in argument into the node clipboard. The cilpboard is a circular buffer. It cannot be overflowed.
Definition at line 379 of file mlview-xml-document.c. Referenced by mlview_tree_editor_copy_node(), and mlview_xml_document_cut_node(). |
|
Cuts the node a_xml_node. The node is stored in the node clipboard and then unlinked from the xml tree.
Definition at line 772 of file mlview-xml-document.c. References DOCUMENT_CHANGED, MLVIEW_IS_XML_DOCUMENT, mlview_xml_document_copy_node_to_clipboard(), NODE_CUT, and PRIVATE. Referenced by mlview_tree_editor_cut_node(). |
|
Definition at line 357 of file mlview-xml-document.c. References PRIVATE. Referenced by mlview_xml_document_view_set_name_interactive(). |
|
Definition at line 1093 of file mlview-xml-document.c. References PRIVATE. Referenced by mlview_xml_document_clone(), mlview_xml_document_needs_saving(), mlview_xml_document_save(), and mlview_xml_document_view_get_file_descriptor(). |
|
Definition at line 694 of file mlview-xml-document.c. References mlview_file_descriptor_get_file_path(), and PRIVATE. Referenced by mlview_editor_get_current_xml_doc_file_path(), and mlview_xml_document_save_as(). |
|
Definition at line 401 of file mlview-xml-document.c. Referenced by mlview_xml_document_paste_node_as_child(), and mlview_xml_document_paste_node_as_sibling(). |
|
Definition at line 280 of file mlview-xml-document.c. |
|
Definition at line 1124 of file mlview-xml-document.c. References PRIVATE. Referenced by mlview_tree_editor_edit_xml_doc(). |
|
Inserts a_sibling_node as the next sibling of a_xml_node.
Definition at line 936 of file mlview-xml-document.c. References DOCUMENT_CHANGED, mlview_app_context_get_settings_value(), mlview_app_context_settings_exist(), MLVIEW_IS_XML_DOCUMENT, mlview_parsing_utils_build_required_attributes_list(), mlview_parsing_utils_build_required_children_tree(), MLVIEW_PARSING_UTILS_STATUS, NEXT_SIBLING_NODE_INSERTED, and PRIVATE. Referenced by mlview_tree_editor_insert_sibling_node(), and mlview_xml_document_paste_node_as_sibling(). |
|
Inserts a_sibling_node as the previous sibling node of a_xml_node.
Definition at line 878 of file mlview-xml-document.c. References DOCUMENT_CHANGED, mlview_app_context_get_settings_value(), mlview_app_context_settings_exist(), MLVIEW_IS_XML_DOCUMENT, mlview_parsing_utils_build_required_attributes_list(), mlview_parsing_utils_build_required_children_tree(), MLVIEW_PARSING_UTILS_STATUS, PREV_SIBLING_NODE_INSERTED, and PRIVATE. Referenced by mlview_tree_editor_insert_sibling_node(), and mlview_xml_document_paste_node_as_sibling(). |
|
Definition at line 1036 of file mlview-xml-document.c. References mlview_file_descriptor_is_modified(), mlview_xml_document_get_file_descriptor(), and PRIVATE. Referenced by mlview_editor_close_xml_document_interactive(). |
|
Definition at line 307 of file mlview-xml-document.c. References MLVIEW_TYPE_XML_DOCUMENT, and PRIVATE. Referenced by mlview_editor_create_new_xml_document(), mlview_editor_edit_xml_document(), and mlview_xml_document_open(). |
|
Opens the xml file contains in the filename given in parameter.
Definition at line 429 of file mlview-xml-document.c. References mlview_parsing_utils_load_xml_file(), mlview_xml_document_new(), and mlview_xml_document_set_file_path(). Referenced by mlview_editor_load_xml_file(), and mlview_xml_document_clone(). |
|
Definition at line 985 of file mlview-xml-document.c. References MLVIEW_IS_XML_DOCUMENT, mlview_xml_document_add_child_node(), mlview_xml_document_get_node_from_clipboard(), and PRIVATE. Referenced by mlview_tree_editor_paste_node_as_child(). |
|
Definition at line 1004 of file mlview-xml-document.c. References MLVIEW_IS_XML_DOCUMENT, mlview_xml_document_get_node_from_clipboard(), mlview_xml_document_insert_next_sibling_node(), mlview_xml_document_insert_prev_sibling_node(), and PRIVATE. Referenced by mlview_tree_editor_paste_node_as_sibling(). |
|
Definition at line 588 of file mlview-xml-document.c. References mlview_file_descriptor_get_file_path(), mlview_parsing_utils_save_xml_doc(), mlview_xml_document_get_file_descriptor(), and PRIVATE. Referenced by mlview_editor_save_xml_document(), and mlview_xml_document_save_as(). |
|
Definition at line 619 of file mlview-xml-document.c. References mlview_xml_document_get_file_path(), mlview_xml_document_save(), and mlview_xml_document_set_file_path(). Referenced by mlview_editor_save_and_close_xml_document(), and mlview_editor_save_xml_document_as(). |
|
Definition at line 337 of file mlview-xml-document.c. References MLVIEW_IS_APP_CONTEXT, and PRIVATE. |
|
Definition at line 1109 of file mlview-xml-document.c. References PRIVATE. |
|
Definition at line 668 of file mlview-xml-document.c. References FILE_PATH_CHANGED, mlview_file_descriptor_new(), mlview_file_descriptor_set_file_path(), and PRIVATE. Referenced by mlview_xml_document_open(), and mlview_xml_document_save_as(). |
|
Sets a new content a_content to a_node.
Definition at line 814 of file mlview-xml-document.c. References CONTENT_CHANGED, DOCUMENT_CHANGED, MLVIEW_IS_XML_DOCUMENT, and NODE_CHANGED. |
|
Sets the name of a_node to a_name.
Definition at line 846 of file mlview-xml-document.c. References DOCUMENT_CHANGED, MLVIEW_IS_XML_DOCUMENT, NAME_CHANGED, and NODE_CHANGED. |
|
Definition at line 1141 of file mlview-xml-document.c. References PRIVATE. |
|
Validates the document agains the dtd that is associated to it.
Definition at line 552 of file mlview-xml-document.c. References mlview_app_context_message(), mlview_app_context_warning(), mlview_parsing_utils_validate_dtd(), and PRIVATE. Referenced by mlview_editor_validate(). |