-
Notifications
You must be signed in to change notification settings - Fork 388
Expand file tree
/
Copy pathFlexLayoutImpl.h
More file actions
68 lines (51 loc) · 1.78 KB
/
FlexLayoutImpl.h
File metadata and controls
68 lines (51 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2016 Emweb bv, Herent, Belgium.
*
* See the LICENSE file for terms of use.
*/
#ifndef FLEX_LAYOUT_IMPL2_H_
#define FLEX_LAYOUT_IMPL2_H_
#include <Wt/WGridLayout.h>
#include <Wt/WBoxLayout.h>
#include "StdLayoutImpl.h"
namespace Wt {
class WApplication;
class WLayout;
class FlexLayoutImpl : public StdLayoutImpl
{
public:
FlexLayoutImpl(WLayout *layout, Impl::Grid& grid);
virtual ~FlexLayoutImpl();
virtual int minimumWidth() const override;
virtual int minimumHeight() const override;
virtual void itemAdded(WLayoutItem *) override;
virtual void itemRemoved(WLayoutItem *) override;
virtual void updateDom(DomElement& parent) override;
virtual void update() override;
virtual DomElement *createDomElement(DomElement *parent,
bool fitWidth, bool fitHeight,
WApplication *app) override;
virtual bool itemResized(WLayoutItem *item) override;
virtual bool parentResized() override;
private:
Impl::Grid& grid_;
std::vector<WLayoutItem *> addedItems_;
std::vector<std::string> removedItems_;
std::string elId_;
int minimumHeightForRow(int row) const;
int minimumWidthForColumn(int column) const;
DomElement *createElement(Orientation orientation, unsigned index,
int totalStretch, WApplication *app);
Orientation getOrientation() const;
LayoutDirection getDirection() const;
std::string styleDisplay() const;
std::string styleFlex() const;
int count(Orientation orientation) const;
int indexOf(WLayoutItem *item, Orientation orientation);
int getTotalStretch(Orientation orientation);
Impl::Grid::Item& item(Orientation orientation, int i);
Impl::Grid::Section& section(Orientation orientation, int i);
};
}
#endif // FLEX_LAYOUT_IMPL_H_