]> www.fi.muni.cz Git - evince.git/blob - libdocument/ev-document-forms.c
libdocument: Add xz compression support
[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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20
21 #include <config.h>
22 #include "ev-document-forms.h"
23
24 G_DEFINE_INTERFACE (EvDocumentForms, ev_document_forms, 0)
25
26 static void
27 ev_document_forms_default_init (EvDocumentFormsInterface *klass)
28 {
29 }
30
31 EvMappingList *
32 ev_document_forms_get_form_fields (EvDocumentForms *document_forms,
33                                    EvPage          *page)
34 {
35         EvDocumentFormsInterface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
36
37         return iface->get_form_fields (document_forms, page);
38 }
39
40 gboolean
41 ev_document_forms_document_is_modified (EvDocumentForms *document_forms)
42 {
43         EvDocumentFormsInterface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
44
45         return (iface->document_is_modified) ? iface->document_is_modified (document_forms) : FALSE;
46 }
47
48 gchar *
49 ev_document_forms_form_field_text_get_text (EvDocumentForms *document_forms, 
50                                             EvFormField     *field)
51 {
52         EvDocumentFormsInterface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
53
54         return iface->form_field_text_get_text (document_forms, field);
55 }
56
57 void
58 ev_document_forms_form_field_text_set_text (EvDocumentForms *document_forms, 
59                                             EvFormField     *field, 
60                                             const gchar     *text)
61 {
62         EvDocumentFormsInterface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
63
64         iface->form_field_text_set_text (document_forms, field, text);
65 }
66
67 gboolean
68 ev_document_forms_form_field_button_get_state (EvDocumentForms   *document_forms,
69                                                EvFormField       *field)
70 {
71         EvDocumentFormsInterface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
72
73         return iface->form_field_button_get_state (document_forms, field);
74 }
75
76 void
77 ev_document_forms_form_field_button_set_state (EvDocumentForms   *document_forms, 
78                                                EvFormField       *field, 
79                                                gboolean           state)
80 {
81         EvDocumentFormsInterface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
82
83         iface->form_field_button_set_state (document_forms, field, state);
84 }
85
86 gchar *
87 ev_document_forms_form_field_choice_get_item (EvDocumentForms   *document_forms, 
88                                               EvFormField       *field, 
89                                               gint               index)
90 {
91         EvDocumentFormsInterface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
92
93         return iface->form_field_choice_get_item (document_forms, field, index);
94 }
95
96 gint
97 ev_document_forms_form_field_choice_get_n_items (EvDocumentForms   *document_forms, 
98                                                  EvFormField       *field)
99 {
100         EvDocumentFormsInterface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
101
102         return iface->form_field_choice_get_n_items (document_forms, field);
103 }
104
105 gboolean
106 ev_document_forms_form_field_choice_is_item_selected (EvDocumentForms   *document_forms, 
107                                                       EvFormField       *field, 
108                                                       gint               index)
109 {
110         EvDocumentFormsInterface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
111
112         return iface->form_field_choice_is_item_selected (document_forms, field, index);
113 }
114
115 void
116 ev_document_forms_form_field_choice_select_item (EvDocumentForms   *document_forms, 
117                                                  EvFormField       *field, 
118                                                  gint               index)
119 {
120         EvDocumentFormsInterface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
121
122         iface->form_field_choice_select_item (document_forms, field, index);
123 }
124
125 void
126 ev_document_forms_form_field_choice_toggle_item (EvDocumentForms   *document_forms, 
127                                                  EvFormField       *field, 
128                                                  gint               index)
129 {
130         EvDocumentFormsInterface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
131
132         iface->form_field_choice_toggle_item (document_forms, field, index);
133 }
134
135 void
136 ev_document_forms_form_field_choice_unselect_all (EvDocumentForms   *document_forms, 
137                                                   EvFormField       *field)
138 {
139         EvDocumentFormsInterface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
140
141         iface->form_field_choice_unselect_all (document_forms, field);
142 }
143
144 void
145 ev_document_forms_form_field_choice_set_text (EvDocumentForms   *document_forms,
146                                               EvFormField       *field,
147                                               const gchar       *text)
148 {
149         EvDocumentFormsInterface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
150
151         iface->form_field_choice_set_text (document_forms, field, text);
152 }
153
154 gchar *
155 ev_document_forms_form_field_choice_get_text (EvDocumentForms   *document_forms,
156                                               EvFormField       *field)
157 {
158         EvDocumentFormsInterface *iface = EV_DOCUMENT_FORMS_GET_IFACE (document_forms);
159
160         return iface->form_field_choice_get_text (document_forms, field);
161 }