1#ifndef __SOUILAYOUT__H__
2#define __SOUILAYOUT__H__
4#include <interface/slayout-i.h>
5#include <layout/SouiLayoutParamStruct.h>
6#include <sobject/Sobject.hpp>
16 ,
protected SouiLayoutParamStruct {
19 friend class SouiLayout;
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;
106 int GetExtraSize(ORIENTATION orientation,
int nScale)
const;
206 STDMETHOD_(BOOL,
IsParamAcceptable)(THIS_
const ILayoutParam *pLayoutParam) SCONST OVERRIDE;
212 STDMETHOD_(
void,
LayoutChildren)(THIS_ IWindow *pParent) OVERRIDE;
228 (THIS_
const IWindow *pParent,
int nWidth,
int nHeight) SCONST OVERRIDE;
249 void CalcPositionEx(SList<WndPos> *pListChildren,
int nWidth,
int nHeight)
const;
258 int CalcPostion(SList<WndPos> *pListChildren,
int nWidth,
int nHeight)
const;
270 int PositionItem2Value(SList<WndPos> *pLstChilds, SPOSITION position,
const POS_INFO &pos,
int nMax, BOOL bX,
int nScale)
const;
A class representing an ASCII string.
Base class for SOUI DUI windows.
SWindow * GetRefSibling(SWindow *pCurWnd, int uCode)
获取参考兄弟窗口
int CalcChildBottom(SWindow *pWindow, SouiLayoutParam *pParam)
计算子窗口底部位置
void CalcPositionEx(SList< WndPos > *pListChildren, int nWidth, int nHeight) const
计算扩展位置
BOOL IsParamAcceptable(const ILayoutParam *pLayoutParam) SCONST OVERRIDE
检查布局参数是否可接受
CRect GetWindowLayoutRect(SWindow *pWindow)
获取窗口布局矩形区域
int PositionItem2Value(SList< WndPos > *pLstChilds, SPOSITION position, const POS_INFO &pos, int nMax, BOOL bX, int nScale) const
将位置项转换为值
SIZE MeasureChildren(const IWindow *pParent, int nWidth, int nHeight) SCONST OVERRIDE
测量子窗口大小
int CalcPostion(SList< WndPos > *pListChildren, int nWidth, int nHeight) const
计算位置
ILayoutParam * CreateLayoutParam() SCONST OVERRIDE
创建布局参数对象
BOOL IsWaitingPos(int nPos) const
检查位置是否等待
void LayoutChildren(IWindow *pParent) OVERRIDE
布局子窗口
int CalcChildRight(SWindow *pWindow, SouiLayoutParam *pParam)
计算子窗口右侧位置
int CalcChildTop(SWindow *pWindow, SouiLayoutParam *pParam)
计算子窗口顶部位置
int CalcChildLeft(SWindow *pWindow, SouiLayoutParam *pParam)
计算子窗口左侧位置
ILayoutParam * Clone() SCONST OVERRIDE
克隆布局参数
BOOL IsSpecifiedSize(ORIENTATION orientation) SCONST OVERRIDE
检查是否指定大小
BOOL ParsePosition12(const SStringW &pos1, const SStringW &pos2)
解析在pos中定义的前两个位置
void SetSpecifiedSize(ORIENTATION orientation, const SLayoutSize &layoutSize) OVERRIDE
设置指定大小
HRESULT OnAttrPos(const SStringW &strValue, BOOL bLoading)
处理位置属性
HRESULT OnAttrSize(const SStringW &strValue, BOOL bLoading)
处理大小属性
BOOL StrPos2ItemPos(const SStringW &strPos, POS_INFO &posItem)
将字符串描述的坐标转换成POSITION_ITEM
HRESULT OnAttrWidth(const SStringW &strValue, BOOL bLoading)
处理宽度属性
void Clear() OVERRIDE
清除布局参数
void * GetRawData() OVERRIDE
获取原始数据指针
SLayoutSize GetSpecifiedSize(ORIENTATION orientation) SCONST OVERRIDE
获取指定大小
int GetExtraSize(ORIENTATION orientation, int nScale) const
获取额外大小
HRESULT OnAttrHeight(const SStringW &strValue, BOOL bLoading)
处理高度属性
BOOL IsWrapContent(ORIENTATION orientation) SCONST OVERRIDE
检查是否包裹内容大小
void SetMatchParent(ORIENTATION orientation) OVERRIDE
设置匹配父容器大小
bool IsOffsetRequired(ORIENTATION orientation) const
检查是否需要偏移
BOOL ParsePosition34(const SStringW &pos3, const SStringW &pos4)
解析在pos中定义的后两个位置
HRESULT OnAttrOffset(const SStringW &strValue, BOOL bLoading)
处理偏移属性
void SetWrapContent(ORIENTATION orientation) OVERRIDE
设置包裹内容大小
BOOL IsMatchParent(ORIENTATION orientation) SCONST OVERRIDE
检查是否匹配父容器大小