Public Member Functions | Protected Attributes
InputActionReplayListener Class Reference

#include <inputactionreplaylistener.h>

Inheritance diagram for InputActionReplayListener:

Public Member Functions

 InputActionReplayListener ()
void action (const ActionEvent &event)
void setDialog (EditDialog *const dialog)
void openDialog (const std::string &caption, const std::string &text, const InputActionT action0)
- Public Member Functions inherited from ActionListener
virtual ~ActionListener ()

Protected Attributes

InputActionT mAction

Additional Inherited Members

- Protected Member Functions inherited from ActionListener
 ActionListener ()

Detailed Description

Definition at line 33 of file inputactionreplaylistener.h.

Constructor & Destructor Documentation

◆ InputActionReplayListener()

InputActionReplayListener::InputActionReplayListener ( )

Definition at line 34 of file inputactionreplaylistener.cpp.

Member Function Documentation

◆ action()

void InputActionReplayListener::action ( const ActionEvent actionEvent)

Called when an action is recieved from a widget. It is used to be able to recieve a notification that an action has occured.

actionEventThe event of the action.

Implements ActionListener.

Definition at line 56 of file inputactionreplaylistener.cpp.

57 {
58  if (event.getId() != "OK")
59  {
60  mDialog = nullptr;
62  return;
63  }
64  if (mDialog != nullptr)
65  {
67  mDialog->getMsg(),
68  nullptr);
69  mDialog = nullptr;
70  }
72 }
std::string getMsg() const
Definition: editdialog.h:65
bool executeChatCommand(const std::string &cmd, const std::string &args, ChatTab *const tab)
InputManager inputManager

References InputManager::executeChatCommand(), ActionEvent::getId(), EditDialog::getMsg(), inputManager, mAction, mDialog, and InputAction::NO_VALUE.

◆ openDialog()

void InputActionReplayListener::openDialog ( const std::string &  caption,
const std::string &  text,
const InputActionT  action0 

Definition at line 41 of file inputactionreplaylistener.cpp.

44 {
46  caption,
47  text,
48  "OK",
49  300,
50  nullptr,
51  Modal_true);
53  mAction = action0;
54 }
void addActionListener(ActionListener *const actionListener)
Definition: widget.cpp:252
#define CREATEWIDGETV(var, type,...)
Definition: createwidget.h:25
const bool Modal_true
Definition: modal.h:30

References Widget::addActionListener(), CREATEWIDGETV, mAction, mDialog, and Modal_true.

◆ setDialog()

void InputActionReplayListener::setDialog ( EditDialog *const  dialog)

Definition at line 42 of file inputactionreplaylistener.h.

43  { mDialog = dialog; }

References mDialog.

Field Documentation

◆ mAction

InputActionT InputActionReplayListener::mAction

Definition at line 51 of file inputactionreplaylistener.h.

Referenced by action(), and openDialog().

◆ mDialog

EditDialog* InputActionReplayListener::mDialog

Definition at line 50 of file inputactionreplaylistener.h.

Referenced by action(), openDialog(), and setDialog().

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