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