Skip to content

Class endstone::Form

template <typename T>

ClassList > endstone > Form

Represents a generic form. More...

  • #include <endstone/form/form.h>

Public Types

Type Name
typedef std::function< void(Player *)> OnCloseCallback

Public Functions

Type Name
Form () = default
OnCloseCallback getOnClose () const
Gets the on close callback of the form.
Message getTitle () const
Gets the title of the form.
T & setOnClose (OnCloseCallback on_close)
Sets the on close callback of the form.
T & setTitle (Message title)
Sets the title of the form.

Protected Attributes

Type Name
OnCloseCallback on_close_
Message title_

Detailed Description

The Form class provides a base abstraction for different types of forms. It supports three types of forms: Action, Message, and Modal. Each form has a title, which can be a string or a translatable object.

Public Types Documentation

typedef OnCloseCallback

using endstone::Form< T >::OnCloseCallback =  std::function<void(Player *)>;

Public Functions Documentation

function Form

explicit endstone::Form::Form () = default

function getOnClose

Gets the on close callback of the form.

inline OnCloseCallback endstone::Form::getOnClose () const

Returns:

The on close callback of the form.


function getTitle

Gets the title of the form.

inline Message endstone::Form::getTitle () const

Returns:

The title of the form.


function setOnClose

Sets the on close callback of the form.

inline T & endstone::Form::setOnClose (
    OnCloseCallback on_close
) 

Parameters:

  • on_close The callback to be set.

Returns:

A reference to the current form.


function setTitle

Sets the title of the form.

inline T & endstone::Form::setTitle (
    Message title
) 

Parameters:

  • title The title of the form to be set.

Returns:

A reference to the current form.


Protected Attributes Documentation

variable on_close_

OnCloseCallback endstone::Form< T >::on_close_;

variable title_

Message endstone::Form< T >::title_;


The documentation for this class was generated from the following file include/endstone/form/form.h