Dillo v3.1.1-99-gf3103cc4
Loading...
Searching...
No Matches
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
7namespace form {
8
18class Form
19{
20private:
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,
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
90
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
137 lout::container::typed::List <ResourceDecorator> *resources;
139 lout::container::typed::List <FormClickedReceiver> *clickedReceivers;
140
141public:
142 Form ();
143 ~Form ();
144
145 void addTextResource (const char *name,
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__
Represents a button press or release event.
Definition events.hh:58
Receiver interface for the "activate" signal.
Definition ui.hh:297
Receiver interface for the "clicked" signal.
Definition ui.hh:307
Basic interface for all resources.
Definition ui.hh:289
Base interface for dw::core::ui::ListResource and dw::core::ui::OptionMenuResource.
Definition ui.hh:467
Decorates instances of dw::core::ui::CheckButtonResource.
Definition form.hh:80
dw::core::ui::CheckButtonResource * resource
Definition form.hh:82
void leave(dw::core::ui::Resource *resource)
Definition form.cc:149
void activate(dw::core::ui::Resource *resource)
Definition form.cc:140
void enter(dw::core::ui::Resource *resource)
Definition form.cc:145
void clicked(dw::core::ui::Resource *resource, dw::core::EventButton *event)
Definition form.cc:167
Decorates instances of dw::core::ui::RadioButtonResource.
Definition form.hh:62
dw::core::ui::RadioButtonResource * resource
Definition form.hh:64
Decorates instances of dw::core::ui::Resource.
Definition form.hh:28
virtual const char * getValue()=0
const char * getName()
Definition form.hh:37
Decorates instances of dw::core::ui::SelectionResource.
Definition form.hh:95
lout::misc::StringBuffer valueBuf
Definition form.hh:99
dw::core::ui::SelectionResource * resource
Definition form.hh:97
Decorates instances of dw::core::ui::TextResource.
Definition form.hh:45
dw::core::ui::TextResource * resource
Definition form.hh:47
Handles HTML form data.
Definition form.hh:19
void addSelectionResource(const char *name, dw::core::ui::SelectionResource *resource, const char **values)
Adds an instance of dw::core::ui::SelectionResource.
Definition form.cc:225
lout::container::typed::List< FormClickedReceiver > * clickedReceivers
Definition form.hh:139
void addCheckButtonResource(const char *name, dw::core::ui::CheckButtonResource *resource)
Adds an instance of dw::core::ui::CheckButtonResource.
Definition form.cc:215
void addTextResource(const char *name, dw::core::ui::TextResource *resource)
Adds an instance of dw::core::ui::TextResource.
Definition form.cc:191
FormActivateReceiver * activateReceiver
Definition form.hh:138
void addRadioButtonResource(const char *name, dw::core::ui::RadioButtonResource *resource, const char **values)
Adds an instance of dw::core::ui::RadioButtonResource.
Definition form.cc:203
lout::container::typed::List< ResourceDecorator > * resources
Definition form.hh:137
void addButtonResource(const char *name, dw::core::ui::ButtonResource *resource, const char *value)
Definition form.cc:236
void send(const char *buttonName, const char *buttonValue, int x, int y)
Definition form.cc:249
A class for fast concatenation of a large number of strings.
Definition misc.hh:570
This is the base class for many other classes, which defines very common virtual methods.
Definition object.hh:25
Definition form.cc:25