eid-viewer
eid-viewer library
|
Callbacks which the backend can perform towards the UI. More...
#include <oslayer.h>
Data Fields | |
void(* | newsrc )(enum eid_vwr_source new_source) |
Called when the data source has changed. More... | |
void(* | newstringdata )(const EID_CHAR *label, const EID_CHAR *data) |
new string data to be displayed in UI. More... | |
void(* | newbindata )(const EID_CHAR *label, const unsigned char *data, int datalen) |
New binary data to be displayed in UI. More... | |
void(* | log )(enum eid_vwr_loglevel level, const EID_CHAR *line) |
Log a string at the given level. More... | |
void(* | logv )(enum eid_vwr_loglevel level, const EID_CHAR *line, va_list ap) |
Log a string using varargs. More... | |
void(* | newstate )(enum eid_vwr_states new_state) |
State machine transition. More... | |
void(* | pinop_result )(enum eid_vwr_pinops op, enum eid_vwr_result res) |
Return the result of a PIN operation. More... | |
void(* | readers_changed )(unsigned long nreaders, slotdesc *slots) |
The number of known readers has changed. More... | |
Callbacks which the backend can perform towards the UI.
To ensure forward compatibility, a UI implementation must call eid_vwr_cbstruct() to allocate an eid_vwr_ui_callbacks struct. Failure to do so may result in crashes in future versions of the eid-viewer library.
An implementation may leave one or more of the below function pointers empty (i.e., at NULL). If this happens, the backend will simply not issue that event.
void(* log) (enum eid_vwr_loglevel level, const EID_CHAR *line) |
void(* logv) (enum eid_vwr_loglevel level, const EID_CHAR *line, va_list ap) |
Log a string using varargs.
The advantage of having this function (as opposed to log()) is that it allows for allocating a string using whatever memory management the frontend uses. If this is not necessary or desirable, implementing log() rather than this function should suffice.
level | the level at which to log. |
line | the printf()-formatted string to log. |
ap | arguments to line's format string. |
void(* newbindata) (const EID_CHAR *label, const unsigned char *data, int datalen) |
New binary data to be displayed in UI.
Data with the given label and which should be interpreted as a binary blob was found. This will not change when the language is modified.
label | the label (identifier) of the data item. Should never change. |
data | the data as it is on the card. |
datalen | the length of the data, in bytes. |
void(* newsrc) (enum eid_vwr_source new_source) |
Called when the data source has changed.
When the viewer library starts looking at a new file or eID card, this event is issued. When this happens, a user interface should clear whatever data it has received from the backend – it is not valid anymore.
new_source | the type of the new source. |
void(* newstate) (enum eid_vwr_states new_state) |
State machine transition.
This event is issued whenever the state machine changes state. For more information, see the state machine diagram as documented at struct eid_vwr_states.
new_state | the new state we're in right now. |
void(* newstringdata) (const EID_CHAR *label, const EID_CHAR *data) |
new string data to be displayed in UI.
Data with the given label and which should be interpreted as a string was found. These may be re-issued (with modified data) after a call to eid_vwr_convert_set_lang().
label | the label (identifier) of the data item. Should never change. |
data | the data as represented in the currently active language. |
void(* pinop_result) (enum eid_vwr_pinops op, enum eid_vwr_result res) |
Return the result of a PIN operation.
When the user interface calls eid_vwr_pinop(), then at some later point this function may be called with the result of the requested PIN operation.
If the state machine is not in the TOKEN_WAIT state when eid_vwr_pinop() was called, this event will never be fired.
op | the operation for which this is a result |
res | the result of the operation |
void(* readers_changed) (unsigned long nreaders, slotdesc *slots) |
The number of known readers has changed.
nreaders | the new reader count |
slots | the slot IDs and human-readable descriptions of all known readers |