Virtual Functions
[API for Applications]


Prototypes For Virtual Security Functions

enum  AB_BANKING_PINSTATUS { AB_Banking_PinStatusBad = -1, AB_Banking_PinStatusUnknown, AB_Banking_PinStatusOk }
enum  AB_BANKING_TANSTATUS { AB_Banking_TanStatusBad = -1, AB_Banking_TanStatusUnknown, AB_Banking_TanStatusUsed, AB_Banking_TanStatusUnused }
typedef int(*) AB_BANKING_GETPIN_FN (AB_BANKING *ab, GWEN_TYPE_UINT32 flags, const char *token, const char *title, const char *text, char *buffer, int minLen, int maxLen)
typedef int(*) AB_BANKING_SETPINSTATUS_FN (AB_BANKING *ab, const char *token, const char *pin, AB_BANKING_PINSTATUS status)
typedef int(*) AB_BANKING_GETTAN_FN (AB_BANKING *ab, const char *token, const char *title, const char *text, char *buffer, int minLen, int maxLen)
typedef int(*) AB_BANKING_SETTANSTATUS_FN (AB_BANKING *ab, const char *token, const char *tan, AB_BANKING_TANSTATUS status)

Prototypes For Virtual User Interaction Functions

typedef int(*) AB_BANKING_MESSAGEBOX_FN (AB_BANKING *ab, GWEN_TYPE_UINT32 flags, const char *title, const char *text, const char *b1, const char *b2, const char *b3)
typedef int(*) AB_BANKING_INPUTBOX_FN (AB_BANKING *ab, GWEN_TYPE_UINT32 flags, const char *title, const char *text, char *buffer, int minLen, int maxLen)
typedef GWEN_TYPE_UINT32(*) AB_BANKING_SHOWBOX_FN (AB_BANKING *ab, GWEN_TYPE_UINT32 flags, const char *title, const char *text)
typedef void(*) AB_BANKING_HIDEBOX_FN (AB_BANKING *ab, GWEN_TYPE_UINT32 id)
typedef GWEN_TYPE_UINT32(*) AB_BANKING_PROGRESS_START_FN (AB_BANKING *ab, const char *title, const char *text, GWEN_TYPE_UINT32 total)
typedef int(*) AB_BANKING_PROGRESS_ADVANCE_FN (AB_BANKING *ab, GWEN_TYPE_UINT32 id, GWEN_TYPE_UINT32 progress)
typedef int(*) AB_BANKING_PROGRESS_LOG_FN (AB_BANKING *ab, GWEN_TYPE_UINT32 id, AB_BANKING_LOGLEVEL level, const char *text)
typedef int(*) AB_BANKING_PROGRESS_END_FN (AB_BANKING *ab, GWEN_TYPE_UINT32 id)
typedef int(*) AB_BANKING_PRINT_FN (AB_BANKING *ab, const char *docTitle, const char *docType, const char *descr, const char *text)

Virtual User Interaction Functions

All text passed to the frontend via one of the following functions is expected to be an UTF-8 string which may contain newlines but no other control characters. Text delivered as argument called text throughout the documentation in this group may contain HTML tags. If it does a non-HTML version must be supplied, too. The text MUST begin with the non-HTML version, so that a frontend not capable of parsing HTML can simply exclude the HTML part by cutting before "<html".

This is an example for HTML and non-HTML text:

 const char *text;

 text="This is the non-HTML text"
      "<html>"
      "And this is the <b>HTML</b> version."
      "</html>"

Frontends capable of parsing HTML (such as the KDE frontend) will extract the HTML information and show only that part of the string.

Other frontends have to extract the non-HTML information and show only that.

int AB_Banking_MessageBox (AB_BANKING *ab, GWEN_TYPE_UINT32 flags, const char *title, const char *text, const char *b1, const char *b2, const char *b3)
int AB_Banking_InputBox (AB_BANKING *ab, GWEN_TYPE_UINT32 flags, const char *title, const char *text, char *buffer, int minLen, int maxLen)
GWEN_TYPE_UINT32 AB_Banking_ShowBox (AB_BANKING *ab, GWEN_TYPE_UINT32 flags, const char *title, const char *text)
void AB_Banking_HideBox (AB_BANKING *ab, GWEN_TYPE_UINT32 id)
GWEN_TYPE_UINT32 AB_Banking_ProgressStart (AB_BANKING *ab, const char *title, const char *text, GWEN_TYPE_UINT32 total)
int AB_Banking_ProgressAdvance (AB_BANKING *ab, GWEN_TYPE_UINT32 id, GWEN_TYPE_UINT32 progress)
int AB_Banking_ProgressLog (AB_BANKING *ab, GWEN_TYPE_UINT32 id, AB_BANKING_LOGLEVEL level, const char *text)
int AB_Banking_ProgressEnd (AB_BANKING *ab, GWEN_TYPE_UINT32 id)
int AB_Banking_Print (AB_BANKING *ab, const char *docTitle, const char *docType, const char *descr, const char *text)

