ManaPlus
Public Member Functions
PincodeListener Class Reference

#include <pincodelistener.h>

Inheritance diagram for PincodeListener:
ActionListener

Public Member Functions

 PincodeListener ()
 
void action (const ActionEvent &event)
 
- Public Member Functions inherited from ActionListener
virtual ~ActionListener ()
 

Additional Inherited Members

- Protected Member Functions inherited from ActionListener
 ActionListener ()
 

Detailed Description

Definition at line 29 of file pincodelistener.h.

Constructor & Destructor Documentation

◆ PincodeListener()

PincodeListener::PincodeListener ( )
inline

Definition at line 32 of file pincodelistener.h.

32  :
34  { }

Member Function Documentation

◆ action()

void PincodeListener::action ( const ActionEvent actionEvent)
virtual

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

Parameters
actionEventThe event of the action.

Implements ActionListener.

Definition at line 33 of file pincodelistener.cpp.

34 {
35  if (event.getId() == "ok")
36  {
37  const PincodeDialog *const dialog = dynamic_cast<PincodeDialog*>(
38  event.getSource());
39  if (dialog != nullptr)
40  {
41  const std::string &pincode = dialog->getMsg();
42  pincodeManager.sendPincode(pincode);
43  }
44  }
45  else
46  {
48  }
49 }
void setState(const StateT state)
Definition: client.h:66
const std::string & getMsg() const
void sendPincode(const std::string &pincode)
Client * client
Definition: client.cpp:118
@ SWITCH_LOGIN
Definition: state.h:63
PincodeManager pincodeManager

References client, ActionEvent::getId(), PincodeDialog::getMsg(), pincodeManager, PincodeManager::sendPincode(), Client::setState(), and State::SWITCH_LOGIN.


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