]> www.fi.muni.cz Git - evince.git/blob - libdocument/ev-document-forms.c
Include config.h. Bug #504721.
[evince.git] / libdocument / ev-document-forms.c
1 /* ev-document-forms.c
2  *  this file is part of evince, a gnome document viewer
3  * 
4  * Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
5  *
6  * Evince is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * Evince is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
19  */
20
21 #include <config.h>
22 #include "ev-document-forms.h"
23
24 GType
25 ev_document_forms_get_type (void)
26 {
27         static GType type = 0;
28
29         if (G_UNLIKELY (type == 0)) {
30                 const GTypeInfo our_info = {
31                         sizeof (EvDocumentFormsIface),
32                         NULL,
33                         NULL,
34                 };
35
36                 type = g_type_register_static (G_TYPE_INTERFACE,
37                                                "EvDocumentForms",
38                                                &our_info, (GTypeFlags)0);
39         }
40
41         return type;
42 }
43
44 GList *
45 ev_document_forms_get_form_fields (EvDocumentForms *document_forms,
46                                    gint             page)
47 {
48         EvDocumentFormsIface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
49
50         return iface->get_form_fields (document_forms, page);
51 }
52
53 gchar *
54 ev_document_forms_form_field_text_get_text (EvDocumentForms *document_forms, 
55                                             EvFormField     *field)
56 {
57         EvDocumentFormsIface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
58
59         return iface->form_field_text_get_text (document_forms, field);
60 }
61
62 void
63 ev_document_forms_form_field_text_set_text (EvDocumentForms *document_forms, 
64                                             EvFormField     *field, 
65                                             const gchar     *text)
66 {
67         EvDocumentFormsIface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
68
69         iface->form_field_text_set_text (document_forms, field, text);
70 }
71
72 gboolean
73 ev_document_forms_form_field_button_get_state (EvDocumentForms   *document_forms,
74                                                EvFormField       *field)
75 {
76         EvDocumentFormsIface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
77
78         return iface->form_field_button_get_state (document_forms, field);
79 }
80
81 void
82 ev_document_forms_form_field_button_set_state (EvDocumentForms   *document_forms, 
83                                                EvFormField       *field, 
84                                                gboolean           state)
85 {
86         EvDocumentFormsIface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
87
88         iface->form_field_button_set_state (document_forms, field, state);
89 }
90
91 gchar *
92 ev_document_forms_form_field_choice_get_item (EvDocumentForms   *document_forms, 
93                                               EvFormField       *field, 
94                                               gint               index)
95 {
96         EvDocumentFormsIface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
97
98         return iface->form_field_choice_get_item (document_forms, field, index);
99 }
100
101 gint
102 ev_document_forms_form_field_choice_get_n_items (EvDocumentForms   *document_forms, 
103                                                  EvFormField       *field)
104 {
105         EvDocumentFormsIface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
106
107         return iface->form_field_choice_get_n_items (document_forms, field);
108 }
109
110 gboolean
111 ev_document_forms_form_field_choice_is_item_selected (EvDocumentForms   *document_forms, 
112                                                       EvFormField       *field, 
113                                                       gint               index)
114 {
115         EvDocumentFormsIface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
116
117         return iface->form_field_choice_is_item_selected (document_forms, field, index);
118 }
119
120 void
121 ev_document_forms_form_field_choice_select_item (EvDocumentForms   *document_forms, 
122                                                  EvFormField       *field, 
123                                                  gint               index)
124 {
125         EvDocumentFormsIface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
126
127         iface->form_field_choice_select_item (document_forms, field, index);
128 }
129
130 void
131 ev_document_forms_form_field_choice_toggle_item (EvDocumentForms   *document_forms, 
132                                                  EvFormField       *field, 
133                                                  gint               index)
134 {
135         EvDocumentFormsIface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
136
137         iface->form_field_choice_toggle_item (document_forms, field, index);
138 }
139
140 void
141 ev_document_forms_form_field_choice_unselect_all (EvDocumentForms   *document_forms, 
142                                                   EvFormField       *field)
143 {
144         EvDocumentFormsIface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
145
146         iface->form_field_choice_unselect_all (document_forms, field);
147 }
148
149 void
150 ev_document_forms_form_field_choice_set_text (EvDocumentForms   *document_forms,
151                                               EvFormField       *field,
152                                               const gchar       *text)
153 {
154         EvDocumentFormsIface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
155
156         iface->form_field_choice_set_text (document_forms, field, text);
157 }
158
159 gchar *
160 ev_document_forms_form_field_choice_get_text (EvDocumentForms   *document_forms,
161                                               EvFormField       *field)
162 {
163         EvDocumentFormsIface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
164
165         return iface->form_field_choice_get_text (document_forms, field);
166 }