1 // vim: set expandtab tabstop=4 shiftwidth=4:
6 #include "libbife/hit.h"
7 #include "libbife/hash.h"
8 #include "libbife/widget.h"
9 #include "libbife/fallback.h"
10 #include <libxml++/libxml++.h>
21 * @todo Better plug-in support. Cleanning (a lot).
22 * @todo Try to free some memeory :)
24 class Parser: public xmlpp::SaxParser {
27 /// Stack of widget pointers.
28 typedef std::stack<Widget*> WidgetStack;
34 * This is the stack of widgets to know what widget is the parser
39 /// Fallback constructor function pointer.
40 Fallback::Constructor* fbNew;
42 /// Fallback destructor function pointer.
43 Widget::Destructor* fbDel;
45 /// Fallback class name.
49 /// Widget attributes (FIXME - this must be protected?).
55 * Start document handler.
57 virtual void on_start_document(void);
60 * End document handler.
62 virtual void on_end_document(void);
65 * Start element handler.
67 * @param name Element name.
68 * @param attrs Element attributes.
70 virtual void on_start_element(const string&, const AttributeMap&);
73 * End element handler.
75 * @param name Element name.
77 virtual void on_end_element(const string&);
82 * @param chars Characters.
84 virtual void on_characters(const string&);
89 * @param text Comment text.
91 virtual void on_comment(const string&);
96 * @param warn Warning description.
98 virtual void on_warning(const string&);
103 * @param error Error description.
105 virtual void on_error(const string&);
108 * Fatal error handler.
110 * @param error Fatal error description.
112 virtual void on_fatal_error(const string&);
115 * Validity error handler.
117 * @param error Validity error description.
119 virtual void on_validity_error(const string&);
122 * Validity warning handler.
124 * @param warn Validity warning description.
126 virtual void on_validity_warning(const string&);
137 * @param fallback Fallback class name.
139 Parser(const string& = "");
144 virtual ~Parser(void);
147 * Renders the widget using a HIT template.
149 * @param hit HIT template to use to render de widget.
150 * @return Rendered widget.
152 //virtual operator string(void) const;