1#ifndef __SLINEARLAYOUT__H__
2#define __SLINEARLAYOUT__H__
4#include <interface/slayout-i.h>
5#include <layout/SLinearLayoutParamStruct.h>
6#include <sobject/Sobject.hpp>
16 ,
protected SLinearLayoutParamStruct {
19 friend class SLinearLayout;
30 STDMETHOD_(
void,
Clear)(THIS) OVERRIDE;
37 STDMETHOD_(BOOL,
IsMatchParent)(THIS_ ORIENTATION orientation) SCONST OVERRIDE;
44 STDMETHOD_(BOOL,
IsWrapContent)(THIS_ ORIENTATION orientation) SCONST OVERRIDE;
51 STDMETHOD_(BOOL,
IsSpecifiedSize)(THIS_ ORIENTATION orientation) SCONST OVERRIDE;
64 STDMETHOD_(
void,
SetMatchParent)(THIS_ ORIENTATION orientation) OVERRIDE;
70 STDMETHOD_(
void,
SetWrapContent)(THIS_ ORIENTATION orientation) OVERRIDE;
78 (THIS_ ORIENTATION orientation,
const SLayoutSize &layoutSize) OVERRIDE;
90 STDMETHOD_(ILayoutParam *,
Clone)(THIS) SCONST OVERRIDE;
97 ATTR_FLOAT(L
"weight", weight, FALSE)
98 ATTR_ENUM_BEGIN(L
"layout_gravity", Gravity, FALSE)
99 ATTR_ENUM_VALUE(L
"left", G_Left)
100 ATTR_ENUM_VALUE(L
"top", G_Top)
101 ATTR_ENUM_VALUE(L
"center", G_Center)
102 ATTR_ENUM_VALUE(L
"right", G_Right)
103 ATTR_ENUM_VALUE(L
"bottom", G_Bottom)
104 ATTR_ENUM_END(gravity)
106 ATTR_LAYOUTSIZE(L
"extend_left", extend_left, FALSE)
107 ATTR_LAYOUTSIZE(L
"extend_top", extend_top, FALSE)
108 ATTR_LAYOUTSIZE(L
"extend_right", extend_right, FALSE)
109 ATTR_LAYOUTSIZE(L
"extend_bottom", extend_bottom, FALSE)
169 STDMETHOD_(BOOL,
IsParamAcceptable)(THIS_
const ILayoutParam *pLayoutParam) SCONST OVERRIDE;
175 STDMETHOD_(
void,
LayoutChildren)(THIS_ IWindow *pParent) OVERRIDE;
191 (THIS_
const IWindow *pParent,
int nWidth,
int nHeight) SCONST OVERRIDE;
194 ATTR_ENUM_BEGIN(L
"orientation", ORIENTATION, FALSE)
195 ATTR_ENUM_VALUE(L
"horizontal", Horz)
196 ATTR_ENUM_VALUE(L
"vertical", Vert)
197 ATTR_ENUM_END(m_orientation)
198 ATTR_ENUM_BEGIN(L
"gravity", Gravity, FALSE)
199 ATTR_ENUM_VALUE(L
"left", G_Left)
200 ATTR_ENUM_VALUE(L
"top", G_Top)
201 ATTR_ENUM_VALUE(L
"center", G_Center)
202 ATTR_ENUM_VALUE(L
"right", G_Right)
203 ATTR_ENUM_VALUE(L
"bottom", G_Bottom)
204 ATTR_ENUM_END(m_gravity)
205 ATTR_LAYOUTSIZE(L
"interval", m_interval, FALSE)
209 ORIENTATION m_orientation;
227 m_orientation = Vert;
244 m_orientation = Horz;
void LayoutChildren(IWindow *pParent) OVERRIDE
布局子窗口
BOOL IsParamAcceptable(const ILayoutParam *pLayoutParam) SCONST OVERRIDE
检查布局参数是否可接受
ILayoutParam * CreateLayoutParam() SCONST OVERRIDE
创建布局参数对象
SIZE MeasureChildren(const IWindow *pParent, int nWidth, int nHeight) SCONST OVERRIDE
测量子窗口大小
SLayoutSize GetSpecifiedSize(ORIENTATION orientation) SCONST OVERRIDE
获取指定大小
void SetMatchParent(ORIENTATION orientation) OVERRIDE
设置匹配父容器大小
void Clear() OVERRIDE
清除布局参数
HRESULT OnAttrSize(const SStringW &strValue, BOOL bLoading)
处理大小属性
HRESULT OnAttrWidth(const SStringW &strValue, BOOL bLoading)
处理宽度属性
BOOL IsSpecifiedSize(ORIENTATION orientation) SCONST OVERRIDE
检查是否指定大小
void * GetRawData() OVERRIDE
获取原始数据指针
void SetWrapContent(ORIENTATION orientation) OVERRIDE
设置包裹内容大小
BOOL IsWrapContent(ORIENTATION orientation) SCONST OVERRIDE
检查是否包裹内容大小
void SetSpecifiedSize(ORIENTATION orientation, const SLayoutSize &layoutSize) OVERRIDE
设置指定大小
HRESULT OnAttrExtend(const SStringW &strValue, BOOL bLoading)
处理扩展属性
HRESULT OnAttrHeight(const SStringW &strValue, BOOL bLoading)
处理高度属性
BOOL IsMatchParent(ORIENTATION orientation) SCONST OVERRIDE
检查是否匹配父容器大小
ILayoutParam * Clone() SCONST OVERRIDE
克隆布局参数
A class representing an ASCII string.