1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */
2 /* this file is part of evince, a gnome document viewer
4 * Copyright (C) 2006 Julien Rebetez
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.
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.
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.
21 #if !defined (__EV_EVINCE_DOCUMENT_H_INSIDE__) && !defined (EVINCE_COMPILATION)
22 #error "Only <evince-document.h> can be included directly."
25 #ifndef EV_FORM_FIELD_H
26 #define EV_FORM_FIELD_H
28 #include <glib-object.h>
30 #include "ev-document.h"
34 #define EV_TYPE_FORM_FIELD (ev_form_field_get_type())
35 #define EV_FORM_FIELD(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_FORM_FIELD, EvFormField))
36 #define EV_FORM_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_FORM_FIELD, EvFormFieldClass))
37 #define EV_IS_FORM_FIELD(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_FORM_FIELD))
38 #define EV_IS_FORM_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_FORM_FIELD))
39 #define EV_FORM_FIELD_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_FORM_FIELD, EvFormFieldClass))
41 #define EV_TYPE_FORM_FIELD_TEXT (ev_form_field_text_get_type())
42 #define EV_FORM_FIELD_TEXT(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_FORM_FIELD_TEXT, EvFormFieldText))
43 #define EV_FORM_FIELD_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_FORM_FIELD_TEXT, EvFormFieldTextClass))
44 #define EV_IS_FORM_FIELD_TEXT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_FORM_FIELD_TEXT))
45 #define EV_IS_FORM_FIELD_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_FORM_FIELD_TEXT))
46 #define EV_FORM_FIELD_TEXT_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_FORM_FIELD_TEXT, EvFormFieldTextClass))
48 #define EV_TYPE_FORM_FIELD_BUTTON (ev_form_field_button_get_type())
49 #define EV_FORM_FIELD_BUTTON(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_FORM_FIELD_BUTTON, EvFormFieldButton))
50 #define EV_FORM_FIELD_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_FORM_FIELD_BUTTON, EvFormFieldButtonClass))
51 #define EV_IS_FORM_FIELD_BUTTON(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_FORM_FIELD_BUTTON))
52 #define EV_IS_FORM_FIELD_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_FORM_FIELD_BUTTON))
53 #define EV_FORM_FIELD_BUTTON_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_FORM_FIELD_BUTTON, EvFormFieldButtonClass))
55 #define EV_TYPE_FORM_FIELD_CHOICE (ev_form_field_choice_get_type())
56 #define EV_FORM_FIELD_CHOICE(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_FORM_FIELD_CHOICE, EvFormFieldChoice))
57 #define EV_FORM_FIELD_CHOICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_FORM_FIELD_CHOICE, EvFormFieldChoiceClass))
58 #define EV_IS_FORM_FIELD_CHOICE(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_FORM_FIELD_CHOICE))
59 #define EV_IS_FORM_FIELD_CHOICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_FORM_FIELD_CHOICE))
60 #define EV_FORM_FIELD_CHOICE_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_FORM_FIELD_CHOICE, EvFormFieldChoiceClass))
62 #define EV_TYPE_FORM_FIELD_SIGNATURE (ev_form_field_signature_get_type())
63 #define EV_FORM_FIELD_SIGNATURE(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_FORM_FIELD_SIGNATURE, EvFormFieldSignature))
64 #define EV_FORM_FIELD_SIGNATURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_FORM_FIELD_SIGNATURE, EvFormFieldSignatureClass))
65 #define EV_IS_FORM_FIELD_SIGNATURE(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_FORM_FIELD_SIGNATURE))
66 #define EV_IS_FORM_FIELD_SIGNATURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_FORM_FIELD_SIGNATURE))
67 #define EV_FORM_FIELD_SIGNATURE_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_FORM_FIELD_SIGNATURE, EvFormFieldSignatureClass))
69 typedef struct _EvFormField EvFormField;
70 typedef struct _EvFormFieldClass EvFormFieldClass;
72 typedef struct _EvFormFieldText EvFormFieldText;
73 typedef struct _EvFormFieldTextClass EvFormFieldTextClass;
75 typedef struct _EvFormFieldButton EvFormFieldButton;
76 typedef struct _EvFormFieldButtonClass EvFormFieldButtonClass;
78 typedef struct _EvFormFieldChoice EvFormFieldChoice;
79 typedef struct _EvFormFieldChoiceClass EvFormFieldChoiceClass;
81 typedef struct _EvFormFieldSignature EvFormFieldSignature;
82 typedef struct _EvFormFieldSignatureClass EvFormFieldSignatureClass;
86 EV_FORM_FIELD_TEXT_NORMAL,
87 EV_FORM_FIELD_TEXT_MULTILINE,
88 EV_FORM_FIELD_TEXT_FILE_SELECT
89 } EvFormFieldTextType;
93 EV_FORM_FIELD_BUTTON_PUSH,
94 EV_FORM_FIELD_BUTTON_CHECK,
95 EV_FORM_FIELD_BUTTON_RADIO
96 } EvFormFieldButtonType;
100 EV_FORM_FIELD_CHOICE_COMBO,
101 EV_FORM_FIELD_CHOICE_LIST
102 } EvFormFieldChoiceType;
109 gboolean is_read_only;
116 struct _EvFormFieldClass
118 GObjectClass parent_class;
121 struct _EvFormFieldText
125 EvFormFieldTextType type;
127 gboolean do_spell_check : 1;
128 gboolean do_scroll : 1;
130 gboolean is_rich_text : 1;
131 gboolean is_password;
137 struct _EvFormFieldTextClass
139 EvFormFieldClass partent_class;
142 struct _EvFormFieldButton
146 EvFormFieldButtonType type;
151 struct _EvFormFieldButtonClass
153 EvFormFieldClass partent_class;
156 struct _EvFormFieldChoice
160 EvFormFieldChoiceType type;
162 gboolean multi_select : 1;
163 gboolean is_editable : 1;
164 gboolean do_spell_check : 1;
165 gboolean commit_on_sel_change : 1;
167 GList *selected_items;
171 struct _EvFormFieldChoiceClass
173 EvFormFieldClass partent_class;
176 struct _EvFormFieldSignature
183 struct _EvFormFieldSignatureClass
185 EvFormFieldClass partent_class;
188 /* EvFormField base class */
189 GType ev_form_field_get_type (void) G_GNUC_CONST;
191 /* EvFormFieldText */
192 GType ev_form_field_text_get_type (void) G_GNUC_CONST;
193 EvFormField *ev_form_field_text_new (gint id,
194 EvFormFieldTextType type);
196 /* EvFormFieldButton */
197 GType ev_form_field_button_get_type (void) G_GNUC_CONST;
198 EvFormField *ev_form_field_button_new (gint id,
199 EvFormFieldButtonType type);
201 /* EvFormFieldChoice */
202 GType ev_form_field_choice_get_type (void) G_GNUC_CONST;
203 EvFormField *ev_form_field_choice_new (gint id,
204 EvFormFieldChoiceType type);
206 /* EvFormFieldSignature */
207 GType ev_form_field_signature_get_type (void) G_GNUC_CONST;
208 EvFormField *ev_form_field_signature_new (gint id);
213 #endif /* !EV_FORM_FIELD_H */