Setters For Virtual User Interaction Functions

The functions in this group set the corresponding callback function pointers.

void AB_Banking_SetMessageBoxFn (AB_BANKING *ab, AB_BANKING_MESSAGEBOX_FN f)
void AB_Banking_SetInputBoxFn (AB_BANKING *ab, AB_BANKING_INPUTBOX_FN f)
void AB_Banking_SetShowBoxFn (AB_BANKING *ab, AB_BANKING_SHOWBOX_FN f)
void AB_Banking_SetHideBoxFn (AB_BANKING *ab, AB_BANKING_HIDEBOX_FN f)
void AB_Banking_SetProgressStartFn (AB_BANKING *ab, AB_BANKING_PROGRESS_START_FN f)
void AB_Banking_SetProgressAdvanceFn (AB_BANKING *ab, AB_BANKING_PROGRESS_ADVANCE_FN f)
void AB_Banking_SetProgressLogFn (AB_BANKING *ab, AB_BANKING_PROGRESS_LOG_FN f)
void AB_Banking_SetProgressEndFn (AB_BANKING *ab, AB_BANKING_PROGRESS_END_FN f)
void AB_Banking_SetPrintFn (AB_BANKING *ab, AB_BANKING_PRINT_FN f)

Virtual Security Functions And Associated Functions

int AB_Banking_GetPin (AB_BANKING *ab, GWEN_TYPE_UINT32 flags, const char *token, const char *title, const char *text, char *buffer, int minLen, int maxLen)
void AB_Banking_SetPinCacheEnabled (AB_BANKING *ab, int enabled)
int AB_Banking_GetPinCacheEnabled (const AB_BANKING *ab)
int AB_Banking_SetPinStatus (AB_BANKING *ab, const char *token, const char *pin, AB_BANKING_PINSTATUS status)
int AB_Banking_GetTan (AB_BANKING *ab, const char *token, const char *title, const char *text, char *buffer, int minLen, int maxLen)
int AB_Banking_SetTanStatus (AB_BANKING *ab, const char *token, const char *tan, AB_BANKING_TANSTATUS status)

Setters For Virtual Security Functions

void AB_Banking_SetGetPinFn (AB_BANKING *ab, AB_BANKING_GETPIN_FN f)
void AB_Banking_SetSetPinStatusFn (AB_BANKING *ab, AB_BANKING_SETPINSTATUS_FN f)
void AB_Banking_SetGetTanFn (AB_BANKING *ab, AB_BANKING_GETTAN_FN f)
void AB_Banking_SetSetTanStatusFn (AB_BANKING *ab, AB_BANKING_SETTANSTATUS_FN f)

Flags For AB_Banking_InputBox

These flags are given to AB_Banking_InputBox to modify its behaviour.

#define AB_BANKING_INPUT_FLAGS_CONFIRM   0x00000001
#define AB_BANKING_INPUT_FLAGS_SHOW   0x00000002
#define AB_BANKING_INPUT_FLAGS_NUMERIC   0x00000004
#define AB_BANKING_INPUT_FLAGS_RETRY   0x00000008
#define AB_BANKING_INPUT_FLAGS_ALLOW_DEFAULT   0x00000010

Flags For AB_Banking_MessageBox

These flags are given to AB_Banking_MessageBox to modify its behaviour. You may OR-combine the flags.
Examples:

A note about confirmation buttons: AqBanking has been designed with non-interactive applications in mind. For such an application it is important to know what button-press it has to simulate upon catching of a messagebox callback. This is what the confimation button flags are for. For informative messages the application may simply return the number of the confirmation button and be done.

However, non-interactive applications should return an error (value 0) for messages classified as dangerous (see AB_BANKING_MSG_FLAGS_SEVERITY_DANGEROUS) to avoid data loss.

