vfs: check userland buffers before reading them.
[haiku.git] / src / kits / interface / layouter / Layouter.h
blobb146c566da2f05118333f3941ce8274439e845dd
1 /*
2 * Copyright 2006, Haiku Inc.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef LAYOUTER_H
6 #define LAYOUTER_H
8 #include <SupportDefs.h>
10 namespace BPrivate {
11 namespace Layout {
13 class LayoutInfo {
14 public:
15 LayoutInfo();
16 virtual ~LayoutInfo();
18 virtual float ElementLocation(int32 element) = 0;
19 virtual float ElementSize(int32 element) = 0;
21 virtual float ElementRangeSize(int32 position, int32 length);
25 class Layouter {
26 public:
27 Layouter();
28 virtual ~Layouter();
30 virtual void AddConstraints(int32 element, int32 length,
31 float min, float max, float preferred) = 0;
32 virtual void SetWeight(int32 element, float weight) = 0;
34 virtual float MinSize() = 0;
35 virtual float MaxSize() = 0;
36 virtual float PreferredSize() = 0;
38 virtual LayoutInfo* CreateLayoutInfo() = 0;
40 virtual void Layout(LayoutInfo* layoutInfo, float size) = 0;
42 virtual Layouter* CloneLayouter() = 0;
46 } // namespace Layout
47 } // namespace BPrivate
49 using BPrivate::Layout::LayoutInfo;
50 using BPrivate::Layout::Layouter;
52 #endif // LAYOUTER_H