The Battle for Wesnoth
1.19.4+dev
gui
auxiliary
iterator
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
18
#include "
gui/auxiliary/iterator/walker.hpp
"
19
20
namespace
gui2::iteration::walker
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. */
45
gui2::widget
*
widget_
;
46
};
47
48
}
// namespace gui2::iteration::walker
gui2::iteration::walker::widget
A walker for a gui2::styled_widget.
Definition:
walker_widget.hpp:25
gui2::iteration::walker::widget::widget
widget(gui2::widget &widget)
Constructor.
Definition:
walker_widget.cpp:27
gui2::iteration::walker::widget::get
virtual gui2::widget * get(const level level)
Inherited from gui2::iteration::walker_base.
Definition:
walker_widget.cpp:67
gui2::iteration::walker::widget::widget_
gui2::widget * widget_
The styled_widget which the walker is attached to.
Definition:
walker_widget.hpp:45
gui2::iteration::walker::widget::at_end
virtual bool at_end(const level level) const
Inherited from gui2::iteration::walker_base.
Definition:
walker_widget.cpp:53
gui2::iteration::walker::widget::next
virtual state_t next(const level level)
Inherited from gui2::iteration::walker_base.
Definition:
walker_widget.cpp:31
gui2::iteration::walker_base
The walker abstract base class.
Definition:
walker.hpp:28
gui2::iteration::walker_base::level
level
The level to walk at.
Definition:
walker.hpp:35
gui2::iteration::walker_base::state_t
state_t
The state of the walker.
Definition:
walker.hpp:49
gui2::widget
Base class for all widgets.
Definition:
widget.hpp:55
gui2::iteration::walker
Definition:
walker_widget.cpp:25
walker.hpp
Generated by
1.9.1