2
2002, 2003, 2004, 2005, 2006 Bastien Nocera
3
Copyright (C) 2003 Colin Walters <walters@verbum.org>
5
The Gnome Library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public License as
7
published by the Free Software Foundation; either version 2 of the
8
License, or (at your option) any later version.
10
The Gnome Library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public
16
License along with the Gnome Library; see the file COPYING.LIB. If not,
17
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
Boston, MA 02111-1307, USA.
20
Author: Bastien Nocera <hadess@hadess.net>
23
#ifndef TOTEM_PL_PARSER_H
24
#define TOTEM_PL_PARSER_H
28
#include <gtk/gtktreemodel.h>
29
#include "totem-pl-parser-features.h"
30
#include "totem-pl-parser-builtins.h"
34
#define TOTEM_TYPE_PL_PARSER (totem_pl_parser_get_type ())
35
#define TOTEM_PL_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOTEM_TYPE_PL_PARSER, TotemPlParser))
36
#define TOTEM_PL_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOTEM_TYPE_PL_PARSER, TotemPlParserClass))
37
#define TOTEM_IS_PL_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOTEM_TYPE_PL_PARSER))
38
#define TOTEM_IS_PL_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOTEM_TYPE_PL_PARSER))
42
TOTEM_PL_PARSER_RESULT_UNHANDLED,
43
TOTEM_PL_PARSER_RESULT_ERROR,
44
TOTEM_PL_PARSER_RESULT_SUCCESS,
45
TOTEM_PL_PARSER_RESULT_IGNORED
46
} TotemPlParserResult;
48
typedef struct TotemPlParser TotemPlParser;
49
typedef struct TotemPlParserClass TotemPlParserClass;
50
typedef struct TotemPlParserPrivate TotemPlParserPrivate;
52
struct TotemPlParser {
54
TotemPlParserPrivate *priv;
57
struct TotemPlParserClass {
58
GObjectClass parent_class;
61
void (*entry) (TotemPlParser *parser, const char *uri,
62
const char *title, const char *genre);
63
void (*playlist_start) (TotemPlParser *parser, const char *title);
64
void (*playlist_end) (TotemPlParser *parser, const char *title);
71
TOTEM_PL_PARSER_M3U_DOS,
77
TOTEM_PL_PARSER_ERROR_VFS_OPEN,
78
TOTEM_PL_PARSER_ERROR_VFS_WRITE,
81
#define TOTEM_PL_PARSER_ERROR (totem_pl_parser_error_quark ())
83
GQuark totem_pl_parser_error_quark (void);
85
typedef void (*TotemPlParserIterFunc) (GtkTreeModel *model, GtkTreeIter *iter,
86
char **uri, char **title,
87
gboolean *custom_title,
90
GType totem_pl_parser_get_type (void);
92
gboolean totem_pl_parser_write (TotemPlParser *parser, GtkTreeModel *model,
93
TotemPlParserIterFunc func,
94
const char *output, TotemPlParserType type,
98
gboolean totem_pl_parser_write_with_title (TotemPlParser *parser,
100
TotemPlParserIterFunc func,
103
TotemPlParserType type,
107
void totem_pl_parser_add_ignored_scheme (TotemPlParser *parser,
109
void totem_pl_parser_add_ignored_mimetype (TotemPlParser *parser,
110
const char *mimetype);
111
TotemPlParserResult totem_pl_parser_parse (TotemPlParser *parser, const char *url, gboolean fallback);
113
TotemPlParser *totem_pl_parser_new (void);
117
#endif /* TOTEM_PL_PARSER_H */