Dillo
form.hh
Go to the documentation of this file.
1 #ifndef __TEST_FORM_HH__
2 #define __TEST_FORM_HH__
3 
4 #include "../dw/core.hh"
5 #include "../dw/ui.hh"
6 
7 namespace form {
8 
18 class Form
19 {
20 private:
28  {
29  private:
30  const char *name;
31 
32  protected:
33  ResourceDecorator (const char *name);
35 
36  public:
37  inline const char *getName () { return name; }
38  virtual const char *getValue () = 0;
39  };
40 
45  {
46  private:
48 
49  public:
50  TextResourceDecorator (const char *name,
51  dw::core::ui::TextResource *resource);
52  const char *getValue ();
53  };
54 
62  {
63  private:
65  const char **values;
66 
67  public:
70  *resource,
71  const char **values);
73  const char *getValue ();
74  };
75 
80  {
81  private:
83 
84  public:
87  *resource);
88  const char *getValue ();
89  };
90 
95  {
96  private:
98  const char **values;
100 
101  public:
102  SelectionResourceDecorator (const char *name,
104  const char **values);
106  const char *getValue ();
107  };
108 
110  {
111  private:
113 
114  public:
115  inline FormActivateReceiver (Form *form) { this->form = form; }
116 
117  void activate (dw::core::ui::Resource *resource);
118  void enter (dw::core::ui::Resource *resource);
119  void leave (dw::core::ui::Resource *resource);
120  };
121 
124  {
125  private:
127  const char *name, *value;
128 
129  public:
130  FormClickedReceiver (Form *form, const char *name, const char *value);
132 
133  void clicked(dw::core::ui::Resource *resource,
134  dw::core::EventButton *event);
135  };
136 
140 
141 public:
142  Form ();
143  ~Form ();
144 
145  void addTextResource (const char *name,
146  dw::core::ui::TextResource *resource);
147  void addRadioButtonResource (const char *name,
149  const char **values);
150  void addCheckButtonResource (const char *name,
152  void addSelectionResource (const char *name,
154  const char **values);
155  void addButtonResource (const char *name,
157  const char *value);
158 
159  void send (const char *buttonName, const char *buttonValue, int x, int y);
160 };
161 
162 } // namespace form
163 
164 #endif // __TEST_FORM_HH__
FormActivateReceiver * activateReceiver
Definition: form.hh:138
Definition: form.hh:122
Form()
Definition: form.cc:172
const char * getValue()
Definition: form.cc:95
A class for fast concatenation of a large number of strings.
Definition: misc.hh:565
const char * name
Definition: form.hh:127
const char ** values
Definition: form.hh:65
void activate(dw::core::ui::Resource *resource)
Definition: form.cc:139
Decorates instances of dw::core::ui::RadioButtonResource.
Definition: form.hh:61
Definition: ui.hh:393
Receiver interface for the "activate" signal.
Definition: ui.hh:296
Definition: ui.hh:516
dw::core::ui::CheckButtonResource * resource
Definition: form.hh:82
void send(const char *buttonName, const char *buttonValue, int x, int y)
Definition: form.cc:248
~SelectionResourceDecorator()
Definition: form.cc:115
lout::misc::StringBuffer valueBuf
Definition: form.hh:99
Form * form
Definition: form.hh:112
~FormClickedReceiver()
Definition: form.cc:160
This is the base class for many other classes, which defines very common virtual methods.
Definition: object.hh:24
Represents a button press or release event.
Definition: events.hh:57
Receiver interface for the "clicked" signal.
Definition: ui.hh:306
Decorates instances of dw::core::ui::SelectionResource.
Definition: form.hh:94
dw::core::ui::SelectionResource * resource
Definition: form.hh:97
Decorates instances of dw::core::ui::TextResource.
Definition: form.hh:44
void enter(dw::core::ui::Resource *resource)
Definition: form.cc:144
const char ** values
Definition: form.hh:98
FormActivateReceiver(Form *form)
Definition: form.hh:115
~ResourceDecorator()
Definition: form.cc:33
void addTextResource(const char *name, dw::core::ui::TextResource *resource)
Adds an instance of dw::core::ui::TextResource.
Definition: form.cc:190
const char * value
Definition: form.hh:127
void addCheckButtonResource(const char *name, dw::core::ui::CheckButtonResource *resource)
Adds an instance of dw::core::ui::CheckButtonResource.
Definition: form.cc:214
ResourceDecorator(const char *name)
Definition: form.cc:28
RadioButtonResourceDecorator(const char *name, dw::core::ui::RadioButtonResource *resource, const char **values)
Definition: form.cc:51
const char * getValue()
Definition: form.cc:72
SelectionResourceDecorator(const char *name, dw::core::ui::SelectionResource *resource, const char **values)
Definition: form.cc:101
Decorates instances of dw::core::ui::Resource.
Definition: form.hh:27
Definition: form.cc:24
TextResourceDecorator(const char *name, dw::core::ui::TextResource *resource)
Definition: form.cc:38
void addButtonResource(const char *name, dw::core::ui::ButtonResource *resource, const char *value)
Definition: form.cc:235
dw::core::ui::RadioButtonResource * resource
Definition: form.hh:64
const char * getValue()
Definition: form.cc:45
Handles HTML form data.
Definition: form.hh:18
lout::container::typed::List< ResourceDecorator > * resources
Definition: form.hh:137
lout::container::typed::List< FormClickedReceiver > * clickedReceivers
Definition: form.hh:139
dw::core::ui::TextResource * resource
Definition: form.hh:47
Basic interface for all resources.
Definition: ui.hh:288
Decorates instances of dw::core::ui::CheckButtonResource.
Definition: form.hh:79
Form * form
Definition: form.hh:126
const char * getValue()
Definition: form.cc:122
const char * getName()
Definition: form.hh:37
CheckButtonResourceDecorator(const char *name, dw::core::ui::CheckButtonResource *resource)
Definition: form.cc:89
FormClickedReceiver(Form *form, const char *name, const char *value)
Definition: form.cc:152
~RadioButtonResourceDecorator()
Definition: form.cc:65
void leave(dw::core::ui::Resource *resource)
Definition: form.cc:148
const char * name
Definition: form.hh:30
virtual const char * getValue()=0
Base interface for dw::core::ui::ListResource and dw::core::ui::OptionMenuResource.
Definition: ui.hh:466
Typed version of container::untyped::List.
Definition: container.hh:463
void addRadioButtonResource(const char *name, dw::core::ui::RadioButtonResource *resource, const char **values)
Adds an instance of dw::core::ui::RadioButtonResource.
Definition: form.cc:202
~Form()
Definition: form.cc:180
void addSelectionResource(const char *name, dw::core::ui::SelectionResource *resource, const char **values)
Adds an instance of dw::core::ui::SelectionResource.
Definition: form.cc:224
Definition: form.hh:109
void clicked(dw::core::ui::Resource *resource, dw::core::EventButton *event)
Definition: form.cc:166