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

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2011-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_TABS_SETUPTABSCROLL_H
22
#define GUI_WIDGETS_TABS_SETUPTABSCROLL_H
23
24
#include "gui/widgets/tabs/setuptab.h"
25
26
#include "localconsts.h"
27
28
class SetupItem;
29
class ScrollArea;
30
class VertContainer;
31
32
class SetupTabScroll notfinal : public SetupTab
33
{
34
    public:
35
        explicit SetupTabScroll(const Widget2 *const widget);
36
37
        A_DELETE_COPY(SetupTabScroll)
38
39
        virtual ~SetupTabScroll();
40
41
        void addControl(SetupItem *const widget);
42
43
        void addControl(SetupItem *const widget, const std::string &event);
44
45
        VertContainer *getContainer() const noexcept2 A_WARN_UNUSED
46
960
        { return mContainer; }
47
48
        void apply() override;
49
50
        void cancel() override final;
51
52
        void externalUpdated() override;
53
54
        void externalUnloaded() override;
55
56
        void action(const ActionEvent &event A_UNUSED) override final
57
        { }
58
59
        int getPreferredFirstItemSize() const noexcept2 A_WARN_UNUSED
60
252
        { return mPreferredFirstItemSize; }
61
62
        void widgetResized(const Event &event) override final;
63
64
        void reread(const std::string &name);
65
66
        void clear() override final;
67
68
        const std::set<SetupItem*> &getAllItems() const noexcept2
69
        { return mAllItems; }
70
71
    protected:
72
        void removeItems();
73
74
        VertContainer *mContainer;
75
        ScrollArea *mScroll;
76
        std::map<std::string, SetupItem*> mItems;
77
        std::set<SetupItem*> mAllItems;
78
        int mPreferredFirstItemSize;
79
};
80
81
#endif  // GUI_WIDGETS_TABS_SETUPTABSCROLL_H