Evince
Evince is a document viewer capable of displaying multiple and single page document formats like PDF and Postscript.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ev-document-forms.c
Go to the documentation of this file.
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
28 {
29 }
30 
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
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 *
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
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
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
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 *
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
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
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
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
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
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
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 *
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 }