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