haiku/headers/os/interface/GroupLayoutBuilder.h
Stephan Aßmus 89208c77f1 Finished unifying the Interface Kit headers:
* Fixed copyrights (puncuation and capitalization, removed authors from
  headers)
* Updated indentation style
* Unified pointer/reference style
* Re-ordered some methods for better grouping where it could be done
  (abd adopted source accordingly)
* Small coding style fixes here and there

No functional change intended.

+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32745 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-27 11:12:41 +00:00

53 lines
1.4 KiB
C++

/*
* Copyright 2006, Haiku, Inc. All rights reserved.
* 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(
enum orientation orientation = B_HORIZONTAL,
float spacing = 0.0f);
BGroupLayoutBuilder(BGroupLayout* layout);
BGroupLayoutBuilder(BGroupView* view);
BGroupLayout* RootLayout() const;
BGroupLayout* TopLayout() const;
BGroupLayoutBuilder& GetTopLayout(BGroupLayout** _layout);
BGroupLayoutBuilder& GetTopView(BView** _view);
BGroupLayoutBuilder& Add(BView* view);
BGroupLayoutBuilder& Add(BView* view, float weight);
BGroupLayoutBuilder& Add(BLayoutItem* item);
BGroupLayoutBuilder& Add(BLayoutItem* item, float weight);
BGroupLayoutBuilder& AddGroup(enum orientation orientation,
float spacing = 0.0f, float weight = 1.0f);
BGroupLayoutBuilder& End();
BGroupLayoutBuilder& AddGlue(float weight = 1.0f);
BGroupLayoutBuilder& AddStrut(float size);
BGroupLayoutBuilder& SetInsets(float left, float top, float right,
float bottom);
operator BGroupLayout*();
operator BView*();
private:
bool _PushLayout(BGroupLayout* layout);
void _PopLayout();
private:
BGroupLayout* fRootLayout;
BList fLayoutStack;
};
#endif // _GROUP_LAYOUT_BUILDER_H