1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */
/* this file is part of atril, a mate document viewer
*
* Copyright (C) 2006 Julien Rebetez
*
* Atril is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Atril is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#if !defined (__EV_ATRIL_DOCUMENT_H_INSIDE__) && !defined (ATRIL_COMPILATION)
#error "Only <atril-document.h> can be included directly."
#endif
#ifndef EV_FORM_FIELD_H
#define EV_FORM_FIELD_H
#include <glib-object.h>
#include "ev-document.h"
#include "ev-link.h"
G_BEGIN_DECLS
#define EV_TYPE_FORM_FIELD (ev_form_field_get_type())
#define EV_FORM_FIELD(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_FORM_FIELD, EvFormField))
#define EV_FORM_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_FORM_FIELD, EvFormFieldClass))
#define EV_IS_FORM_FIELD(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_FORM_FIELD))
#define EV_IS_FORM_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_FORM_FIELD))
#define EV_FORM_FIELD_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_FORM_FIELD, EvFormFieldClass))
#define EV_TYPE_FORM_FIELD_TEXT (ev_form_field_text_get_type())
#define EV_FORM_FIELD_TEXT(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_FORM_FIELD_TEXT, EvFormFieldText))
#define EV_FORM_FIELD_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_FORM_FIELD_TEXT, EvFormFieldTextClass))
#define EV_IS_FORM_FIELD_TEXT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_FORM_FIELD_TEXT))
#define EV_IS_FORM_FIELD_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_FORM_FIELD_TEXT))
#define EV_FORM_FIELD_TEXT_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_FORM_FIELD_TEXT, EvFormFieldTextClass))
#define EV_TYPE_FORM_FIELD_BUTTON (ev_form_field_button_get_type())
#define EV_FORM_FIELD_BUTTON(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_FORM_FIELD_BUTTON, EvFormFieldButton))
#define EV_FORM_FIELD_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_FORM_FIELD_BUTTON, EvFormFieldButtonClass))
#define EV_IS_FORM_FIELD_BUTTON(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_FORM_FIELD_BUTTON))
#define EV_IS_FORM_FIELD_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_FORM_FIELD_BUTTON))
#define EV_FORM_FIELD_BUTTON_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_FORM_FIELD_BUTTON, EvFormFieldButtonClass))
#define EV_TYPE_FORM_FIELD_CHOICE (ev_form_field_choice_get_type())
#define EV_FORM_FIELD_CHOICE(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_FORM_FIELD_CHOICE, EvFormFieldChoice))
#define EV_FORM_FIELD_CHOICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_FORM_FIELD_CHOICE, EvFormFieldChoiceClass))
#define EV_IS_FORM_FIELD_CHOICE(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_FORM_FIELD_CHOICE))
#define EV_IS_FORM_FIELD_CHOICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_FORM_FIELD_CHOICE))
#define EV_FORM_FIELD_CHOICE_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_FORM_FIELD_CHOICE, EvFormFieldChoiceClass))
#define EV_TYPE_FORM_FIELD_SIGNATURE (ev_form_field_signature_get_type())
#define EV_FORM_FIELD_SIGNATURE(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_FORM_FIELD_SIGNATURE, EvFormFieldSignature))
#define EV_FORM_FIELD_SIGNATURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_FORM_FIELD_SIGNATURE, EvFormFieldSignatureClass))
#define EV_IS_FORM_FIELD_SIGNATURE(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_FORM_FIELD_SIGNATURE))
#define EV_IS_FORM_FIELD_SIGNATURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_FORM_FIELD_SIGNATURE))
#define EV_FORM_FIELD_SIGNATURE_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_FORM_FIELD_SIGNATURE, EvFormFieldSignatureClass))
typedef struct _EvFormField EvFormField;
typedef struct _EvFormFieldClass EvFormFieldClass;
typedef struct _EvFormFieldText EvFormFieldText;
typedef struct _EvFormFieldTextClass EvFormFieldTextClass;
typedef struct _EvFormFieldButton EvFormFieldButton;
typedef struct _EvFormFieldButtonClass EvFormFieldButtonClass;
typedef struct _EvFormFieldChoice EvFormFieldChoice;
typedef struct _EvFormFieldChoiceClass EvFormFieldChoiceClass;
typedef struct _EvFormFieldSignature EvFormFieldSignature;
typedef struct _EvFormFieldSignatureClass EvFormFieldSignatureClass;
typedef enum
{
EV_FORM_FIELD_TEXT_NORMAL,
EV_FORM_FIELD_TEXT_MULTILINE,
EV_FORM_FIELD_TEXT_FILE_SELECT
} EvFormFieldTextType;
typedef enum
{
EV_FORM_FIELD_BUTTON_PUSH,
EV_FORM_FIELD_BUTTON_CHECK,
EV_FORM_FIELD_BUTTON_RADIO
} EvFormFieldButtonType;
typedef enum
{
EV_FORM_FIELD_CHOICE_COMBO,
EV_FORM_FIELD_CHOICE_LIST
} EvFormFieldChoiceType;
struct _EvFormField
{
GObject parent;
gint id;
gboolean is_read_only;
gdouble font_size;
EvLink *activation_link;
EvPage *page;
gboolean changed;
};
struct _EvFormFieldClass
{
GObjectClass parent_class;
};
struct _EvFormFieldText
{
EvFormField partent;
EvFormFieldTextType type;
gboolean do_spell_check : 1;
gboolean do_scroll : 1;
gboolean comb : 1;
gboolean is_rich_text : 1;
gboolean is_password;
gint max_len;
gchar *text;
};
struct _EvFormFieldTextClass
{
EvFormFieldClass partent_class;
};
struct _EvFormFieldButton
{
EvFormField partent;
EvFormFieldButtonType type;
gboolean state;
};
struct _EvFormFieldButtonClass
{
EvFormFieldClass partent_class;
};
struct _EvFormFieldChoice
{
EvFormField partent;
EvFormFieldChoiceType type;
gboolean multi_select : 1;
gboolean is_editable : 1;
gboolean do_spell_check : 1;
gboolean commit_on_sel_change : 1;
GList *selected_items;
gchar *text;
};
struct _EvFormFieldChoiceClass
{
EvFormFieldClass partent_class;
};
struct _EvFormFieldSignature
{
EvFormField partent;
/* TODO */
};
struct _EvFormFieldSignatureClass
{
EvFormFieldClass partent_class;
};
/* EvFormField base class */
GType ev_form_field_get_type (void) G_GNUC_CONST;
/* EvFormFieldText */
GType ev_form_field_text_get_type (void) G_GNUC_CONST;
EvFormField *ev_form_field_text_new (gint id,
EvFormFieldTextType type);
/* EvFormFieldButton */
GType ev_form_field_button_get_type (void) G_GNUC_CONST;
EvFormField *ev_form_field_button_new (gint id,
EvFormFieldButtonType type);
/* EvFormFieldChoice */
GType ev_form_field_choice_get_type (void) G_GNUC_CONST;
EvFormField *ev_form_field_choice_new (gint id,
EvFormFieldChoiceType type);
/* EvFormFieldSignature */
GType ev_form_field_signature_get_type (void) G_GNUC_CONST;
EvFormField *ev_form_field_signature_new (gint id);
G_END_DECLS
#endif /* !EV_FORM_FIELD_H */
|