The Battle for Wesnoth  1.19.0-dev
integer_selector.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2024
3  by Mark de Wever <koraq@xs4all.nl>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #pragma once
17 
18 namespace gui2
19 {
20 
21 /**
22  * Small abstract helper class.
23  *
24  * Parts of the engine inherit this class so we can have generic
25  * widgets to select an integer value.
26  */
28 {
29 public:
31  {
32  }
33 
34  /** Sets the selected value. */
35  virtual void set_value(int value) = 0;
36 
37  /** Gets the selected value. */
38  virtual int get_value() const = 0;
39 
40  /** Gets the minimum value. */
41  virtual int get_minimum_value() const = 0;
42 
43  /** Gets the maximum value. */
44  virtual int get_maximum_value() const = 0;
45 };
46 
47 } // namespace gui2
Small abstract helper class.
virtual int get_maximum_value() const =0
Gets the maximum value.
virtual int get_minimum_value() const =0
Gets the minimum value.
virtual int get_value() const =0
Gets the selected value.
virtual void set_value(int value)=0
Sets the selected value.
Generic file dialog.