]> www.fi.muni.cz Git - evince.git/blob - libdocument/ev-document-forms.h
1337a5ed665ace24d8555a271d146437c629968c
[evince.git] / libdocument / ev-document-forms.h
1 /* ev-document-forms.h
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 #ifndef EV_DOCUMENT_FORMS_H
22 #define EV_DOCUMENT_FORMS_H
23
24 #include <glib-object.h>
25
26 #include "ev-document.h"
27 #include "ev-form-field.h"
28
29 G_BEGIN_DECLS
30
31 #define EV_TYPE_DOCUMENT_FORMS            (ev_document_forms_get_type ())
32 #define EV_DOCUMENT_FORMS(o)              (G_TYPE_CHECK_INSTANCE_CAST ((o), EV_TYPE_DOCUMENT_FORMS, EvDocumentForms))
33 #define EV_DOCUMENT_FORMS_IFACE(k)        (G_TYPE_CHECK_CLASS_CAST((k), EV_TYPE_DOCUMENT_FORMS, EvDocumentFormsIface))
34 #define EV_IS_DOCUMENT_FORMS(o)           (G_TYPE_CHECK_INSTANCE_TYPE ((o), EV_TYPE_DOCUMENT_FORMS))
35 #define EV_IS_DOCUMENT_FORMS_IFACE(k)     (G_TYPE_CHECK_CLASS_TYPE ((k), EV_TYPE_DOCUMENT_FORMS))
36 #define EV_DOCUMENT_FORMS_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EV_TYPE_DOCUMENT_FORMS, EvDocumentFormsIface))
37
38 typedef struct _EvDocumentForms      EvDocumentForms;
39 typedef struct _EvDocumentFormsIface EvDocumentFormsIface;
40
41 struct _EvDocumentFormsIface
42 {
43         GTypeInterface base_iface;
44
45         /* Methods  */
46         GList   *(* get_form_fields)                    (EvDocumentForms   *document_forms,
47                                                          EvPage            *page);
48         gchar   *(* form_field_text_get_text)           (EvDocumentForms   *document_forms,
49                                                          EvFormField       *field);
50         void     (* form_field_text_set_text)           (EvDocumentForms   *document_forms,
51                                                          EvFormField       *field,
52                                                          const gchar       *text);
53         gboolean (* form_field_button_get_state)        (EvDocumentForms   *document_forms,
54                                                          EvFormField       *field);
55         void     (* form_field_button_set_state)        (EvDocumentForms   *document_forms,
56                                                          EvFormField       *field,
57                                                          gboolean           state);
58         gchar   *(* form_field_choice_get_item)         (EvDocumentForms   *document_forms,
59                                                          EvFormField       *field,
60                                                          gint               index);
61         gint     (* form_field_choice_get_n_items)      (EvDocumentForms   *document_forms,
62                                                          EvFormField       *field);
63         gboolean (* form_field_choice_is_item_selected) (EvDocumentForms   *document_forms,
64                                                          EvFormField       *field,
65                                                          gint               index);
66         void     (* form_field_choice_select_item)      (EvDocumentForms   *document_forms,
67                                                          EvFormField       *field,
68                                                          gint               index);
69         void     (* form_field_choice_toggle_item)      (EvDocumentForms   *document_forms,
70                                                          EvFormField       *field,
71                                                          gint               index);
72         void     (* form_field_choice_unselect_all)     (EvDocumentForms   *document_forms,
73                                                          EvFormField       *field);
74         void     (* form_field_choice_set_text)         (EvDocumentForms   *document_forms,
75                                                          EvFormField       *field,
76                                                          const gchar       *text);
77         gchar   *(* form_field_choice_get_text)         (EvDocumentForms   *document_forms,
78                                                          EvFormField       *field);
79 };
80
81 GType    ev_document_forms_get_type                            (void) G_GNUC_CONST;
82 GList   *ev_document_forms_get_form_fields                     (EvDocumentForms   *document_forms,
83                                                                 EvPage            *page);
84
85 gchar   *ev_document_forms_form_field_text_get_text            (EvDocumentForms   *document_forms, 
86                                                                 EvFormField       *field);
87 void     ev_document_forms_form_field_text_set_text            (EvDocumentForms   *document_forms, 
88                                                                 EvFormField       *field, 
89                                                                 const gchar       *text);
90
91 gboolean ev_document_forms_form_field_button_get_state         (EvDocumentForms   *document_forms,
92                                                                 EvFormField       *field);
93 void     ev_document_forms_form_field_button_set_state         (EvDocumentForms   *document_forms, 
94                                                                 EvFormField       *field, 
95                                                                 gboolean           state);
96
97 gchar    *ev_document_forms_form_field_choice_get_item         (EvDocumentForms   *document_forms, 
98                                                                 EvFormField       *field, 
99                                                                 gint               index);
100 gint      ev_document_forms_form_field_choice_get_n_items      (EvDocumentForms   *document_forms, 
101                                                                 EvFormField       *field);
102 gboolean  ev_document_forms_form_field_choice_is_item_selected (EvDocumentForms   *document_forms, 
103                                                                 EvFormField       *field, 
104                                                                 gint               index);
105 void      ev_document_forms_form_field_choice_select_item      (EvDocumentForms   *document_forms, 
106                                                                 EvFormField       *field, 
107                                                                 gint               index);
108 void      ev_document_forms_form_field_choice_toggle_item      (EvDocumentForms   *document_forms, 
109                                                                 EvFormField       *field, 
110                                                                 gint               index);
111 void      ev_document_forms_form_field_choice_unselect_all     (EvDocumentForms   *document_forms, 
112                                                                 EvFormField       *field);
113 void      ev_document_forms_form_field_choice_set_text         (EvDocumentForms   *document_forms,
114                                                                 EvFormField       *field,
115                                                                 const gchar       *text);
116 gchar    *ev_document_forms_form_field_choice_get_text         (EvDocumentForms   *document_forms,
117                                                                 EvFormField       *field);
118
119 G_END_DECLS
120
121 #endif /* EV_DOCUMENT_FORMS_H */