2 * Copyright 2006, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
8 #include <InterfaceDefs.h>
13 vertical_alignment vertical
;
16 inline BAlignment(const BAlignment
& other
);
17 inline BAlignment(alignment horizontal
,
18 vertical_alignment vertical
);
20 inline alignment
Horizontal() const;
21 inline vertical_alignment
Vertical() const;
23 float RelativeHorizontal() const;
24 float RelativeVertical() const;
26 inline void SetHorizontal(alignment horizontal
);
27 inline void SetVertical(vertical_alignment vertical
);
29 inline bool IsHorizontalSet() const;
30 inline bool IsVerticalSet() const;
32 inline bool operator==(const BAlignment
& other
) const;
33 inline bool operator!=(const BAlignment
& other
) const;
35 inline BAlignment
& operator=(const BAlignment
& other
);
41 BAlignment::BAlignment()
42 : horizontal(B_ALIGN_HORIZONTAL_UNSET
),
43 vertical(B_ALIGN_VERTICAL_UNSET
)
49 BAlignment::BAlignment(const BAlignment
& other
)
50 : horizontal(other
.horizontal
),
51 vertical(other
.vertical
)
57 BAlignment::BAlignment(alignment horizontal
, vertical_alignment vertical
)
58 : horizontal(horizontal
),
65 BAlignment::Horizontal() const
71 inline vertical_alignment
72 BAlignment::Vertical() const
79 BAlignment::SetHorizontal(alignment horizontal
)
81 this->horizontal
= horizontal
;
86 BAlignment::SetVertical(vertical_alignment vertical
)
88 this->vertical
= vertical
;
93 BAlignment::IsHorizontalSet() const
95 return (horizontal
!= B_ALIGN_HORIZONTAL_UNSET
);
100 BAlignment::IsVerticalSet() const
102 return (vertical
!= B_ALIGN_VERTICAL_UNSET
);
107 BAlignment::operator==(const BAlignment
& other
) const
109 return (horizontal
== other
.horizontal
&& vertical
== other
.vertical
);
114 BAlignment::operator!=(const BAlignment
& other
) const
116 return !(*this == other
);
121 BAlignment::operator=(const BAlignment
& other
)
123 horizontal
= other
.horizontal
;
124 vertical
= other
.vertical
;
128 #endif // _ALIGNMENT_H