]> git.llucax.com Git - software/bife/bife++.git/blob - libbife/container.h
Added a typeid() demangle example.
[software/bife/bife++.git] / libbife / container.h
1 // vim: set expandtab tabstop=4 shiftwidth=4:
2
3 #ifndef BIFE_CONTAINER_H
4 #define BIFE_CONTAINER_H
5
6 #include "widget.h"
7 #include "hit.h"
8 #include "hash.h"
9 #include <vector>
10 #include <string>
11
12 namespace bife {
13
14     /**
15      * Base Container Class.
16      *
17      * @todo 
18      */
19     class Container: public Widget {
20         // Typedefs
21         protected:
22             typedef std::vector<Widget*> Content;
23
24         // Attributes.
25         protected:
26             /// Content.
27             Content content;
28
29         // Methods.
30         public:
31             /**
32              * Constructor.
33              */
34             Container(void);
35
36             /**
37              * Constructor.
38              *
39              * @param attrs Widget attributes.
40              */
41             Container(const Hash&);
42
43             /**
44              * Constructor.
45              *
46              * @param attrs   Widget attributes.
47              * @param content Content of the widget.
48              */
49             Container(const Hash&, Widget*);
50
51             /**
52              * Constructor.
53              *
54              * @param content Content of the widget.
55              * @param attrs   Widget attributes.
56              */
57             Container(Widget*, const Hash&);
58
59             /**
60              * Destructor.
61              */
62             virtual ~Container(void);
63
64             /**
65              * Renders the widget using a HIT template.
66              *
67              * @param  hit HIT template to use to render de widget.
68              * @return Rendered widget.
69              */
70             virtual string renderContent(HIT&);
71
72             /**
73              * Appends a widget to the container.
74              *
75              * @param widget Widget to append.
76              */
77             virtual void append(Widget*);
78     };
79
80 }
81
82 #endif