~ubuntu-branches/ubuntu/saucy/emscripten/saucy-proposed

« back to all changes in this revision

Viewing changes to tests/poppler/glib/poppler-attachment.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-02 13:11:51 UTC
  • Revision ID: package-import@ubuntu.com-20130502131151-q8dvteqr1ef2x7xz
Tags: upstream-1.4.1~20130504~adb56cb
ImportĀ upstreamĀ versionĀ 1.4.1~20130504~adb56cb

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* poppler-attachment.h: glib interface to poppler
 
2
 * Copyright (C) 2004, Red Hat, Inc.
 
3
 *
 
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)
 
7
 * any later version.
 
8
 *
 
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.
 
13
 *
 
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.
 
17
 */
 
18
 
 
19
#ifndef __POPPLER_ATTACHMENT_H__
 
20
#define __POPPLER_ATTACHMENT_H__
 
21
 
 
22
#include <glib.h>
 
23
#include <glib-object.h>
 
24
 
 
25
#include "poppler.h"
 
26
 
 
27
G_BEGIN_DECLS
 
28
 
 
29
 
 
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))
 
33
 
 
34
 
 
35
/**
 
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
 
41
 *
 
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.
 
48
 *
 
49
 * @Returns: %TRUE if successful, %FALSE (with @error set) if failed.
 
50
 */
 
51
typedef gboolean (*PopplerAttachmentSaveFunc) (const gchar  *buf,
 
52
                                               gsize         count,
 
53
                                               gpointer      data,
 
54
                                               GError      **error);
 
55
 
 
56
struct _PopplerAttachment
 
57
{
 
58
  GObject parent;
 
59
 
 
60
  gchar *name;
 
61
  gchar *description;
 
62
  gsize size;
 
63
  GTime mtime;
 
64
  GTime ctime;
 
65
  GString *checksum;
 
66
};
 
67
 
 
68
typedef struct _PopplerAttachmentClass
 
69
{
 
70
  GObjectClass parent_class;
 
71
} PopplerAttachmentClass;
 
72
 
 
73
 
 
74
GType     poppler_attachment_get_type         (void) G_GNUC_CONST;
 
75
gboolean  poppler_attachment_save             (PopplerAttachment          *attachment,
 
76
                                               const char                 *filename,
 
77
                                               GError                    **error);
 
78
gboolean  poppler_attachment_save_to_callback (PopplerAttachment          *attachment,
 
79
                                               PopplerAttachmentSaveFunc   save_func,
 
80
                                               gpointer                    user_data,
 
81
                                               GError                    **error);
 
82
 
 
83
 
 
84
G_END_DECLS
 
85
 
 
86
#endif /* __POPPLER_ATTACHMENT_H__ */