GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/gui/widgets/flowcontainer.h Lines: 0 2 0.0 %
Date: 2017-11-29 Branches: 0 0 0.0 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2009-2010  The Mana Developers
4
 *  Copyright (C) 2011-2017  The ManaPlus Developers
5
 *
6
 *  This file is part of The ManaPlus Client.
7
 *
8
 *  This program is free software; you can redistribute it and/or modify
9
 *  it under the terms of the GNU General Public License as published by
10
 *  the Free Software Foundation; either version 2 of the License, or
11
 *  any later version.
12
 *
13
 *  This program is distributed in the hope that it will be useful,
14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 *  GNU General Public License for more details.
17
 *
18
 *  You should have received a copy of the GNU General Public License
19
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
 */
21
22
#ifndef GUI_WIDGETS_FLOWCONTAINER_H
23
#define GUI_WIDGETS_FLOWCONTAINER_H
24
25
#include "gui/widgets/container.h"
26
27
#include "listeners/widgetlistener.h"
28
29
#include "localconsts.h"
30
31
/**
32
 * A container that arranges its contents like words on a page.
33
 *
34
 * \ingroup GUI
35
 */
36
class FlowContainer final : public Container,
37
                            public WidgetListener
38
{
39
    public:
40
        /**
41
         * Constructor. Initializes the shortcut container.
42
         */
43
        FlowContainer(const Widget2 *const widget,
44
                      const int boxWidth,
45
                      const int boxHeight);
46
47
        A_DELETE_COPY(FlowContainer)
48
49
        /**
50
         * Destructor.
51
         */
52
        ~FlowContainer()
53
        { }
54
55
        /**
56
         * Invoked when a widget changes its size. This is used to determine
57
         * the new height of the container.
58
         */
59
        void widgetResized(const Event &event) override final;
60
61
        int getBoxWidth() const noexcept2 A_WARN_UNUSED
62
        { return mBoxWidth; }
63
64
        int getBoxHeight() const noexcept2 A_WARN_UNUSED
65
        { return mBoxHeight; }
66
67
        void add(Widget *const widget) override final;
68
69
    private:
70
        int mBoxWidth;
71
        int mBoxHeight;
72
        int mGridWidth, mGridHeight;
73
};
74
75
#endif  // GUI_WIDGETS_FLOWCONTAINER_H