Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

HBCI::InteractorCB Class Reference

Alternative implementation class for the Interactor interface. More...

#include <interactorcb.h>

Inheritance diagram for HBCI::InteractorCB:

Inheritance graph
[legend]
List of all members.

Public Methods

 InteractorCB (VoidFuncTyp destrCB, InputPinFuncTyp msgInputPinCB, InputUserFuncTyp msgInsertMediumOrAbortCB, InputUserFuncTyp msgInsertCorrectMediumOrAbortCB, LoggingFuncTyp msgStateResponseCB, BoolFuncTyp keepAliveCB, VoidUserFuncTyp msgStartInputPinViaKeypadCB, VoidUserFuncTyp msgFinishedInputPinViaKeypadCB, void *user_data)
 ~InteractorCB ()
bool msgInputPin (Pointer< User > user, string &pin, int minsize, bool newPin)
bool msgInsertMediumOrAbort (Pointer< User > user, MediumType t)
bool msgInsertCorrectMediumOrAbort (Pointer< User > user, MediumType t)
void msgStateResponse (const string &msg)
bool keepAlive ()
virtual void msgStartInputPinViaKeypad (Pointer< User > user)
virtual void msgFinishedInputPinViaKeypad (Pointer< User > user)

Detailed Description

Alternative implementation class for the Interactor interface.

This class defines methods for all occasions where the core OpenHBCI needs user interaction, as layouted through the Interactor interface.

This is an implementation which stores function pointers (callbacks) for each interaction method and calls them for each method defined in the base class. If there hasn't been set any of the correct callbacks, then the default implementation of the base class is called.

Author:
Christian Stimming <stimming@tuhh.de>


Constructor & Destructor Documentation

HBCI::InteractorCB::InteractorCB VoidFuncTyp    destrCB,
InputPinFuncTyp    msgInputPinCB,
InputUserFuncTyp    msgInsertMediumOrAbortCB,
InputUserFuncTyp    msgInsertCorrectMediumOrAbortCB,
LoggingFuncTyp    msgStateResponseCB,
BoolFuncTyp    keepAliveCB,
VoidUserFuncTyp    msgStartInputPinViaKeypadCB,
VoidUserFuncTyp    msgFinishedInputPinViaKeypadCB,
void *    user_data
 

Constructor.

Any of these function callbacks are allowed to be zero, in which case the default implementation of HBCI::Interactor is called.

user_data is a pointer to arbitrary data that is going to be passed on to each callback function.

HBCI::InteractorCB::~InteractorCB  
 

Destructor.

This will call the destrCB callbank function before actually deleting this object. Use the destrCB to e.g. delete the data pointed to by user_data.


Member Function Documentation

bool HBCI::InteractorCB::keepAlive   [virtual]
 

During actions which take a long time to perform (some seconds or minutes) this method is called by OpenHBCI every once in a while.

You can override this method to let your program do some GUI update stuff. Also, if this method returns "false", then the long term action will be aborted. Otherwise the action simply continues.

The default implementation of the InteractorCB returns the variable set by abort() which is accessible also by aborted(). Thus the InteractorCB offery you the convenience of only using abort() instead of deriving your own InteractorCB. If you overload this method, you probably should take the value of aborted() into account to comply to that default behaviour.

Author:
Martin Preuss<openhbci@aquamaniac.de>
Returns :
false if user wants the action to be aborted, false otherwise

Reimplemented from HBCI::Interactor.

virtual void HBCI::InteractorCB::msgFinishedInputPinViaKeypad Pointer< User   user [virtual]
 

This method is called directly after the secure pin verification (via the card readers keypad) is finished. A graphical applicatition most likely closes the notification window opened at msgStartInputPinViaKeypad(). (new since 0.9.5)

Author:
Martin Preuss<martin@libchipcard.de>
Parameters:
user  user for whom the pin is to be asked for. Please note that this pointer may be invalid.

Reimplemented from HBCI::Interactor.

bool HBCI::InteractorCB::msgInputPin Pointer< User   user,
string &    pin,
int    minsize,
bool    newPin
[virtual]
 

Ask the user for the pin of a security medium. This method is called by the default Authentifikator. The default implementation does nothing and returns false.

Returns :
true if ok, false if the user aborted
Parameters:
user  user for whom the pin is to be asked for. Please note that this pointer may be invalid !
pin  reference to a variable to receive the pin
minsize  minimum size of the pin.
newPin  if true then the user should be asked for a new pin. Most implementations will ask the user for the pin and then ask him to confirm it (thus making the user doubly enter the pin).

Reimplemented from HBCI::Interactor.

bool HBCI::InteractorCB::msgInsertCorrectMediumOrAbort Pointer< User   user,
MediumType    t
[virtual]
 

Tell the user that:

  • the currently inserted chip card is not the right one and
  • he/she should now insert the correct card
The default implementation does nothing and returns false.

Returns :
true if ok, false if user wants to abort.
Parameters:
user  user for whom the card is to be inserted. Please note that this pointer may be invalid !
t  The MediumType of the medium that should be inserted.

Reimplemented from HBCI::Interactor.

bool HBCI::InteractorCB::msgInsertMediumOrAbort Pointer< User   user,
MediumType    t
[virtual]
 

Tell the user to insert a chip card. The default implementation does nothing and returns false.

Parameters:
user  user for whom the card is to be inserted. Please note that this pointer may be invalid !
t  The MediumType of the medium that should be inserted.
Returns :
true if ok, false if user wants to abort.

Reimplemented from HBCI::Interactor.

virtual void HBCI::InteractorCB::msgStartInputPinViaKeypad Pointer< User   user [virtual]
 

This method is called directly before the user is supposed to enter the pin into the keypad of a card reader. This is used to inform the user that OpenHBCI started secure pin verification. A graphical application might want to open a window that tells the user about this. (new since 0.9.5)

Author:
Martin Preuss<martin@libchipcard.de>
Parameters:
user  user for whom the pin is to be asked for. Please note that this pointer may be invalid.

Reimplemented from HBCI::Interactor.

void HBCI::InteractorCB::msgStateResponse const string &    msg [virtual]
 

Prints a message that might be used for logging purpose. Does not require interaction. The default implementation does nothing and discards the message. This method should be overwritten by your application.

Parameters:
msg  the message to show

Reimplemented from HBCI::Interactor.


The documentation for this class was generated from the following file:
Generated on Mon Jun 23 13:41:11 2003 for openhbci by doxygen1.2.17