00001 #ifndef SGE_GUI_LAYOUTS_ROW_HPP_INCLUDED
00002 #define SGE_GUI_LAYOUTS_ROW_HPP_INCLUDED
00003
00004 #include "../layout.hpp"
00005 #include "../../export.hpp"
00006 #include "../size_policy.hpp"
00007 #include <vector>
00008 #include <cstddef>
00009
00010 namespace sge
00011 {
00012 namespace gui
00013 {
00014 class widget;
00015 namespace layouts
00016 {
00017 class SGE_CLASS_SYMBOL row : public layout
00018 {
00019 public:
00020 SGE_SYMBOL row(widgets::container &);
00021 SGE_SYMBOL void update();
00022 SGE_SYMBOL dim const size_hint() const;
00023 private:
00024
00025
00026
00027 virtual std::size_t master() const = 0;
00028 std::size_t slave() const
00029 {
00030 return master() == static_cast<std::size_t>(0)
00031 ? static_cast<std::size_t>(1)
00032 : static_cast<std::size_t>(0);
00033 }
00034
00035 void adapt(dim const &,dim const &,axis_policy::type,std::size_t);
00036 void adapt_outer(dim const &,dim const &,std::size_t);
00037 void update_widgets(dim const &);
00038 void reset_cache();
00039 unsigned count_flags(axis_policy::type,std::size_t) const;
00040
00041 typedef std::vector<std::pair<widget*,dim> > widget_map;
00042
00043 widget_map sizes;
00044 };
00045 }
00046 }
00047 }
00048
00049 #endif