summaryrefslogtreecommitdiffstats
path: root/plug-ins/metadata/metadata-xml.h
blob: 12ac77b2e35b896fa9be8eeb51a6c5baa2e4079e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/* GIMP - The GNU Image Manipulation Program
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
 * Copyright (C) 2016, 2017 Ben Touchette
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef __METADATA_XML_H__
#define __METADATA_XML_H__

#include "metadata-misc.h"

struct _GimpXmlParser
{
  GMarkupParseContext *context;
};

typedef struct _GimpXmlParser GimpXmlParser;

void
xml_parser_start_element                     (GMarkupParseContext   *context,
                                              const gchar           *element_name,
                                              const gchar          **attribute_names,
                                              const gchar          **attribute_values,
                                              gpointer               user_data,
                                              GError               **error);

void
xml_parser_data                              (GMarkupParseContext  *context,
                                              const gchar          *text,
                                              gsize                 text_len,
                                              gpointer              user_data,
                                              GError              **error);

void
set_tag_ui                                   (metadata_editor      *args,
                                              int                   index,
                                              gchar                *name,
                                              gchar                *value,
                                              gchar                *mode);

const gchar *
get_tag_ui_text                              (metadata_editor      *args,
                                              gchar                *name,
                                              gchar                *mode);

gchar *
get_tag_ui_list                              (metadata_editor      *args,
                                              gchar                *name,
                                              gchar                *mode);

gint
get_tag_ui_combo                             (metadata_editor      *args,
                                              gchar                *name,
                                              gchar                *mode);

void
xml_parser_end_element                       (GMarkupParseContext  *context,
                                              const gchar          *element_name,
                                              gpointer              user_data,
                                              GError              **error);

gboolean
xml_parser_parse_file                        (GimpXmlParser        *parser,
                                              const gchar          *filename,
                                              GError              **error);

void
xml_parser_free                              (GimpXmlParser        *parser);

gboolean
parse_encoding                               (const gchar          *text,
                                              gint                  text_len,
                                              gchar               **encoding);

gboolean
xml_parser_parse_io_channel                  (GimpXmlParser        *parser,
                                              GIOChannel           *io,
                                              GError              **error);

GimpXmlParser *
xml_parser_new                               (const GMarkupParser  *markup_parser,
                                              gpointer              user_data);

#endif /* __METADATA_XML_H__ */