]> git.llucax.com Git - software/bife/bife++.git/blobdiff - container.h
Added a string substr test.
[software/bife/bife++.git] / container.h
index 41ac0a6ef85363ac2636310c0465e3543ad11072..eb2bb1f188acdc62dd8ce42e624ded04b1c6d6b0 100644 (file)
@@ -9,73 +9,76 @@
 #include <vector>
 #include <string>
 
 #include <vector>
 #include <string>
 
-using std::string;
+namespace bife {
 
 
-/**
- * Base Container Class.
- *
- * @todo 
- */
-class Container: public Widget {
-    // Typedefs
-    protected:
-        typedef std::vector<Widget> Content;
+    using std::string;
 
 
-    // Attributes.
-    protected:
-        /// Content.
-        Content content;
+    /**
+     * Base Container Class.
+     *
+     * @todo 
+     */
+    class Container: public Widget {
+        // Typedefs
+        protected:
+            typedef std::vector<Widget*> Content;
 
 
-    // Methods.
-    public:
-        /**
-         * Constructor.
-         */
-        Container(void);
+        // Attributes.
+        protected:
+            /// Content.
+            Content content;
 
 
-        /**
-         * Constructor.
-         *
-         * @param attrs Widget attributes.
-         */
-        Container(Hash);
+        // Methods.
+        public:
+            /**
+             * Constructor.
+             */
+            Container(void);
 
 
-        /**
-         * Constructor.
-         *
-         * @param attrs   Widget attributes.
-         * @param content Content of the widget.
-         */
-        Container(Hash, Widget&);
+            /**
+             * Constructor.
+             *
+             * @param attrs Widget attributes.
+             */
+            Container(const Hash&);
 
 
-        /**
-         * Constructor.
-         *
-         * @param content Content of the widget.
-         * @param attrs   Widget attributes.
-         */
-        Container(Widget&, Hash);
+            /**
+             * Constructor.
+             *
+             * @param attrs   Widget attributes.
+             * @param content Content of the widget.
+             */
+            Container(const Hash&, Widget*);
 
 
-        /**
-         * Destructor.
-         */
-        virtual ~Container(void);
+            /**
+             * Constructor.
+             *
+             * @param content Content of the widget.
+             * @param attrs   Widget attributes.
+             */
+            Container(Widget*, const Hash&);
 
 
-        /**
-         * Renders the widget using a HIT template.
-         *
-         * @param  hit HIT template to use to render de widget.
-         * @return Rendered widget.
-         */
-        virtual string render(HIT&) = 0;
+            /**
+             * Destructor.
+             */
+            virtual ~Container(void);
 
 
-        /**
-         * Renders the widget using a HIT template.
-         *
-         * @param  hit HIT template to use to render de widget.
-         * @return Rendered widget.
-         */
-        string renderContent(HIT&);
-};
+            /**
+             * Renders the widget using a HIT template.
+             *
+             * @param  hit HIT template to use to render de widget.
+             * @return Rendered widget.
+             */
+            virtual string renderContent(HIT&);
+
+            /**
+             * Appends a widget to the container.
+             *
+             * @param widget Widget to append.
+             */
+            virtual void append(Widget*);
+    };
+
+}
 
 #endif
 
 #endif