#define AB_BANKING_MSG_FLAGS_TYPE_MASK   0x07
#define AB_BANKING_MSG_FLAGS_TYPE_INFO   0
#define AB_BANKING_MSG_FLAGS_TYPE_IS_INFO(fl)   ((fl & AB_BANKING_MSG_FLAGS_TYPE_MASK)==AB_BANKING_MSG_FLAGS_TYPE_INFO)
#define AB_BANKING_MSG_FLAGS_TYPE_WARN   1
#define AB_BANKING_MSG_FLAGS_TYPE_IS_WARN(fl)   ((fl & AB_BANKING_MSG_FLAGS_TYPE_MASK)==AB_BANKING_MSG_FLAGS_TYPE_WARN)
#define AB_BANKING_MSG_FLAGS_TYPE_ERROR   2
#define AB_BANKING_MSG_FLAGS_TYPE_IS_ERROR   ((fl & AB_BANKING_MSG_FLAGS_TYPE_MASK)==AB_BANKING_MSG_FLAGS_TYPE_ERROR)
#define AB_BANKING_MSG_FLAGS_CONFIRM_B1   (1<<3)
#define AB_BANKING_MSG_FLAGS_CONFIRM_B2   (2<<3)
#define AB_BANKING_MSG_FLAGS_CONFIRM_B3   (3<<3)
#define AB_BANKING_MSG_FLAGS_CONFIRM_BUTTON(fl)   ((fl & 0x3)>>3)
#define AB_BANKING_MSG_FLAGS_SEVERITY_MASK   (0x7<<5)
#define AB_BANKING_MSG_FLAGS_SEVERITY_NORMAL   (0x0<<5)
#define AB_BANKING_MSG_FLAGS_SEVERITY_IS_NORMAL(fl)
#define AB_BANKING_MSG_FLAGS_SEVERITY_DANGEROUS   (0x1<<5)
#define AB_BANKING_MSG_FLAGS_SEVERITY_IS_DANGEROUS(fl)

Flags For AB_Banking_ShowBox

#define AB_BANKING_SHOWBOX_FLAGS_BEEP   0x00000001

Special Progress Values for AB_Banking_ProgressAdvance

#define AB_BANKING_PROGRESS_NONE   0xffffffff
#define AB_BANKING_PROGRESS_ONE   0xfffffffe

Enumerations

enum  AB_BANKING_LOGLEVEL {
  AB_Banking_LogLevelPanic = 0, AB_Banking_LogLevelEmergency, AB_Banking_LogLevelError, AB_Banking_LogLevelWarn,
  AB_Banking_LogLevelNotice, AB_Banking_LogLevelInfo, AB_Banking_LogLevelDebug, AB_Banking_LogLevelVerbous
}


Define Documentation

#define AB_BANKING_INPUT_FLAGS_ALLOW_DEFAULT   0x00000010

allow a default value to be used instead of an entered one. A graphical UI should add a "default" button to the dialog.

Definition at line 45 of file banking_virt.h.

#define AB_BANKING_INPUT_FLAGS_CONFIRM   0x00000001

input must be confirmed (e.g. by asking for the same input twice)

Definition at line 36 of file banking_virt.h.

#define AB_BANKING_INPUT_FLAGS_NUMERIC   0x00000004

numeric input is requested (e.g. for PINs)

Definition at line 40 of file banking_virt.h.

#define AB_BANKING_INPUT_FLAGS_RETRY   0x00000008

if set then this is a retry (esp. when getting a PIN)

Definition at line 42 of file banking_virt.h.

#define AB_BANKING_INPUT_FLAGS_SHOW   0x00000002

input may be shown (otherwise it should be hidden, e.g. for passwords)

Definition at line 38 of file banking_virt.h.

#define AB_BANKING_MSG_FLAGS_CONFIRM_B1   (1<<3)

button 1 is the confirmation button

Definition at line 117 of file banking_virt.h.

#define AB_BANKING_MSG_FLAGS_CONFIRM_B2   (2<<3)

button 2 is the confirmation button

Definition at line 119 of file banking_virt.h.

#define AB_BANKING_MSG_FLAGS_CONFIRM_B3   (3<<3)

button 3 is the confirmation button

Definition at line 121 of file banking_virt.h.

#define AB_BANKING_MSG_FLAGS_CONFIRM_BUTTON ( fl   )     ((fl & 0x3)>>3)

Determine which button is the confirmation button

Definition at line 123 of file banking_virt.h.

