38 lines
1.2 KiB
C++
38 lines
1.2 KiB
C++
#ifndef BWIDGETS_CAPTION_HPP
|
|
#define BWIDGETS_CAPTION_HPP
|
|
|
|
#include <basic_widgets/w/base/widget.hpp>
|
|
#include <basic_widgets/w/feat/font_handler.hpp>
|
|
#include <basic_widgets/w/feat/texture_handler.hpp>
|
|
|
|
struct SDL_Surface;
|
|
|
|
namespace bwidgets
|
|
{
|
|
class Caption : public virtual Widget,
|
|
public virtual FontHandler,
|
|
public virtual TextureHandler
|
|
{
|
|
public:
|
|
enum struct Alignment
|
|
{
|
|
CENTER,
|
|
LEFT,
|
|
RIGHT
|
|
};
|
|
|
|
// Text horizontal alignment on the caption viewport.
|
|
[[nodiscard]] virtual auto alignment() const -> Alignment = 0;
|
|
virtual void alignment(Alignment) = 0;
|
|
[[nodiscard]] virtual auto render_mode() const -> Font::RenderMode = 0;
|
|
// Set caption text rendering mode.
|
|
virtual void render_mode(Font::RenderMode) = 0;
|
|
// Get caption text.
|
|
[[nodiscard]] virtual auto text() const noexcept -> std::string_view = 0;
|
|
// Set caption text.
|
|
virtual void text(std::string) = 0;
|
|
};
|
|
}
|
|
|
|
#endif
|