Skip to content

Class endstone::MessageForm

ClassList > endstone > MessageForm

Represents a form with two buttons.

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

Inherits the following classes: endstone::Form

Public Types

Type Name
typedef std::function< void(Player *, int)> OnSubmitCallback

Public Types inherited from endstone::Form

See endstone::Form

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

Public Functions

Type Name
Message getButton1 () const
Get the text of button1.
Message getButton2 () const
Get the text of button2.
Message getContent () const
Get the content of the form.
OnSubmitCallback getOnSubmit () const
Gets the on submit callback of the form.
MessageForm & setButton1 (Message text)
Set the text of button1.
MessageForm & setButton2 (Message text)
Set the text of button2.
MessageForm & setContent (Message text)
Set the content of the form.
MessageForm & setOnSubmit (OnSubmitCallback on_submit)
Sets the on submit callback of the form.

Public Functions inherited from endstone::Form

See endstone::Form

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 inherited from endstone::Form

See endstone::Form

Type Name
OnCloseCallback on_close_
Message title_

Public Types Documentation

typedef OnSubmitCallback

using endstone::MessageForm::OnSubmitCallback =  std::function<void(Player *, int)>;

Public Functions Documentation

function getButton1

Get the text of button1.

inline Message endstone::MessageForm::getButton1 () const

Returns:

The text of button1.


function getButton2

Get the text of button2.

inline Message endstone::MessageForm::getButton2 () const

Returns:

The text of button2.


function getContent

Get the content of the form.

inline Message endstone::MessageForm::getContent () const

Returns:

The content of the form.


function getOnSubmit

Gets the on submit callback of the form.

inline OnSubmitCallback endstone::MessageForm::getOnSubmit () const

Returns:

The on submit callback of the form.


function setButton1

Set the text of button1.

inline MessageForm & endstone::MessageForm::setButton1 (
    Message text
) 

Parameters:

  • text The text to set as the button1 text.

Returns:

A reference to the current form.


function setButton2

Set the text of button2.

inline MessageForm & endstone::MessageForm::setButton2 (
    Message text
) 

Parameters:

  • text The text to set as the button2 text.

Returns:

A reference to the current form.


function setContent

Set the content of the form.

inline MessageForm & endstone::MessageForm::setContent (
    Message text
) 

Parameters:

  • text The text to set as the content.

Returns:

A reference to the current form.


function setOnSubmit

Sets the on submit callback of the form.

inline MessageForm & endstone::MessageForm::setOnSubmit (
    OnSubmitCallback on_submit
) 

Parameters:

  • on_submit The callback to be set.

Returns:

A reference to the current form.



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