#define AB_BANKING_MSG_FLAGS_SEVERITY_DANGEROUS   (0x1<<5)

Message is considered dangerous and thus should be attended to by a humanoid ;-)

Definition at line 155 of file banking_virt.h.

#define AB_BANKING_MSG_FLAGS_SEVERITY_IS_DANGEROUS ( fl   ) 

Value:

Definition at line 156 of file banking_virt.h.

#define AB_BANKING_MSG_FLAGS_SEVERITY_IS_NORMAL ( fl   ) 

Value:

Definition at line 150 of file banking_virt.h.

#define AB_BANKING_MSG_FLAGS_SEVERITY_MASK   (0x7<<5)

Check for the severity of the message. This allows non-interactive backends to react on the message accordingly. The backend calling this function thus allows the frontend to detect when the message is important regarding data security. E.g. a message like "Shall I delete this file" should be considered dangerous (since this might result in a data loss). However, the messae "Just started" is not that dangerous ;-)

The following example allows to determine whether a message is dangerous:

 if ( ( flags & AB_BANKING_MSG_FLAGS_SEVERITY_MASK) ==
      AB_BANKING_MSG_FLAGS_SEVERITY_DANGEROUS) {
      fprintf(stderr, "This is dangerous.\n");
 }

Definition at line 147 of file banking_virt.h.

#define AB_BANKING_MSG_FLAGS_SEVERITY_NORMAL   (0x0<<5)

Message does not affect security or induce any problem to the system

Definition at line 149 of file banking_virt.h.

#define AB_BANKING_MSG_FLAGS_TYPE_ERROR   2

The message is a error message

Definition at line 111 of file banking_virt.h.

#define AB_BANKING_MSG_FLAGS_TYPE_INFO   0

The message is a simple information.

Definition at line 99 of file banking_virt.h.

#define AB_BANKING_MSG_FLAGS_TYPE_IS_ERROR   ((fl & AB_BANKING_MSG_FLAGS_TYPE_MASK)==AB_BANKING_MSG_FLAGS_TYPE_ERROR)

check whether the given flags represent an error message

Definition at line 113 of file banking_virt.h.

#define AB_BANKING_MSG_FLAGS_TYPE_IS_INFO ( fl   )     ((fl & AB_BANKING_MSG_FLAGS_TYPE_MASK)==AB_BANKING_MSG_FLAGS_TYPE_INFO)

check whether the given flags represent an info message

Definition at line 101 of file banking_virt.h.

#define AB_BANKING_MSG_FLAGS_TYPE_IS_WARN ( fl   )     ((fl & AB_BANKING_MSG_FLAGS_TYPE_MASK)==AB_BANKING_MSG_FLAGS_TYPE_WARN)

check whether the given flags represent a warning message

Definition at line 107 of file banking_virt.h.

#define AB_BANKING_MSG_FLAGS_TYPE_MASK   0x07

Defines the mask to catch the message type. E.g. a check whether a message is a warning could be performed by:

 if ( ( flags & AB_BANKING_MSG_FLAGS_TYPE_MASK) ==
      AB_BANKING_MSG_FLAGS_TYPE_WARN) {
      fprintf(stderr, "This is a warning.\n");
 }

Definition at line 97 of file banking_virt.h.

#define AB_BANKING_MSG_FLAGS_TYPE_WARN   1

The message is a warning

Definition at line 105 of file banking_virt.h.

#define AB_BANKING_PROGRESS_NONE   0xffffffff

This value is used with AB_Banking_ProgressAdvance to flag that there really was no progress since the last call to that function but that that function should simply check for user interaction (without the need of updating the progress bar).

Definition at line 186 of file banking_virt.h.

#define AB_BANKING_PROGRESS_ONE   0xfffffffe

