用于EagleEye3.0 规则集漏报和误报测试的示例项目,项目收集于github和gitee
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
3.5 KiB

5 months ago
#pragma once
#include "interface/slayout-i.h"
#include "SLinearLayoutParamStruct.h"
namespace SOUI
{
class SLinearLayoutParam : public SObjectImpl<TObjRefImpl<ILayoutParam>>
, protected SLinearLayoutParamStruct
{
SOUI_CLASS_NAME(SLinearLayoutParam,L"LinearLayoutParam")
friend class SLinearLayout;
public:
SLinearLayoutParam();
virtual bool IsMatchParent(ORIENTATION orientation) const;
virtual bool IsWrapContent(ORIENTATION orientation) const;
virtual bool IsSpecifiedSize(ORIENTATION orientation) const;
virtual SLayoutSize GetSpecifiedSize(ORIENTATION orientation) const;
virtual void Clear();
virtual void SetMatchParent(ORIENTATION orientation);
virtual void SetWrapContent(ORIENTATION orientation);
virtual void SetSpecifiedSize(ORIENTATION orientation, const SLayoutSize& layoutSize);
virtual void * GetRawData();
virtual ILayoutParam * Clone() const;
public:
SOUI_ATTRS_BEGIN()
ATTR_CUSTOM(L"width",OnAttrWidth)
ATTR_CUSTOM(L"height",OnAttrHeight)
ATTR_CUSTOM(L"size",OnAttrSize)
ATTR_FLOAT(L"weight",weight,FALSE)
ATTR_ENUM_BEGIN(L"layout_gravity",Gravity,FALSE)
ATTR_ENUM_VALUE(L"left",G_Left)
ATTR_ENUM_VALUE(L"top",G_Top)
ATTR_ENUM_VALUE(L"center",G_Center)
ATTR_ENUM_VALUE(L"right",G_Right)
ATTR_ENUM_VALUE(L"bottom",G_Bottom)
ATTR_ENUM_END(gravity)
ATTR_CUSTOM(L"extend",OnAttrExtend)
ATTR_LAYOUTSIZE(L"extend_left",extend_left,FALSE)
ATTR_LAYOUTSIZE(L"extend_top",extend_top,FALSE)
ATTR_LAYOUTSIZE(L"extend_right",extend_right,FALSE)
ATTR_LAYOUTSIZE(L"extend_bottom",extend_bottom,FALSE)
SOUI_ATTRS_BREAK()
protected:
HRESULT OnAttrSize(const SStringW & strValue,BOOL bLoading);
HRESULT OnAttrWidth(const SStringW & strValue,BOOL bLoading);
HRESULT OnAttrHeight(const SStringW & strValue,BOOL bLoading);
HRESULT OnAttrExtend(const SStringW & strValue,BOOL bLoading);
};
class SOUI_EXP SLinearLayout : public SObjectImpl<TObjRefImpl<ILayout>>
{
SOUI_CLASS_NAME_EX(SLinearLayout,L"linearLayout",Layout)
public:
SLinearLayout(void);
~SLinearLayout(void);
virtual void LayoutChildren(SWindow * pParent);
virtual ILayoutParam * CreateLayoutParam() const;
virtual CSize MeasureChildren(const SWindow * pParent,int nWidth,int nHeight) const;
virtual bool IsParamAcceptable(ILayoutParam *pLayoutParam) const;
SOUI_ATTRS_BEGIN()
ATTR_ENUM_BEGIN(L"orientation",ORIENTATION,FALSE)
ATTR_ENUM_VALUE(L"horizontal",Horz)
ATTR_ENUM_VALUE(L"vertical",Vert)
ATTR_ENUM_END(m_orientation)
ATTR_ENUM_BEGIN(L"gravity",Gravity,FALSE)
ATTR_ENUM_VALUE(L"left",G_Left)
ATTR_ENUM_VALUE(L"top",G_Top)
ATTR_ENUM_VALUE(L"center",G_Center)
ATTR_ENUM_VALUE(L"right",G_Right)
ATTR_ENUM_VALUE(L"bottom",G_Bottom)
ATTR_ENUM_END(m_gravity)
ATTR_LAYOUTSIZE(L"interval",m_interval,FALSE)
SOUI_ATTRS_BREAK()
protected:
ORIENTATION m_orientation;
Gravity m_gravity;
SLayoutSize m_interval;
};
class SVBox : public SLinearLayout
{
SOUI_CLASS_NAME(SVBox,L"vbox")
public:
SVBox(){m_orientation = Vert;}
};
class SHBox : public SLinearLayout
{
SOUI_CLASS_NAME(SHBox,L"hbox")
public:
SHBox(){m_orientation = Horz;}
};
}