~ubuntu-branches/ubuntu/trusty/gq/trusty

« back to all changes in this revision

Viewing changes to src/gq-formfill.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2009-10-25 23:34:56 UTC
  • mfrom: (1.1.4 upstream) (3.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091025233456-i794n3yg2cff930j
Tags: 1.3.4-1
* QA upload.
  + Set maintainer to Debian QA Group <packages@qa.debian.org>.
* New upstream release. (Closes: #534705).
  + Does not segfault on amd64. (Closes: #444312).
  + Remove all existing patches and change patch system to quilt.
  + Replace dpatch build-dep with quilt.
* 01_desktop_file.diff - Remove encoding and bogus categories 
  from desktop file.
* Copy in config.{sub,guess} on configure, rm them on clean.
  + Add build-dep on autotools-dev.
* Make clean not ignore errors.
* Add copyright holders and version path to GPL (GPL-2).
* Update watch file to use SF redirector. (Closes: #449749).
* Bump debhelper build-dep and compat to 5.
* Bump Standards Version to 3.8.3.
  + Menu policy transition.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    GQ -- a GTK-based LDAP client
 
3
    Copyright (C) 1998-2003 Bert Vermeulen
 
4
    Copyright (C) 2002-2003 Peter Stamfest
 
5
 
 
6
    This program is released under the Gnu General Public License with
 
7
    the additional exemption that compiling, linking, and/or using
 
8
    OpenSSL is allowed.
 
9
 
 
10
    This program is free software; you can redistribute it and/or modify
 
11
    it under the terms of the GNU General Public License as published by
 
12
    the Free Software Foundation; either version 2 of the License, or
 
13
    (at your option) any later version.
 
14
 
 
15
    This program is distributed in the hope that it will be useful,
 
16
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
    GNU General Public License for more details.
 
19
 
 
20
    You should have received a copy of the GNU General Public License
 
21
    along with this program; if not, write to the Free Software
 
22
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
23
*/
 
24
 
 
25
#ifndef GQ_FORMFILL_H
 
26
#define GQ_FORMFILL_H
 
27
 
 
28
#include <ldap_schema.h>
 
29
 
 
30
#ifdef HAVE_CONFIG_H
 
31
# include  <config.h>           /* pull in HAVE_* defines */
 
32
#endif /* HAVE_CONFIG_H */
 
33
 
 
34
#include "common.h"
 
35
 
 
36
G_BEGIN_DECLS
 
37
 
 
38
typedef GObject      GqFormfill;
 
39
typedef GObjectClass GqFormfillClass;
 
40
 
 
41
G_END_DECLS
 
42
 
 
43
#include "syntax.h"
 
44
 
 
45
G_BEGIN_DECLS
 
46
 
 
47
#define GQ_TYPE_FORMFILL         (gq_formfill_get_type())
 
48
#define GQ_FORMFILL(i)           (G_TYPE_CHECK_INSTANCE_CAST((i), GQ_TYPE_FORMFILL, GqFormfill))
 
49
#define GQ_FORMFILL_CLASS(c)     (G_TYPE_CHECK_CLASS_CAST((c), GQ_TYPE_FORMFILL, GqFormfillClass))
 
50
#define GQ_IS_FORMFILL(i)        (G_TYPE_CHECK_INSTANCE_TYPE((i), GQ_TYPE_FORMFILL))
 
51
#define GQ_IS_FORMFILL_CLASS(c)  (G_TYPE_CHECK_CLASS_CAST((c), GQ_TYPE_FORMFILL))
 
52
#define GQ_FORMFILL_GET_CLASS(i) (G_TYPE_INSTANCE_GET_CLASS((i), GQ_TYPE_FORMFILL, GqFormfillClass))
 
53
 
 
54
typedef enum {
 
55
        // FIXME: add DISPLAYTYPE_INVALID = 0,
 
56
        DISPLAYTYPE_DN          = 1,
 
57
        GQ_DISPLAY_TYPE_ENTRY,
 
58
        DISPLAYTYPE_TEXT        = 3,
 
59
        DISPLAYTYPE_PASSWORD    = 4,
 
60
        DISPLAYTYPE_BINARY      = 5,
 
61
        DISPLAYTYPE_JPEG        = 6,
 
62
        DISPLAYTYPE_OC          = 7,
 
63
#ifdef HAVE_LIBCRYPTO
 
64
        DISPLAYTYPE_CERT        = 8,
 
65
        DISPLAYTYPE_CRL         = 9,
 
66
#else
 
67
        DISPLAYTYPE_CERT        = DISPLAYTYPE_BINARY,
 
68
        DISPLAYTYPE_CRL         = DISPLAYTYPE_BINARY,
 
69
#endif
 
70
        DISPLAYTYPE_TIME        = 10,
 
71
        DISPLAYTYPE_INT         = 11,
 
72
        DISPLAYTYPE_NUMSTR      = 12,
 
73
        DISPLAYTYPE_DATE        = 13
 
74
} GQDisplayType;
 
75
#warning "FIXME: call them right"
 
76
 
 
77
typedef GQDisplayType GqDisplayType;
 
78
 
 
79
#warning "FIXME: make flags from these"
 
80
#define FLAG_NOT_IN_SCHEMA      0x01
 
81
#define FLAG_MUST_IN_SCHEMA     0x02
 
82
/* The FLAG_DEL_ME is used to mark form entries not compatible with
 
83
   the schema of the object */
 
84
#define FLAG_DEL_ME             0x04
 
85
/* Used to suppress the "more" button for single valued attributes */
 
86
#define FLAG_SINGLE_VALUE       0x08
 
87
/* Used to temporarily mark attributes added for extensibleObject entries */
 
88
#define FLAG_EXTENSIBLE_OBJECT_ATTR     0x10
 
89
 
 
90
/* Used to disable widgets for attributes marked as no_user_mod */
 
91
#define FLAG_NO_USER_MOD        0x80
 
92
 
 
93
/* forward decls to avoid circular inclusion problems */
 
94
#warning "FIXME: remove these forward decls"
 
95
struct _display_type_handler;
 
96
 
 
97
#warning "FIXME: remove aliases"
 
98
#define DISPLAYTYPE_ENTRY GQ_DISPLAY_TYPE_ENTRY
 
99
#define new_formfill() gq_formfill_new()
 
100
#define free_formfill(i) g_object_unref(i)
 
101
 
 
102
GType        gq_formfill_get_type(void);
 
103
GqFormfill*  gq_formfill_new     (void);
 
104
 
 
105
gboolean     gq_formfill_equals_data (GqFormfill      * form1,
 
106
                                      GqFormfill      * form2);
 
107
 
 
108
gchar const* gq_formfill_get_attrname(GqFormfill const* self);
 
109
void         gq_formfill_set_attrname(GqFormfill      * self,
 
110
                                      gchar const     * attrname);
 
111
 
 
112
GqDisplayType gq_formfill_get_display_type(GqFormfill const* self);
 
113
void          gq_formfill_set_display_type(GqFormfill      * self,
 
114
                                           GqDisplayType     type);
 
115
 
 
116
GType         gq_formfill_get_dt_handler(GqFormfill const* self);
 
117
void          gq_formfill_change_display_type(GqFormfill* self,
 
118
                                              GType       type);
 
119
void          gq_formfill_set_dt_handler(GqFormfill      * self,
 
120
                                         GType             gtype);
 
121
 
 
122
GtkWidget*  gq_formfill_get_event_box(GqFormfill const* self);
 
123
void        gq_formfill_set_event_box(GqFormfill      * self,
 
124
                                      GtkWidget       * event_box);
 
125
 
 
126
int           gq_formfill_get_flags (GqFormfill const* self);
 
127
void          gq_formfill_set_flag  (GqFormfill      * self,
 
128
                                     int               flag);
 
129
void          gq_formfill_unset_flag(GqFormfill      * self,
 
130
                                     int               flag);
 
131
 
 
132
GtkWidget*  gq_formfill_get_label(GqFormfill const* self);
 
133
void        gq_formfill_set_label(GqFormfill      * self,
 
134
                                  GtkWidget       * label);
 
135
 
 
136
GtkWidget*  gq_formfill_get_morebutton(GqFormfill const* self);
 
137
void        gq_formfill_set_morebutton(GqFormfill      * self,
 
138
                                       GtkWidget       * morebutton);
 
139
 
 
140
int         gq_formfill_get_n_inputfields(GqFormfill const* self);
 
141
void        gq_formfill_set_n_inputfields(GqFormfill      * self,
 
142
                                          int               n_fields);
 
143
 
 
144
GqServer*   gq_formfill_get_server(GqFormfill const* self);
 
145
void        gq_formfill_set_server(GqFormfill      * self,
 
146
                                   GqServer        * server);
 
147
 
 
148
GqSyntax*   gq_formfill_get_syntax(GqFormfill const* self);
 
149
void        gq_formfill_set_syntax(GqFormfill      * self,
 
150
                                   GqSyntax        * syntax);
 
151
 
 
152
GList*      gq_formfill_get_values(GqFormfill const* self);
 
153
void        gq_formfill_add_value (GqFormfill      * self,
 
154
                                   GByteArray      * value);
 
155
 
 
156
GtkWidget*  gq_formfill_get_vbox(GqFormfill const* self);
 
157
void        gq_formfill_set_vbox(GqFormfill      * self,
 
158
                                 GtkWidget       * vbox);
 
159
 
 
160
GList*      gq_formfill_get_widgets  (GqFormfill const* self);
 
161
void        gq_formfill_add_widget   (GqFormfill      * self,
 
162
                                      GtkWidget       * widget);
 
163
void        gq_formfill_clear_widgets(GqFormfill      * self);
 
164
 
 
165
#warning "FIXME: (un)init the internal attrs from the class"
 
166
void init_internalAttrs(void);
 
167
gboolean isInternalAttr(const char *attr);
 
168
 
 
169
void free_formlist(GList *formlist);
 
170
void free_formfill_values(GqFormfill *form);
 
171
GList *formlist_append(GList *formlist, GqFormfill *form);
 
172
#warning "FIXME: formfill_from_entry() should get a GqServerDn"
 
173
GList *formlist_from_entry(int error_context,
 
174
                           GqServer *server, 
 
175
                           const char *dn, int ocvalues_only);
 
176
GList *dup_formlist(GList *formlist);
 
177
void dump_formlist(GList *formlist);
 
178
GqFormfill* lookup_attribute(GList      * formlist,
 
179
                             gchar const* attr);
 
180
GqFormfill *lookup_attribute_using_schema(GList *formlist, 
 
181
                                               const char *attr,
 
182
                                               struct server_schema *schema,
 
183
                                               LDAPAttributeType **attrtype);
 
184
int find_displaytype(int error_context, GqServer *server, 
 
185
                     GqFormfill *form);
 
186
void set_displaytype(int error_context, GqServer *server, 
 
187
                     GqFormfill *form);
 
188
 
 
189
char *attr_strip(const char *attr);
 
190
 
 
191
G_END_DECLS
 
192
 
 
193
#endif /* GQ_FORMFILL_H */
 
194