This value is used when the total number of steps is not known to the caller and he just wants to advance the progress by one (e.g. backends use this value when a job has been finished, but the backends do not know how many jobs there still are in AqBanking's queue).

Definition at line 194 of file banking_virt.h.

#define AB_BANKING_SHOWBOX_FLAGS_BEEP   0x00000001

Make the frontend beep. This should rarely be used, and only in situations where it is very important to get the users attention (e.g. when asking for a PIN on a card reader).

Definition at line 171 of file banking_virt.h.


Typedef Documentation

typedef int(*) AB_BANKING_GETPIN_FN(AB_BANKING *ab, GWEN_TYPE_UINT32 flags, const char *token, const char *title, const char *text, char *buffer, int minLen, int maxLen)

Definition at line 351 of file banking_virt.h.

typedef int(*) AB_BANKING_GETTAN_FN(AB_BANKING *ab, const char *token, const char *title, const char *text, char *buffer, int minLen, int maxLen)

Definition at line 364 of file banking_virt.h.

typedef void(*) AB_BANKING_HIDEBOX_FN(AB_BANKING *ab, GWEN_TYPE_UINT32 id)

Please see AB_Banking_HideBox for details.

One way of passing arbitrary additional data to this callback is by means of the AB_Banking_GetUserData function.

Definition at line 275 of file banking_virt.h.

typedef int(*) AB_BANKING_INPUTBOX_FN(AB_BANKING *ab, GWEN_TYPE_UINT32 flags, const char *title, const char *text, char *buffer, int minLen, int maxLen)

Please see AB_Banking_InputBox for details.

One way of passing arbitrary additional data to this callback is by means of the AB_Banking_GetUserData function.

Definition at line 251 of file banking_virt.h.

typedef int(*) AB_BANKING_MESSAGEBOX_FN(AB_BANKING *ab, GWEN_TYPE_UINT32 flags, const char *title, const char *text, const char *b1, const char *b2, const char *b3)

Please see AB_Banking_MessageBox for details.

One way of passing arbitrary additional data to this callback is by means of the AB_Banking_GetUserData function. However, the recommended way is to use Gwenhywfars' heritage functions (see GWEN_INHERIT_SETDATA).

Definition at line 237 of file banking_virt.h.

typedef int(*) AB_BANKING_PRINT_FN(AB_BANKING *ab, const char *docTitle, const char *docType, const char *descr, const char *text)

This function is used to make the application print something. The same restrictions noted above apply to the text parameter (utf-8, maybe containing HTML). Please see AB_Banking_Print for details.

Definition at line 323 of file banking_virt.h.

typedef int(*) AB_BANKING_PROGRESS_ADVANCE_FN(AB_BANKING *ab, GWEN_TYPE_UINT32 id, GWEN_TYPE_UINT32 progress)

Please see AB_Banking_ProgressAdvance for details.

One way of passing arbitrary additional data to this callback is by means of the AB_Banking_GetUserData function.

Definition at line 295 of file banking_virt.h.

typedef int(*) AB_BANKING_PROGRESS_END_FN(AB_BANKING *ab, GWEN_TYPE_UINT32 id)

Please see AB_Banking_ProgressEnd for details.

One way of passing arbitrary additional data to this callback is by means of the AB_Banking_GetUserData function.

Definition at line 314 of file banking_virt.h.

typedef int(*) AB_BANKING_PROGRESS_LOG_FN(AB_BANKING *ab, GWEN_TYPE_UINT32 id, AB_BANKING_LOGLEVEL level, const char *text)

Please see AB_Banking_ProgressLog for details.

One way of passing arbitrary additional data to this callback is by means of the AB_Banking_GetUserData function.

Definition at line 304 of file banking_virt.h.

typedef GWEN_TYPE_UINT32(*) AB_BANKING_PROGRESS_START_FN(AB_BANKING *ab, const char *title, const char *text, GWEN_TYPE_UINT32 total)

Please see AB_Banking_ProgressStart for details.

One way of passing arbitrary additional data to this callback is by means of the AB_Banking_GetUserData function.

Definition at line 284 of file banking_virt.h.

typedef int(*) AB_BANKING_SETPINSTATUS_FN(AB_BANKING *ab, const char *token, const char *pin, AB_BANKING_PINSTATUS status)

Definition at line 359 of file banking_virt.h.

typedef int(*) AB_BANKING_SETTANSTATUS_FN(AB_BANKING *ab, const char *token, const char *tan, AB_BANKING_TANSTATUS status)

Definition at line 372 of file banking_virt.h.

typedef GWEN_TYPE_UINT32(*) AB_BANKING_SHOWBOX_FN(AB_BANKING *ab, GWEN_TYPE_UINT32 flags, const char *title, const char *text)

Please see AB_Banking_ShowBox for details.

One way of passing arbitrary additional data to this callback is by means of the AB_Banking_GetUserData function.

Definition at line 265 of file banking_virt.h.


Enumeration Type Documentation

enum AB_BANKING_LOGLEVEL

This is used with AB_Banking_ProgressLog to tell the function about the severity of the message. The implementation of this function may then decide on this argument about whether to show or repress this message.

Enumerator:
AB_Banking_LogLevelPanic  extremely important message (just before abort())
AB_Banking_LogLevelEmergency  very important message
AB_Banking_LogLevelError  error message
AB_Banking_LogLevelWarn  warning
AB_Banking_LogLevelNotice  notice (important information)
AB_Banking_LogLevelInfo  information (not that important)
AB_Banking_LogLevelDebug  simple debug message
AB_Banking_LogLevelVerbous  verbous debug message

Definition at line 205 of file banking_virt.h.

enum AB_BANKING_PINSTATUS

Enumerator:
AB_Banking_PinStatusBad 
AB_Banking_PinStatusUnknown 
AB_Banking_PinStatusOk 

Definition at line 336 of file banking_virt.h.

enum AB_BANKING_TANSTATUS

Enumerator:
AB_Banking_TanStatusBad 
AB_Banking_TanStatusUnknown 
AB_Banking_TanStatusUsed 
AB_Banking_TanStatusUnused 

Definition at line 343 of file banking_virt.h.


Function Documentation

int AB_Banking_GetPin ( AB_BANKING ab,
GWEN_TYPE_UINT32  flags,
const char *  token,
const char *  title,
const char *  text,
char *  buffer,
int  minLen,
int  maxLen 
)

This function retrieves the PIN for the given token. If the application hasn't set any other GetPin function, this function will call AB_Banking_InputBox for the user input.

Parameters:
ab Banking interface
flags Flags, see AB_Banking_InputBox and AB_BANKING_INPUT_FLAGS_CONFIRM
token A unique identification of what PIN is required. To be used for automated PIN lookup.
title Title of the input box (in UTF-8)
text Text of the box: UTF-8, with both a normal text and a HTML variant of the text in the same string. See text restrictions note above.
buffer Buffer to store the response in. Must have at least room for maxLen bytes
minLen Minimal length of input that is required before the returned answer is accepted (if 0 then there is no low limit)
maxLen Size of the buffer including the trailing NULL character. This means that if you want to ask the user for a PIN of at most 4 characters you need to supply a buffer of at least 5 bytes and provide a 5 as maxLen.

int AB_Banking_GetPinCacheEnabled ( const AB_BANKING ab  ) 

Returns nonzero (TRUE) if PIN caching across jobs until the end of this session is enabled. Returns zero (FALSE) if caching across jobs is disabled.

int AB_Banking_GetTan ( AB_BANKING ab,
const char *  token,
const char *  title,
const char *  text,
char *  buffer,
int  minLen,
int  maxLen 
)

This function retrieves a TAN for the given token. If the application hasn't set any other GetTan function, this function will call AB_Banking_InputBox for the user input.

void AB_Banking_HideBox ( AB_BANKING ab,
GWEN_TYPE_UINT32  id 
)

Hides a message box previously shown by a call to AB_Banking_ShowBox.

This function MUST return immediately (non-blocking).

Parameters:
ab banking interface
id id returned by AB_Banking_ShowBox. If 0 then the last message shown is referred to.

int AB_Banking_InputBox ( AB_BANKING ab,
GWEN_TYPE_UINT32  flags,
const char *  title,
const char *  text,
char *  buffer,
int  minLen,
int  maxLen 
)

Ask the user for input.

This function is blocking.

Parameters:
ab banking interface
flags flags, see AB_BANKING_INPUT_FLAGS_CONFIRM ff.
title title of the input box
text Text of the box: UTF-8, with both a normal text and a HTML variant of the text in the same string. See text restrictions note above.
buffer buffer to store the response in. Must have at least room for maxLen bytes
minLen minimal length of input (if 0 then there is no low limit)
maxLen size of the buffer including the trailing NULL character. This means that if you want to ask the user for a PIN of at most 4 characters you need to supply a buffer of at least 5 bytes and provide a 5 as maxLen.
Returns:
Zero on success, nonzero when the user requested abort or there was any error. The special value AB_ERROR_DEFAULT_VALUE should be returned if the flag AB_BANKING_INPUT_FLAGS_ALLOW_DEFAULT was given and the user has chosen to use the default value (e.g. pressed the "default" button in a GUI).

int AB_Banking_MessageBox ( AB_BANKING ab,
GWEN_TYPE_UINT32  flags,
const char *  title,
const char *  text,
const char *  b1,
const char *  b2,
const char *  b3 
)

Show a message box with optional buttons. The message box may either contain 1, 2 or three buttons. If only one button is wanted then b1 should hold a pointer to the button text (b2 and b3 must be NULL) In two-button mode b1 and b2 must be valid (b3 must be NULL) In three-button-mode b1, b2 and b3 must be valid pointers. The return value tells which button the user pressed:

If the frontend can not determine which button has been pressed (e.g. if no button was pressed but the user rather aborted the dialog by simply closing the box) it should return 0.

This function is blocking.

Returns:
the number of the button pressed (1=b1, 2=b2, 3=b3), any other value should be considered an error, including 0)
Parameters:
ab banking interface
flags flags, see AB_BANKING_MSG_FLAGS_TYPE_MASK ff.
title title of the message box
text Text of the box: UTF-8, with both a normal text and a HTML variant of the text in the same string. See text restrictions note above.
b1 text for the first button (required), should be something like "Ok" (see text restrictions note above)
b2 text for the optional second button
b3 text for the optional third button

