~ubuntu-branches/ubuntu/maverick/ekiga/maverick

« back to all changes in this revision

Viewing changes to lib/engine/framework/form-builder.h

  • Committer: Bazaar Package Importer
  • Author(s): Eugen Dedu, Eugen Dedu, Loic Minier
  • Date: 2008-09-27 10:00:00 UTC
  • mfrom: (1.1.8 upstream)
  • mto: (1.4.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 38.
  • Revision ID: james.westby@ubuntu.com-20080927100000-l5k5werb6czr5b3h
Tags: 3.0.1-1
[ Eugen Dedu ]
* New version.  (Closes: #500089).
* Add our own changelog file in /usr/share/doc.
* Remove gnomemeeting transitional package.
* Discover new interfaces.  (Closes: #488199).
* Compile with dbus support.  (Closes: #467212).
* Numeric keypad inserts digits at correct position.  (Closes: #440159).
* Use libnotify upon call.  (Closes: #412604).
* Symlink identical GNOME help files, to reduce size.  (Closes: #505536).
* Explicitely build-depends on a few dev packages, even if they were
  pulled out anyway by the other dependencies.

[ Loic Minier ]
* Use clean:: instead of clean: in rules.
* Don't disable Uploaders: generation for control.in -> control generation
  in rules.
* Fix some tabs which were size 4 anyway.
* Generate a PO template during build by calling intltool-update -p in
  install; thanks Ubuntu and Martin Pitt; closes: #505535.
* Also let the -dbg depend on ${misc:Depends}.
* Cleanup rules; in particular, use dpkg-parsechangelog and honor
  distclean/clean failures, remove old clean rules, commented out stuff,
  gtk-only stuff.
* Pass -s to dh_* in binary-arch.
* Use debian/*.links and debian/*.manpages instead of symlink manually or
  passing files to dh_installman.
* Use ftp.gnome.org in copyright.
* Switch to quilt and fix target deps in the process; build-dep on quilt
  instead of dpatch; rename news.dpatch to 00_news.patch and refresh;
  replace 00list with series.
* Install autotools-dev config.guess and .sub after patching.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*
 
3
 * Ekiga -- A VoIP and Video-Conferencing application
 
4
 * Copyright (C) 2000-2007 Damien Sandras
 
5
 
 
6
 * This program is free software; you can  redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or (at
 
9
 * your option) any later version. This program is distributed in the hope
 
10
 * that it will be useful, but WITHOUT ANY WARRANTY; without even the
 
11
 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
12
 * See the GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License along
 
15
 * with this program; if not, write to the Free Software Foundation, Inc.,
 
16
 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
17
 *
 
18
 * Ekiga is licensed under the GPL license and as a special exception, you
 
19
 * have permission to link or otherwise combine this program with the
 
20
 * programs OPAL, OpenH323 and PWLIB, and distribute the combination, without
 
21
 * applying the requirements of the GNU GPL to the OPAL, OpenH323 and PWLIB
 
22
 * programs, as long as you do follow the requirements of the GNU GPL for all
 
23
 * the rest of the software thus combined.
 
24
 */
 
25
 
 
26
 
 
27
/*
 
28
 *                         form-builder.h  -  description
 
29
 *                         ------------------------------------------
 
30
 *   begin                : written in 2007 by Julien Puydt
 
31
 *   copyright            : (c) 2007 by Julien Puydt
 
32
 *   description          : declaration of an object able to build a form
 
33
 *
 
34
 */
 
35
 
 
36
#ifndef __FORM_BUILDER_H__
 
37
#define __FORM_BUILDER_H__
 
38
 
 
39
#include <list>
 
40
 
 
41
#include "form.h"
 
42
 
 
43
namespace Ekiga
 
44
{
 
45
 
 
46
/**
 
47
 * @addtogroup forms
 
48
 * @{
 
49
 */
 
50
 
 
51
  class FormBuilder: public virtual Form, public virtual FormVisitor
 
52
  {
 
53
  public:
 
54
 
 
55
    FormBuilder ();
 
56
 
 
57
    /* form part */
 
58
 
 
59
    void visit (FormVisitor &visitor) const;
 
60
 
 
61
    const std::string hidden (const std::string name) const;
 
62
 
 
63
    bool boolean (const std::string name) const;
 
64
 
 
65
    const std::string text (const std::string name) const;
 
66
 
 
67
    const std::string private_text (const std::string name) const;
 
68
 
 
69
    const std::string multi_text (const std::string name) const;
 
70
 
 
71
    const std::string single_choice (const std::string name) const;
 
72
 
 
73
    const std::set<std::string> multiple_choice (const std::string name) const;
 
74
 
 
75
    const std::set<std::string> editable_set (const std::string name) const;
 
76
 
 
77
    /* builder part */
 
78
 
 
79
    void title (const std::string title);
 
80
 
 
81
    void instructions (const std::string instructions);
 
82
 
 
83
    void link (const std::string link,
 
84
               const std::string uri);
 
85
 
 
86
    void error (const std::string error);
 
87
 
 
88
    void hidden (const std::string name,
 
89
                 const std::string value);
 
90
 
 
91
    void boolean (const std::string name,
 
92
                  const std::string description,
 
93
                  bool value);
 
94
 
 
95
    void text (const std::string text,
 
96
               const std::string description,
 
97
               const std::string value);
 
98
 
 
99
    void private_text (const std::string text,
 
100
                       const std::string description,
 
101
                       const std::string value);
 
102
 
 
103
    void multi_text (const std::string text,
 
104
                     const std::string description,
 
105
                     const std::string value);
 
106
 
 
107
    void single_choice (const std::string name,
 
108
                        const std::string description,
 
109
                        const std::string value,
 
110
                        const std::map<std::string, std::string> choices);
 
111
 
 
112
    void multiple_choice (const std::string name,
 
113
                          const std::string description,
 
114
                          const std::set<std::string> values,
 
115
                          const std::map<std::string, std::string> choices);
 
116
 
 
117
    void editable_set (const std::string name,
 
118
                       const std::string description,
 
119
                       const std::set<std::string> values,
 
120
                       const std::set<std::string> proposed_values);
 
121
  private:
 
122
 
 
123
    struct HiddenField
 
124
    {
 
125
      HiddenField (const std::string _name,
 
126
                   const std::string _value): name(_name), value(_value)
 
127
      {}
 
128
 
 
129
      const std::string name;
 
130
      const std::string value;
 
131
    };
 
132
 
 
133
    struct BooleanField
 
134
    {
 
135
      BooleanField (const std::string _name,
 
136
                    const std::string _description,
 
137
                    bool _value): name(_name), description(_description),
 
138
                                  value(_value)
 
139
      {}
 
140
 
 
141
      const std::string name;
 
142
      const std::string description;
 
143
      bool value;
 
144
    };
 
145
 
 
146
    struct TextField
 
147
    {
 
148
      TextField (const std::string _name,
 
149
                 const std::string _description,
 
150
                 const std::string _value): name(_name),
 
151
                                            description(_description),
 
152
                                            value(_value)
 
153
      {}
 
154
 
 
155
      const std::string name;
 
156
      const std::string description;
 
157
      const std::string value;
 
158
    };
 
159
 
 
160
    struct MultiTextField
 
161
    {
 
162
      MultiTextField (const std::string _name,
 
163
                      const std::string _description,
 
164
                      const std::string _value): name(_name),
 
165
                                                 description(_description),
 
166
                                                 value(_value)
 
167
      {}
 
168
 
 
169
      const std::string name;
 
170
      const std::string description;
 
171
      const std::string value;
 
172
    };
 
173
 
 
174
    struct SingleChoiceField
 
175
    {
 
176
      SingleChoiceField (const std::string _name,
 
177
                         const std::string _description,
 
178
                         const std::string _value,
 
179
                         const std::map<std::string, std::string> _choices):
 
180
        name(_name), description(_description),
 
181
        value(_value), choices(_choices)
 
182
      {}
 
183
 
 
184
      const std::string name;
 
185
      const std::string description;
 
186
      const std::string value;
 
187
      const std::map<std::string, std::string> choices;
 
188
    };
 
189
 
 
190
 
 
191
    struct MultipleChoiceField
 
192
    {
 
193
      MultipleChoiceField (const std::string _name,
 
194
                           const std::string _description,
 
195
                           const std::set<std::string> _values,
 
196
                           const std::map<std::string, std::string> _choices):
 
197
        name(_name), description(_description),
 
198
        values(_values), choices(_choices)
 
199
      {}
 
200
 
 
201
      const std::string name;
 
202
      const std::string description;
 
203
      const std::set<std::string> values;
 
204
      const std::map<std::string, std::string> choices;
 
205
    };
 
206
 
 
207
    struct EditableSetField
 
208
    {
 
209
      EditableSetField (const std::string _name,
 
210
                        const std::string _description,
 
211
                        const std::set<std::string> _values,
 
212
                        const std::set<std::string> _proposed_values):
 
213
        name(_name), description(_description),
 
214
        values(_values), proposed_values(_proposed_values)
 
215
      {}
 
216
 
 
217
      const std::string name;
 
218
      const std::string description;
 
219
      const std::set<std::string> values;
 
220
      const std::set<std::string> proposed_values;
 
221
    };
 
222
 
 
223
    typedef enum {
 
224
 
 
225
      HIDDEN,
 
226
      BOOLEAN,
 
227
      TEXT,
 
228
      PRIVATE_TEXT,
 
229
      MULTI_TEXT,
 
230
      SINGLE_CHOICE,
 
231
      MULTIPLE_CHOICE,
 
232
      EDITABLE_SET
 
233
    } FieldType;
 
234
 
 
235
    std::string my_title;
 
236
    std::string my_instructions;
 
237
    std::pair<std::string, std::string> my_link;
 
238
    std::string my_error;
 
239
    std::list<FieldType> ordering;
 
240
    std::list<struct HiddenField> hiddens;
 
241
    std::list<struct BooleanField> booleans;
 
242
    std::list<struct TextField> texts;
 
243
    std::list<struct TextField> private_texts;
 
244
    std::list<struct MultiTextField> multi_texts;
 
245
    std::list<struct SingleChoiceField> single_choices;
 
246
    std::list<struct MultipleChoiceField> multiple_choices;
 
247
    std::list<struct EditableSetField> editable_sets;
 
248
  };
 
249
 
 
250
/**
 
251
 * @}
 
252
 */
 
253
 
 
254
};
 
255
#endif