-
Notifications
You must be signed in to change notification settings - Fork 388
Expand file tree
/
Copy pathStdGridLayoutImpl2.h
More file actions
79 lines (60 loc) · 2.2 KB
/
StdGridLayoutImpl2.h
File metadata and controls
79 lines (60 loc) · 2.2 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
// This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2008 Emweb bv, Herent, Belgium.
*
* See the LICENSE file for terms of use.
*/
#ifndef STD_GRID_LAYOUT_IMPL2_H_
#define STD_GRID_LAYOUT_IMPL2_H_
#include <Wt/WGridLayout.h>
#include "StdLayoutImpl.h"
namespace Wt {
class WApplication;
class WLayout;
class WStringStream;
class StdGridLayoutImpl2 : public StdLayoutImpl
{
public:
StdGridLayoutImpl2(WLayout *layout, Impl::Grid& grid);
virtual ~StdGridLayoutImpl2();
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;
void update() override;
DomElement *createDomElement(DomElement *parent,
bool fitWidth, bool fitHeight,
WApplication *app) override;
// Does not really belong here, but who cares ?
static const char* childrenResizeJS();
bool itemResized(WLayoutItem *item) override;
bool parentResized() override;
void setObjectName(const std::string& name) override;
private:
Impl::Grid& grid_;
static const int BIT_NEED_ADJUST = 0;
static const int BIT_NEED_REMEASURE = 1;
static const int BIT_NEED_CONFIG_UPDATE = 2;
static const int BIT_OBJECT_NAME_CHANGED = 3;
std::bitset<4> flags_;
std::vector<WLayoutItem *> addedItems_;
std::vector<std::string> removedItems_;
int nextRowWithItem(int row, int c) const;
int nextColumnWithItem(int row, int col) const;
bool hasItem(int row, int col) const;
int minimumHeightForRow(int row) const;
int minimumWidthForColumn(int column) const;
int maximumHeightForRow(int row) const;
int maximumWidthForColumn(int column) const;
static int pixelSize(const WLength& size);
void streamConfig(WStringStream& js,
const std::vector<Impl::Grid::Section>& sections,
bool rows, WApplication *app);
void streamConfig(WStringStream& js, WApplication *app);
DomElement *createElement(WLayoutItem *item, WApplication *app);
};
}
#endif // STD_GRID_LAYOUT_IMPL2_H_