The Battle for Wesnoth  1.17.0-dev
walker_widget.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2021
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 
19 
20 namespace gui2
21 {
22 
23 namespace iteration
24 {
25 
26 namespace walker
27 {
28 
29 /** A walker for a @ref gui2::styled_widget. */
30 class widget : public walker_base
31 {
32 public:
33  /**
34  * Constructor.
35  *
36  * @param widget The styled_widget which the walker is attached to.
37  */
38  explicit widget(gui2::widget& widget);
39 
40  /** Inherited from @ref gui2::iteration::walker_base. */
41  virtual state_t next(const level level);
42 
43  /** Inherited from @ref gui2::iteration::walker_base. */
44  virtual bool at_end(const level level) const;
45 
46  /** Inherited from @ref gui2::iteration::walker_base. */
47  virtual gui2::widget* get(const level level);
48 
49 private:
50  /** The styled_widget which the walker is attached to. */
52 };
53 
54 } // namespace walker
55 
56 } // namespace iteration
57 
58 } // namespace gui2
level
The level to walk at.
Definition: walker.hpp:35
widget(gui2::widget &widget)
Constructor.
Base class for all widgets.
Definition: widget.hpp:49
Generic file dialog.
Definition: field-fwd.hpp:23
state_t
The state of the walker.
Definition: walker.hpp:49
virtual bool at_end(const level level) const
Inherited from gui2::iteration::walker_base.
The walker abstract base class.
Definition: walker.hpp:27
A walker for a gui2::styled_widget.
virtual state_t next(const level level)
Inherited from gui2::iteration::walker_base.
gui2::widget * widget_
The styled_widget which the walker is attached to.