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

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2012-2017  The ManaPlus Developers
4
 *
5
 *  This file is part of The ManaPlus Client.
6
 *
7
 *  This program is free software; you can redistribute it and/or modify
8
 *  it under the terms of the GNU General Public License as published by
9
 *  the Free Software Foundation; either version 2 of the License, or
10
 *  any later version.
11
 *
12
 *  This program is distributed in the hope that it will be useful,
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 *  GNU General Public License for more details.
16
 *
17
 *  You should have received a copy of the GNU General Public License
18
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 */
20
21
#ifndef GUI_WIDGETS_WIDGETGROUP_H
22
#define GUI_WIDGETS_WIDGETGROUP_H
23
24
#include "gui/widgets/container.h"
25
26
#include "listeners/actionlistener.h"
27
#include "listeners/widgetlistener.h"
28
29
#include "localconsts.h"
30
31
40
class WidgetGroup notfinal : public Container,
32
                             public WidgetListener,
33
                             public ActionListener
34
{
35
    public:
36
        A_DELETE_COPY(WidgetGroup)
37
38
        virtual void addButton(const std::string &restrict text,
39
                               const std::string &restrict tag,
40
                               const bool pressed);
41
42
        void action(const ActionEvent &event) override;
43
44
        virtual void addWidget(Widget *const widget,
45
                               const int spacing);
46
47
        void clear() override final;
48
49
        void widgetResized(const Event &event) override final A_CONST;
50
51
        virtual Widget *createWidget(const std::string &name,
52
                                     const bool pressed)
53
                                     const A_WARN_UNUSED = 0;
54
55
    protected:
56
        WidgetGroup(const Widget2 *const widget,
57
                    const std::string &group,
58
                    const int height,
59
                    const int spacing);
60
61
        int mSpacing;
62
        int mCount;
63
        std::string mGroup;
64
65
    private:
66
        int mLastX;
67
};
68
69
#endif  // GUI_WIDGETS_WIDGETGROUP_H