The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
walker_widget.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2017 by Mark de Wever <koraq@xs4all.nl>
3  Part of the Battle for Wesnoth Project http://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 
18 
19 namespace gui2
20 {
21 
22 namespace iteration
23 {
24 
25 namespace walker
26 {
27 
28 /** A walker for a @ref gui2::styled_widget. */
29 class widget : public walker_base
30 {
31 public:
32  /**
33  * Constructor.
34  *
35  * @param widget The styled_widget which the walker is attached to.
36  */
37  explicit widget(gui2::widget& widget);
38 
39  /** Inherited from @ref gui2::iteration::walker_base. */
40  virtual state_t next(const level level);
41 
42  /** Inherited from @ref gui2::iteration::walker_base. */
43  virtual bool at_end(const level level) const;
44 
45  /** Inherited from @ref gui2::iteration::walker_base. */
46  virtual gui2::widget* get(const level level);
47 
48 private:
49  /** The styled_widget which the walker is attached to. */
51 };
52 
53 } // namespace walker
54 
55 } // namespace iteration
56 
57 } // namespace gui2
level
The level to walk at.
Definition: walker.hpp:34
widget(gui2::widget &widget)
Constructor.
Base class for all widgets.
Definition: widget.hpp:48
Generic file dialog.
Definition: text.hpp:37
state_t
The state of the walker.
Definition: walker.hpp:48
The walker abstract base class.
Definition: walker.hpp:26
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.
virtual bool at_end(const level level) const
Inherited from gui2::iteration::walker_base.