soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
slayout-i.h
1/*
2SOUI窗口布局接口
3*/
4#ifndef __SLAYOUT_I__H__
5#define __SLAYOUT_I__H__
6
8
9SNSBEGIN
10
11typedef struct IWindow IWindow;
12
13typedef enum ORIENTATION
14{
15 Horz,
16 Vert,
17 Any,
18 Both,
19} ORIENTATION;
20
21enum
22{
23 SIZE_UNDEF = -3,
24 SIZE_WRAP_CONTENT = -1,
25 SIZE_MATCH_PARENT = -2,
26 SIZE_SPEC = 0,
27};
28
29#undef INTERFACE
30#define INTERFACE ILayoutParam
31DECLARE_INTERFACE_(ILayoutParam, IObject)
32{
33 DEF_OBJ_BASE(ILayoutParam, LayoutParam)
34#include <interface/SobjectApi.h>
35
36 //----------------------------------------------------------
37
38 /**
39 * @brief 清空数据
40 * @return
41 */
42 STDMETHOD_(void, Clear)(THIS) PURE;
43
44 /**
45 * @brief 布局充满父窗口标志
46 * @param orientation ORIENTATION--布局方向
47 * @return TRUE--布局充满父窗口
48 */
49 STDMETHOD_(BOOL, IsMatchParent)(CTHIS_ ORIENTATION orientation) SCONST PURE;
50
51 /**
52 * @brief 布局适应窗口内容标志
53 * @param orientation ORIENTATION--布局方向
54 * @return TRUE--适应窗口内容标志
55 */
56 STDMETHOD_(BOOL, IsWrapContent)(CTHIS_ ORIENTATION orientation) SCONST PURE;
57
58 /**
59 * @brief 布局指定大小标志
60 * @param orientation ORIENTATION--布局方向
61 * @return TRUE--指定大小
62 */
63 STDMETHOD_(BOOL, IsSpecifiedSize)(CTHIS_ ORIENTATION orientation) SCONST PURE;
64
65 /**
66 * @brief 获取指定的布局大小
67 * @param orientation ORIENTATION--布局方向
68 * @return SLayoutSize--布局大小
69 */
70 STDMETHOD_(SLayoutSize, GetSpecifiedSize)(CTHIS_ ORIENTATION orientation) SCONST PURE;
71
72 /**
73 * @brief 设定布局适应父窗口大小
74 * @param orientation ORIENTATION--布局方向
75 * @return
76 */
77 STDMETHOD_(void, SetMatchParent)(THIS_ ORIENTATION orientation) PURE;
78
79 /**
80 * @brief 设定布局适应内容
81 * @param orientation ORIENTATION--布局方向
82 * @return
83 */
84 STDMETHOD_(void, SetWrapContent)(THIS_ ORIENTATION orientation) PURE;
85
86 /**
87 * @brief 设定布局大小
88 * @param orientation ORIENTATION--布局方向
89 * @param layoutSize SLayoutSize--布局大小
90 * @return
91 */
92 STDMETHOD_(void, SetSpecifiedSize)
93 (THIS_ ORIENTATION orientation, const SLayoutSize &layoutSize) PURE;
94
95 /**
96 * @brief 获取布局结构体数据
97 * @return void*布局结构体
98 */
99 STDMETHOD_(void *, GetRawData)(THIS) PURE;
100
101 /**
102 * @brief Clone布局参数
103 * @return ILayoutParam *--布局参数对象
104 */
105 STDMETHOD_(ILayoutParam *, Clone)(CTHIS) SCONST PURE;
106};
107
108#undef INTERFACE
109#define INTERFACE ILayout
110DECLARE_INTERFACE_(ILayout, IObject)
111{
112 DEF_OBJ_BASE(ILayout, Layout)
113#include <interface/SobjectApi.h>
114 //------------------------------------------------------------------------
115
116 /**
117 * @brief 判断当前布局类型和布局参数是否匹配
118 * @param pLayoutParam const ILayoutParam *--布局参数
119 * @return TRUE--匹配
120 */
121 STDMETHOD_(BOOL, IsParamAcceptable)(CTHIS_ const ILayoutParam *pLayoutParam) SCONST PURE;
122
123 /**
124 * @brief 布局指定控件的子窗口
125 * @param pParent IWindow *--布局控件
126 * @return
127 */
128 STDMETHOD_(void, LayoutChildren)(THIS_ IWindow * pParent) PURE;
129
130 /**
131 * @brief 创建和当前布局匹配的布局参数对象
132 * @return ILayoutParam *--布局参数对象
133 */
134 STDMETHOD_(ILayoutParam *, CreateLayoutParam)(CTHIS) SCONST PURE;
135
136 /**
137 * @brief 计算窗口大小
138 * @param pParent const IWindow*--目标窗口
139 * @param nWidth int--父窗口宽度
140 * @param nHeight int--父窗口高度
141 * @return SIZE--目标窗口大小
142 */
143 STDMETHOD_(SIZE, MeasureChildren)
144 (CTHIS_ const IWindow *pParent, int nWidth, int nHeight) SCONST PURE;
145};
146
147SNSEND
148#endif // __SLAYOUT_I__H__
布局大小类
Definition SLayoutSize.h:10