int AB_Banking_Print ( AB_BANKING ab,
const char *  docTitle,
const char *  docType,
const char *  descr,
const char *  text 
)

This function makes the application print something.

Parameters:
ab banking interface
docTitle title of the document. This might be presented to the user
docType an unique identifier of the document to be printed. This can be used by the application to separate printer settings for different document types. The name itself has no meaning and can be choosen freely by the caller. However, backends should append their name and a colon to keep this argument unique. This argument should not be translated.
descr an optional description about what the document contains. This might be shown to the user (see text restriction notes above).
text text to be printed (see text restriction notes above).

int AB_Banking_ProgressAdvance ( AB_BANKING ab,
GWEN_TYPE_UINT32  id,
GWEN_TYPE_UINT32  progress 
)

Advances the progress bar an application might present to the user and checks whether the user wants to abort the operation currently in progress.

On graphical user interfaces this function should also check for user interaction and/or update the GUI (e.g. by calling qApp->processEvents() when using QT/KDE).

This function MUST return immediately (non-blocking).

Returns:
0 if ok, !=0 if the current operation is to be aborted
Parameters:
ab banking interface
id id assigned by AB_Banking_ProgressStart (if 0 then the last started progress dialog is referred to)
progress new value for progress. A special value is AB_BANKING_PROGRESS_NONE which means that the progress is unchanged. This might be used as a keepalive call to a GUI.

