faithui/faith/gridlayout.h

Go to the documentation of this file.
00001 #ifndef FAITH__GRIDLAYOUT_H
00002 #define FAITH__GRIDLAYOUT_H
00003 
00004 #include <faith/layout.h>
00005 #include <faith/sizepolicy.h>
00006 #include <faith/ui.h>
00007 
00008 namespace Faith
00009 {
00010 
00011 class FAITH_UI_EXPORT GridLayout : public Layout
00012 {
00013         struct GridLayoutPrivate;
00014         GridLayoutPrivate *d;
00015 
00016         struct CellInfo;
00017 
00018 public:
00019         GridLayout(Faith::Widget *widget, int margin=0, int spacing=-1);
00020         virtual ~GridLayout();
00021         
00022         void addWidget(Faith::Widget *w, int row, int col, int rows, int cols);
00023         void addLayout(Faith::Layout *l, int row, int col, int rows, int cols);
00024         
00025         void addWidget(Faith::Widget *w, int row, int col)
00026                 { addWidget(w, row, col, 1, 1); }
00027         void addLayout(Faith::Layout *l, int row, int col)
00028                 { addLayout(l, row, col, 1, 1); }
00029         
00033         unsigned numRows() const;
00034 
00038         unsigned numColumns() const;
00039 
00040 protected:
00041         virtual void layout();
00042         
00043         virtual void childAdded(Faith::Widget *w);
00044         
00045         virtual void childRemoved(Faith::Widget *w);
00046         
00047         virtual Faith::Size minimumSize() const;
00048         virtual Faith::Size maximumSize() const;
00049 
00050 private:
00051         void itemsIntoCells();
00052         LayoutItem *at(unsigned row, unsigned col);
00053 };
00054 
00055 
00056 }
00057 
00058 #endif

Generated on Fri Sep 1 00:23:07 2006 for Faith by  doxygen 1.4.7