]> git.llucax.com Git - software/bife/bife++.git/blob - widget.h
First parser implementation that creates the widgets tree.
[software/bife/bife++.git] / widget.h
1 // vim: set expandtab tabstop=4 shiftwidth=4:
2
3 #ifndef BIFE_WIDGET_H
4 #define BIFE_WIDGET_H
5
6 #include "hit.h"
7 #include "hash.h"
8 #include <string>
9
10 namespace bife {
11
12     using std::string;
13
14     /**
15      * Base Widget Class.
16      *
17      * @todo 
18      */
19     class Widget {
20         // Attributes.
21         public:
22             /// Widget attributes.
23             Hash attrs;
24
25         // Methods.
26         public:
27             /**
28              * Constructor.
29              */
30             Widget(void);
31
32             /**
33              * Constructor.
34              *
35              * @param attrs Widget attributes.
36              */
37             Widget(const Hash&);
38
39             /**
40              * Destructor.
41              */
42             virtual ~Widget(void);
43
44             /**
45              * Renders the widget using a HIT template.
46              *
47              * @param  hit HIT template to use to render de widget.
48              * @return Rendered widget.
49              */
50             virtual string render(HIT&) = 0;
51
52             /**
53              * Renders the widget using a HIT template.
54              *
55              * @param  hit HIT template to use to render de widget.
56              * @return Rendered widget.
57              */
58             virtual operator string(void) const;
59     };
60
61 }
62
63 #endif