int AB_Banking_ProgressEnd ( AB_BANKING ab,
GWEN_TYPE_UINT32  id 
)

Flags the end of the current operation. In graphical user interfaces this call should allow the user to close the progress dialog window.

On graphical user interfaces a call to this function should disable the abort button. It would be best not to close the dialog on receiption of this call but to simply enable a dialog closing (otherwise the user will not be able to see the log messages).

This function MUST return immediately (non-blocking).

Parameters:
ab banking interface
id id assigned by AB_Banking_ProgressStart (if 0 then the last started progress dialog is referred to)

int AB_Banking_ProgressLog ( AB_BANKING ab,
GWEN_TYPE_UINT32  id,
AB_BANKING_LOGLEVEL  level,
const char *  text 
)

Adds a log message to the referred process dialog.

This function MUST return immediately (non-blocking).

Parameters:
ab banking interface
id id assigned by AB_Banking_ProgressStart (if 0 then the last started progress dialog is referred to)
level log level (see AB_Banking_LogLevelPanic ff.)
text Text of the box: UTF-8, with both a normal text and a HTML variant of the text in the same string. See text restrictions note above.

GWEN_TYPE_UINT32 AB_Banking_ProgressStart ( AB_BANKING ab,
const char *  title,
const char *  text,
GWEN_TYPE_UINT32  total 
)

This function is called when a long term operation is started. Theoretically nesting is allowed, however, you should refrain from opening multiple progress dialogs to avoid confusion of the user.

This function must return immediately (i.e. it MUST NOT wait for user interaction).

On graphical user interfaces such a dialog should contain a widget for the text presented here, a progress bar, a text widget to collect the log messages received via AB_Banking_ProgressLog and a button to allow the user to abort the current operation monitored by this dialog window.

Between a call to this function and one to AB_Banking_ProgressEnd the user should not be allowed to close the dialog window.

This function MUST return immediately (non-blocking).

