~ubuntu-branches/ubuntu/trusty/pdfmod/trusty

« back to all changes in this revision

Viewing changes to lib/poppler-sharp/poppler-sharp/generated/Document.cs

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2010-06-18 03:44:46 UTC
  • Revision ID: james.westby@ubuntu.com-20100618034446-bogifrsscpayp361
Tags: upstream-0.8.3
ImportĀ upstreamĀ versionĀ 0.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// This file was generated by the Gtk# code generator.
 
2
// Any changes made will be lost if regenerated.
 
3
 
 
4
namespace Poppler {
 
5
 
 
6
        using System;
 
7
        using System.Collections;
 
8
        using System.Runtime.InteropServices;
 
9
 
 
10
#region Autogenerated code
 
11
        public partial class Document : GLib.Object {
 
12
 
 
13
                [Obsolete]
 
14
                protected Document(GLib.GType gtype) : base(gtype) {}
 
15
                public Document(IntPtr raw) : base(raw) {}
 
16
 
 
17
                [DllImport("poppler-glib")]
 
18
                static extern unsafe IntPtr poppler_document_new_from_data(IntPtr data, int length, IntPtr password, out IntPtr error);
 
19
 
 
20
                public unsafe Document (string data, string password) : base (IntPtr.Zero)
 
21
                {
 
22
                        if (GetType () != typeof (Document)) {
 
23
                                throw new InvalidOperationException ("Can't override this constructor.");
 
24
                        }
 
25
                        IntPtr native_password = GLib.Marshaller.StringToPtrGStrdup (password);
 
26
                        IntPtr error = IntPtr.Zero;
 
27
                        Raw = poppler_document_new_from_data(GLib.Marshaller.StringToPtrGStrdup(data), System.Text.Encoding.UTF8.GetByteCount (data), native_password, out error);
 
28
                        GLib.Marshaller.Free (native_password);
 
29
                        if (error != IntPtr.Zero) throw new GLib.GException (error);
 
30
                }
 
31
 
 
32
                [DllImport("poppler-glib")]
 
33
                static extern unsafe IntPtr poppler_document_new_from_file(IntPtr uri, IntPtr password, out IntPtr error);
 
34
 
 
35
                public static unsafe Document NewFromFile(string uri, string password)
 
36
                {
 
37
                        IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
 
38
                        IntPtr native_password = GLib.Marshaller.StringToPtrGStrdup (password);
 
39
                        IntPtr error = IntPtr.Zero;
 
40
                        Document result = new Document (poppler_document_new_from_file(native_uri, native_password, out error));
 
41
                        GLib.Marshaller.Free (native_uri);
 
42
                        GLib.Marshaller.Free (native_password);
 
43
                        if (error != IntPtr.Zero) throw new GLib.GException (error);
 
44
                        return result;
 
45
                }
 
46
 
 
47
                [DllImport("poppler-glib")]
 
48
                static extern unsafe bool poppler_document_save(IntPtr raw, IntPtr uri, out IntPtr error);
 
49
 
 
50
                public unsafe bool Save(string uri) {
 
51
                        IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
 
52
                        IntPtr error = IntPtr.Zero;
 
53
                        bool raw_ret = poppler_document_save(Handle, native_uri, out error);
 
54
                        bool ret = raw_ret;
 
55
                        GLib.Marshaller.Free (native_uri);
 
56
                        if (error != IntPtr.Zero) throw new GLib.GException (error);
 
57
                        return ret;
 
58
                }
 
59
 
 
60
                [DllImport("poppler-glib")]
 
61
                static extern unsafe bool poppler_document_save_a_copy(IntPtr raw, IntPtr uri, out IntPtr error);
 
62
 
 
63
                public unsafe bool SaveACopy(string uri) {
 
64
                        IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
 
65
                        IntPtr error = IntPtr.Zero;
 
66
                        bool raw_ret = poppler_document_save_a_copy(Handle, native_uri, out error);
 
67
                        bool ret = raw_ret;
 
68
                        GLib.Marshaller.Free (native_uri);
 
69
                        if (error != IntPtr.Zero) throw new GLib.GException (error);
 
70
                        return ret;
 
71
                }
 
72
 
 
73
                [DllImport("poppler-glib")]
 
74
                static extern IntPtr poppler_document_get_page_by_label(IntPtr raw, IntPtr label);
 
75
 
 
76
                public Poppler.Page GetPageByLabel(string label) {
 
77
                        IntPtr native_label = GLib.Marshaller.StringToPtrGStrdup (label);
 
78
                        IntPtr raw_ret = poppler_document_get_page_by_label(Handle, native_label);
 
79
                        Poppler.Page ret = GLib.Object.GetObject(raw_ret) as Poppler.Page;
 
80
                        GLib.Marshaller.Free (native_label);
 
81
                        return ret;
 
82
                }
 
83
 
 
84
                [DllImport("poppler-glib")]
 
85
                static extern IntPtr poppler_document_get_form_field(IntPtr raw, int id);
 
86
 
 
87
                public Poppler.FormField GetFormField(int id) {
 
88
                        IntPtr raw_ret = poppler_document_get_form_field(Handle, id);
 
89
                        Poppler.FormField ret = GLib.Object.GetObject(raw_ret) as Poppler.FormField;
 
90
                        return ret;
 
91
                }
 
92
 
 
93
                [DllImport("poppler-glib")]
 
94
                static extern IntPtr poppler_document_get_page(IntPtr raw, int index);
 
95
 
 
96
                public Poppler.Page GetPage(int index) {
 
97
                        IntPtr raw_ret = poppler_document_get_page(Handle, index);
 
98
                        Poppler.Page ret = GLib.Object.GetObject(raw_ret) as Poppler.Page;
 
99
                        return ret;
 
100
                }
 
101
 
 
102
                [DllImport("poppler-glib")]
 
103
                static extern int poppler_document_get_n_pages(IntPtr raw);
 
104
 
 
105
                public int NPages { 
 
106
                        get {
 
107
                                int raw_ret = poppler_document_get_n_pages(Handle);
 
108
                                int ret = raw_ret;
 
109
                                return ret;
 
110
                        }
 
111
                }
 
112
 
 
113
                [DllImport("poppler-glib")]
 
114
                static extern bool poppler_document_has_attachments(IntPtr raw);
 
115
 
 
116
                public bool HasAttachments { 
 
117
                        get {
 
118
                                bool raw_ret = poppler_document_has_attachments(Handle);
 
119
                                bool ret = raw_ret;
 
120
                                return ret;
 
121
                        }
 
122
                }
 
123
 
 
124
                [DllImport("poppler-glib")]
 
125
                static extern IntPtr poppler_document_find_dest(IntPtr raw, IntPtr link_name);
 
126
 
 
127
                public Poppler.Dest FindDest(string link_name) {
 
128
                        IntPtr native_link_name = GLib.Marshaller.StringToPtrGStrdup (link_name);
 
129
                        IntPtr raw_ret = poppler_document_find_dest(Handle, native_link_name);
 
130
                        Poppler.Dest ret = Poppler.Dest.New (raw_ret);
 
131
                        GLib.Marshaller.Free (native_link_name);
 
132
                        return ret;
 
133
                }
 
134
 
 
135
                [DllImport("poppler-glib")]
 
136
                static extern IntPtr poppler_document_get_attachments(IntPtr raw);
 
137
 
 
138
                public GLib.List Attachments { 
 
139
                        get {
 
140
                                IntPtr raw_ret = poppler_document_get_attachments(Handle);
 
141
                                GLib.List ret = new GLib.List(raw_ret);
 
142
                                return ret;
 
143
                        }
 
144
                }
 
145
 
 
146
                [DllImport("poppler-glib")]
 
147
                static extern IntPtr poppler_document_get_type();
 
148
 
 
149
                public static new GLib.GType GType { 
 
150
                        get {
 
151
                                IntPtr raw_ret = poppler_document_get_type();
 
152
                                GLib.GType ret = new GLib.GType(raw_ret);
 
153
                                return ret;
 
154
                        }
 
155
                }
 
156
 
 
157
#endregion
 
158
        }
 
159
}