1
/* poppler-attachment.h: glib interface to poppler
2
* Copyright (C) 2004, Red Hat, Inc.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2, or (at your option)
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
19
#ifndef __POPPLER_ATTACHMENT_H__
20
#define __POPPLER_ATTACHMENT_H__
23
#include <glib-object.h>
30
#define POPPLER_TYPE_ATTACHMENT (poppler_attachment_get_type ())
31
#define POPPLER_ATTACHMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POPPLER_TYPE_ATTACHMENT, PopplerAttachment))
32
#define POPPLER_IS_ATTACHMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POPPLER_TYPE_ATTACHMENT))
36
* PopplerAttachmentSaveFunc:
37
* @buf: buffer containing bytes to be written.
38
* @count: number of bytes in @buf.
39
* @data: user data passed to poppler_attachment_save_to_callback()
40
* @error: GError to set on error, or NULL
42
* Specifies the type of the function passed to
43
* poppler_attachment_save_to_callback(). It is called once for each block of
44
* bytes that is "written" by poppler_attachment_save_to_callback(). If
45
* successful it should return %TRUE. If an error occurs it should set
46
* @error and return %FALSE, in which case poppler_attachment_save_to_callback()
47
* will fail with the same error.
49
* @Returns: %TRUE if successful, %FALSE (with @error set) if failed.
51
typedef gboolean (*PopplerAttachmentSaveFunc) (const gchar *buf,
56
struct _PopplerAttachment
68
typedef struct _PopplerAttachmentClass
70
GObjectClass parent_class;
71
} PopplerAttachmentClass;
74
GType poppler_attachment_get_type (void) G_GNUC_CONST;
75
gboolean poppler_attachment_save (PopplerAttachment *attachment,
78
gboolean poppler_attachment_save_to_callback (PopplerAttachment *attachment,
79
PopplerAttachmentSaveFunc save_func,
86
#endif /* __POPPLER_ATTACHMENT_H__ */