-
Notifications
You must be signed in to change notification settings - Fork 388
Expand file tree
/
Copy pathFlexLayoutImpl.h
More file actions
82 lines (62 loc) · 2.26 KB
/
FlexLayoutImpl.h
File metadata and controls
82 lines (62 loc) · 2.26 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// 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();
int minimumWidth() const override;
int minimumHeight() const override;
int maximumWidth() const override;
int maximumHeight() const override;
void itemAdded(WLayoutItem *) override;
void itemRemoved(WLayoutItem *) override;
void updateDom(DomElement& parent) override;
DomElement *createDomElement(DomElement *parent, bool fitWidth,
bool fitHeight, WApplication *app) override;
bool itemResized(WLayoutItem *item) override;
bool parentResized() override;
void setObjectName(const std::string& name) override;
private:
static const int BIT_OBJECT_NAME_CHANGED = 0;
std::bitset<1> flags_;
Impl::Grid& grid_;
std::vector<WLayoutItem *> addedItems_;
std::vector<WLayoutItem *> resizedItems_;
std::vector<std::string> removedItems_;
std::vector<WLayoutItem *> childLayouts_;
std::string elId_;
bool canAdjustLayout_;
int minimumHeightForRow(int row) const;
int minimumWidthForColumn(int column) const;
int maximumHeightForRow(int row) const;
int maximumWidthForColumn(int column) const;
DomElement *createElement(Orientation orientation, int index,
int totalStretch, WApplication *app);
DomElement *wrap(DomElement *el, const std::string& flow);
Orientation getOrientation() const;
LayoutDirection getDirection() const;
std::string styleDisplay() const;
std::string styleFlex() const;
std::string otherStyleFlex() const;
int count(Orientation orientation) const;
int indexOf(WLayoutItem *item, Orientation orientation);
int getTotalStretch(Orientation orientation);
static StdLayoutImpl *getStdLayoutImpl(WLayoutItem *item);
Impl::Grid::Item& item(Orientation orientation, int i);
Impl::Grid::Section& section(Orientation orientation, int i);
};
}
#endif // FLEX_LAYOUT_IMPL_H_