Returns:
id to be used with the other AB_Banking_Progress functions.
Parameters:
ab banking interface
title title of the dialog
text Text of the box: UTF-8, with both a normal text and a HTML variant of the text in the same string. See text restrictions note above.
total total number of steps of the operation started (i.e. value which represents 100%)

void AB_Banking_SetGetPinFn ( AB_BANKING ab,
AB_BANKING_GETPIN_FN  f 
)

void AB_Banking_SetGetTanFn ( AB_BANKING ab,
AB_BANKING_GETTAN_FN  f 
)

void AB_Banking_SetHideBoxFn ( AB_BANKING ab,
AB_BANKING_HIDEBOX_FN  f 
)

void AB_Banking_SetInputBoxFn ( AB_BANKING ab,
AB_BANKING_INPUTBOX_FN  f 
)

void AB_Banking_SetMessageBoxFn ( AB_BANKING ab,
AB_BANKING_MESSAGEBOX_FN  f 
)

void AB_Banking_SetPinCacheEnabled ( AB_BANKING ab,
int  enabled 
)

Enable or disable the internal caching of PINs across jobs during one full session. If the parameter is nonzero (TRUE), then every entered PIN will be cached throughout the rest of this session and is not asked for again. If the parameter is zero (FALSE), then PINs will only be cached during one queue execution, but not across several queue executions or several jobs. In other words, if this is FALSE, then after each AB_Banking_ExecuteQueue() the internal PIN cache will be cleared.

Note: There has to be *some* Pin caching during the execution of one job, because the medium is accessed several time. It would therefore be very inconvenient for the user having to enter the PIN several times during one job. Therefore we decided to implement an internal PIN cache.

Parameters:
ab The banking object
enabled If nonzero (TRUE), then caching across jobs is enabled. If zero (FALSE), caching across jobs is disabled.

int AB_Banking_SetPinStatus ( AB_BANKING ab,
const char *  token,
const char *  pin,
AB_BANKING_PINSTATUS  status 
)

Sets a status for the given token and its given pin. This way, aqbanking will keep track of whether an entered PIN might have been wrong so it isn't used again.

void AB_Banking_SetPrintFn ( AB_BANKING ab,
AB_BANKING_PRINT_FN  f 
)

void AB_Banking_SetProgressAdvanceFn ( AB_BANKING ab,
AB_BANKING_PROGRESS_ADVANCE_FN  f 
)

void AB_Banking_SetProgressEndFn ( AB_BANKING ab,
AB_BANKING_PROGRESS_END_FN  f 
)

void AB_Banking_SetProgressLogFn ( AB_BANKING ab,
AB_BANKING_PROGRESS_LOG_FN  f 
)

void AB_Banking_SetProgressStartFn ( AB_BANKING ab,
AB_BANKING_PROGRESS_START_FN  f 
)

void AB_Banking_SetSetPinStatusFn ( AB_BANKING ab,
AB_BANKING_SETPINSTATUS_FN  f 
)

void AB_Banking_SetSetTanStatusFn ( AB_BANKING ab,
AB_BANKING_SETTANSTATUS_FN  f 
)

void AB_Banking_SetShowBoxFn ( AB_BANKING ab,
AB_BANKING_SHOWBOX_FN  f 
)

int AB_Banking_SetTanStatus ( AB_BANKING ab,
const char *  token,
const char *  tan,
AB_BANKING_TANSTATUS  status 
)

Sets a status for the given token and its given TAN. This way, applications can keep track of whether an entered TAN might have been used.

GWEN_TYPE_UINT32 AB_Banking_ShowBox ( AB_BANKING ab,
GWEN_TYPE_UINT32  flags,
const char *  title,
const char *  text 
)

Shows a box with the given text. This function should return immediately, it should especially NOT wait for user input. This is used to show very important notices the user should see but which don't need user interaction. The message box will be removed later via AB_Banking_HideBox. It is ok to allow the user to prematurely close the box.

It is required for every call to this function to be followed later by a corresponding call to AB_Banking_HideBox.

This function MUST return immediately (non-blocking).

Returns:
returns an id to be presented to AB_Banking_HideBox.
Parameters:
ab banking interface
flags flags, see AB_BANKING_SHOWBOX_FLAGS_BEEP ff
title title of the box
text Text of the box: UTF-8, with both a normal text and a HTML variant of the text in the same string. See text restrictions note above.


Generated on Sun Apr 29 17:23:05 2007 for aqbanking by  doxygen 1.5.1