00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef SkStackViewLayout_DEFINED
00018 #define SkStackViewLayout_DEFINED
00019
00020 #include "SkView.h"
00021
00022 class SkStackViewLayout : public SkView::Layout {
00023 public:
00024 SkStackViewLayout();
00025
00026 enum Orient {
00027 kHorizontal_Orient,
00028 kVertical_Orient,
00029
00030 kOrientCount
00031 };
00032 Orient getOrient() const { return (Orient)fOrient; }
00033 void setOrient(Orient);
00034
00035 void getMargin(SkRect*) const;
00036 void setMargin(const SkRect&);
00037
00038 SkScalar getSpacer() const { return fSpacer; }
00039 void setSpacer(SkScalar);
00040
00043 enum Pack {
00044 kStart_Pack,
00045 kCenter_Pack,
00046 kEnd_Pack,
00047
00048 kPackCount
00049 };
00050 Pack getPack() const { return (Pack)fPack; }
00051 void setPack(Pack);
00052
00055 enum Align {
00056 kStart_Align,
00057 kCenter_Align,
00058 kEnd_Align,
00059 kStretch_Align,
00060
00061 kAlignCount
00062 };
00063 Align getAlign() const { return (Align)fAlign; }
00064 void setAlign(Align);
00065
00066 bool getRound() const { return SkToBool(fRound); }
00067 void setRound(bool);
00068
00069 protected:
00070 virtual void onLayoutChildren(SkView* parent);
00071 virtual void onInflate(const SkDOM&, const SkDOM::Node*);
00072
00073 private:
00074 SkRect fMargin;
00075 SkScalar fSpacer;
00076 uint8_t fOrient, fPack, fAlign, fRound;
00077 };
00078
00079 class SkFillViewLayout : public SkView::Layout {
00080 public:
00081 SkFillViewLayout();
00082 void getMargin(SkRect*) const;
00083 void setMargin(const SkRect&);
00084
00085 protected:
00086
00087 virtual void onLayoutChildren(SkView* parent);
00088 virtual void onInflate(const SkDOM& dom, const SkDOM::Node* node);
00089
00090 private:
00091 SkRect fMargin;
00092 typedef SkView::Layout INHERITED;
00093 };
00094
00095 #endif
00096