2006-08-26 20:21:15 +04:00
|
|
|
/*
|
2010-08-17 22:43:41 +04:00
|
|
|
* Copyright 2006-2010, Haiku, Inc. All rights reserved.
|
2006-08-26 20:21:15 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _GROUP_LAYOUT_BUILDER_H
|
|
|
|
#define _GROUP_LAYOUT_BUILDER_H
|
|
|
|
|
|
|
|
#include <GroupLayout.h>
|
|
|
|
#include <GroupView.h>
|
|
|
|
#include <List.h>
|
|
|
|
|
|
|
|
class BGroupLayoutBuilder {
|
|
|
|
public:
|
|
|
|
BGroupLayoutBuilder(
|
2013-07-09 02:27:55 +04:00
|
|
|
orientation orientation = B_HORIZONTAL,
|
2010-09-03 02:58:24 +04:00
|
|
|
float spacing = B_USE_DEFAULT_SPACING);
|
2006-08-26 20:21:15 +04:00
|
|
|
BGroupLayoutBuilder(BGroupLayout* layout);
|
|
|
|
BGroupLayoutBuilder(BGroupView* view);
|
|
|
|
|
|
|
|
BGroupLayout* RootLayout() const;
|
|
|
|
BGroupLayout* TopLayout() const;
|
|
|
|
BGroupLayoutBuilder& GetTopLayout(BGroupLayout** _layout);
|
2010-08-12 20:56:46 +04:00
|
|
|
BView* TopView() const;
|
2006-08-26 20:21:15 +04:00
|
|
|
BGroupLayoutBuilder& GetTopView(BView** _view);
|
|
|
|
|
|
|
|
BGroupLayoutBuilder& Add(BView* view);
|
|
|
|
BGroupLayoutBuilder& Add(BView* view, float weight);
|
|
|
|
BGroupLayoutBuilder& Add(BLayoutItem* item);
|
|
|
|
BGroupLayoutBuilder& Add(BLayoutItem* item, float weight);
|
|
|
|
|
2013-07-09 02:27:55 +04:00
|
|
|
BGroupLayoutBuilder& AddGroup(orientation orientation,
|
2010-09-03 02:58:24 +04:00
|
|
|
float spacing = B_USE_DEFAULT_SPACING,
|
|
|
|
float weight = 1.0f);
|
2006-08-26 20:21:15 +04:00
|
|
|
BGroupLayoutBuilder& End();
|
|
|
|
|
|
|
|
BGroupLayoutBuilder& AddGlue(float weight = 1.0f);
|
|
|
|
BGroupLayoutBuilder& AddStrut(float size);
|
|
|
|
|
2007-01-31 23:30:20 +03:00
|
|
|
BGroupLayoutBuilder& SetInsets(float left, float top, float right,
|
|
|
|
float bottom);
|
|
|
|
|
2006-08-26 20:21:15 +04:00
|
|
|
operator BGroupLayout*();
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool _PushLayout(BGroupLayout* layout);
|
|
|
|
void _PopLayout();
|
|
|
|
|
|
|
|
private:
|
|
|
|
BGroupLayout* fRootLayout;
|
|
|
|
BList fLayoutStack;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _GROUP_LAYOUT_BUILDER_H
|