LeviLamina
Loading...
Searching...
No Matches
ll::form::SimpleForm Class Reference
+ Inheritance diagram for ll::form::SimpleForm:

Public Types

using Callback = std::function<void(Player&, int, FormCancelReason)>
 
using ButtonCallback = std::function<void(Player&)>
 
using RawFormCallback = std::function<void(Player&, std::optional<std::string>, FormCancelReason)>
 

Public Member Functions

LLNDAPI SimpleForm (std::string const &title, std::string const &content={})
 
LLAPI SimpleFormsetTitle (std::string const &title)
 
LLAPI SimpleFormsetContent (std::string const &content)
 
LLAPI SimpleFormappendHeader (std::string const &text)
 
LLAPI SimpleFormappendLabel (std::string const &text)
 
LLAPI SimpleFormappendDivider ()
 
LLAPI SimpleFormappendButton (std::string const &text, std::string const &imageData, std::string const &imageType, ButtonCallback callback={})
 Append a button to the form.
 
LLAPI SimpleFormappendButton (std::string const &text, ButtonCallback callback={})
 Append a button to the form.
 
LLAPI SimpleFormsendTo (Player &player, Callback callback=Callback())
 Send the form to the player.
 
LLAPI SimpleFormsendUpdate (Player &player, Callback callback=Callback())
 

Static Public Member Functions

static LLAPI bool sendRawTo (Player &player, std::string const &formData, RawFormCallback callback={})
 
static LLAPI bool sendRawUpdate (Player &player, std::string const &formData, RawFormCallback callback={})
 

Member Function Documentation

◆ appendButton() [1/2]

LLAPI SimpleForm & ll::form::SimpleForm::appendButton ( std::string const & text,
std::string const & imageData,
std::string const & imageType,
ButtonCallback callback = {} )

Append a button to the form.

Parameters
textThe text of the button
imageDataThe image data of the button
imageTypeThe type of the image (url or path)
callbackThe callback of the button
Returns
SimpleForm& *this
Note
If the callback parameter of sendTo() is set, the callback of the button will be ignored

◆ appendButton() [2/2]

LLAPI SimpleForm & ll::form::SimpleForm::appendButton ( std::string const & text,
ButtonCallback callback = {} )

Append a button to the form.

Parameters
textThe text of the button
callbackThe callback of the button
Returns
SimpleForm& *this
Note
If the callback parameter of sendTo() is set, the callback of the button will be ignored

◆ sendTo()

LLAPI SimpleForm & ll::form::SimpleForm::sendTo ( Player & player,
Callback callback = Callback() )

Send the form to the player.

Parameters
playerThe player to receive the form
callbackThe callback of the form(if set, the callback of the button will be ignored)
Returns
SimpleForm& *this
Note
If callback is set, the callbacks of each buttons will be ignored

The documentation for this class was generated from the following file: