ManaPlus
setuptabscroll.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2011-2019 The ManaPlus Developers
4  * Copyright (C) 2019-2021 Andrei Karas
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_TABS_SETUPTABSCROLL_H
23 #define GUI_WIDGETS_TABS_SETUPTABSCROLL_H
24 
26 
27 #include "localconsts.h"
28 
29 class SetupItem;
30 class ScrollArea;
31 class VertContainer;
32 
34 {
35  public:
36  explicit SetupTabScroll(const Widget2 *const widget);
37 
39 
40  ~SetupTabScroll() override;
41 
42  void addControl(SetupItem *const widget);
43 
44  void addControl(SetupItem *const widget, const std::string &event);
45 
47  { return mContainer; }
48 
49  void apply() override;
50 
51  void cancel() override final;
52 
54 
56 
58  { }
59 
61  { return mPreferredFirstItemSize; }
62 
63  void widgetResized(const Event &event) override final;
64 
65  void reread(const std::string &name);
66 
67  void clear() override final;
68 
69  const std::set<SetupItem*> &getAllItems() const noexcept2
70  { return mAllItems; }
71 
72  protected:
73  void removeItems();
74 
77  std::map<std::string, SetupItem*> mItems;
78  std::set<SetupItem*> mAllItems;
80 };
81 
82 #endif // GUI_WIDGETS_TABS_SETUPTABSCROLL_H
Definition: event.h:79
void widgetResized(const Event &event)
void action(const ActionEvent &event)
int mPreferredFirstItemSize
int getPreferredFirstItemSize() const
std::map< std::string, SetupItem * > mItems
void addControl(SetupItem *const widget)
void reread(const std::string &name)
std::set< SetupItem * > mAllItems
SetupTabScroll(const Widget2 *const widget)
VertContainer * getContainer() const
VertContainer * mContainer
ScrollArea * mScroll
const std::set< SetupItem * > & getAllItems() const
#define override
Definition: localconsts.h:47
#define A_WARN_UNUSED
Definition: localconsts.h:161
#define notfinal
Definition: localconsts.h:261
#define noexcept2
Definition: localconsts.h:50
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53
#define A_UNUSED
Definition: localconsts.h:160