xref: /haiku/headers/os/interface/LayoutUtils.h (revision 9d6d3fcf5fe8308cd020cecf89dede440346f8c4)
1 /*
2  * Copyright 2006, Haiku Inc.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef	_LAYOUT_UTILS_H
6 #define	_LAYOUT_UTILS_H
7 
8 #include <Alignment.h>
9 #include <Rect.h>
10 #include <Size.h>
11 
12 class BView;
13 
14 class BLayoutUtils {
15 public:
16 //	static	float				AddSizesFloat(float a, float b);
17 //	static	float				AddSizesFloat(float a, float b, float c);
18 	static	float				AddDistances(float a, float b);
19 	static	float				AddDistances(float a, float b, float c);
20 	static	int32				AddSizesInt32(int32 a, int32 b);
21 	static	int32				AddSizesInt32(int32 a, int32 b, int32 c);
22 //	static	float				SubtractSizesFloat(float a, float b);
23 	static	int32				SubtractSizesInt32(int32 a, int32 b);
24 	static	float				SubtractDistances(float a, float b);
25 
26 	static	BSize				ComposeSize(BSize size, BSize layoutSize);
27 	static	BAlignment			ComposeAlignment(BAlignment alignment,
28 									BAlignment layoutAlignment);
29 
30 	static	BRect				AlignInFrame(BRect frame, BSize maxSize,
31 									BAlignment alignment);
32 	static	void				AlignInFrame(BView* view, BRect frame);
33 };
34 
35 #endif	//	_LAYOUT_UTILS_H
36