eid-viewer
eid-viewer library
oslayer.h
Go to the documentation of this file.
1 
11 #ifndef EID_VWR_OSLAYER_H
12 #define EID_VWR_OSLAYER_H
13 
14 #include <conversions.h>
15 #include <stdlib.h>
16 #include <stdarg.h>
17 #include <eid-viewer/macros.h>
18 
19 typedef struct _slotdesc slotdesc;
20 
22 struct _slotdesc {
23  unsigned long slot;
24  EID_CHAR *description;
25 };
26 
33 };
34 
44 };
45 
50 };
51 
57 };
58 
80 
81  STATE_COUNT,
82 };
83 
91 };
92 
93 
115  void(*newsrc)(enum eid_vwr_source new_source);
128  void(*newstringdata)(const EID_CHAR* label, const EID_CHAR* data);
140  void(*newbindata)(const EID_CHAR* label, const unsigned char* data, int datalen);
149  void(*log)(enum eid_vwr_loglevel level, const EID_CHAR* line);
165  void(*logv)(enum eid_vwr_loglevel level, const EID_CHAR* line, va_list ap);
174  void(*newstate)(enum eid_vwr_states new_state);
187  void(*pinop_result)(enum eid_vwr_pinops op, enum eid_vwr_result res);
194  void(*readers_changed)(unsigned long nreaders, slotdesc* slots);
195 };
196 
199  void* imagedata;
200  size_t imagelen;
201  int have_data;
202 };
203 
213 DllExport void eid_vwr_pinop(enum eid_vwr_pinops op);
226 DllExport int eid_vwr_createcallbacks(struct eid_vwr_ui_callbacks* cb);
238 DllExport struct eid_vwr_ui_callbacks* eid_vwr_cbstruct();
247 DllExport struct eid_vwr_preview* eid_vwr_get_preview(const EID_CHAR* filename);
255 DllExport void eid_vwr_poll();
260 DllExport void eid_vwr_be_mainloop();
272 DllExport void eid_vwr_be_serialize(const EID_CHAR* target_file);
283 DllExport void eid_vwr_be_deserialize(const EID_CHAR* source_file);
296 DllExport const char* eid_vwr_be_get_xmlform();
305 DllExport void eid_vwr_be_select_slot(int automatic, unsigned long manualslot);
323 DllExport void eid_vwr_be_set_invalid();
329 DllExport void eid_vwr_close_file();
340 DllExport void eid_vwr_convert_set_lang(enum eid_vwr_langs which);
341 
348 DllExport enum eid_vwr_langs eid_vwr_convert_get_lang();
349 
352 #endif
Callbacks which the backend can perform towards the UI.
Definition: oslayer.h:105
DllExport void eid_vwr_be_select_slot(int automatic, unsigned long manualslot)
Select the current reader.
Definition: oslayer.c:90
Reading certificates.
Definition: oslayer.h:70
The card has been read, we&#39;re now waiting for events to do something else.
Definition: oslayer.h:68
unsigned long slot
The number of the slot, to be used with eid_vwr_be_select_slot()
Definition: oslayer.h:23
Performing a PIN operation.
Definition: oslayer.h:71
Definition: oslayer.h:41
the operation did not finish
Definition: oslayer.h:56
DllExport enum eid_vwr_langs eid_vwr_convert_get_lang()
Return the backend language.
Definition: convert.cpp:57
DllExport void eid_vwr_be_serialize(const EID_CHAR *target_file)
Save the currently-open data.
Definition: oslayer.c:67
We don&#39;t have a reader (yet?)
Definition: oslayer.h:79
DllExport void eid_vwr_be_set_invalid()
Mark the current data as invalid.
Definition: oslayer.c:94
DllExport struct eid_vwr_preview * eid_vwr_get_preview(const EID_CHAR *filename)
Create a preview for the given file.
DllExport void eid_vwr_close_file()
Close the current file.
Definition: oslayer.c:98
Saving data to a file.
Definition: oslayer.h:72
Definition: oslayer.h:22
The callbacks have been defined.
Definition: oslayer.h:65
DllExport const char * eid_vwr_be_get_xmlform()
Get the currently-open data in XML form.
Definition: oslayer.c:77
French.
Definition: oslayer.h:89
Card source. Close should not be allowed, everything else should be.
Definition: oslayer.h:31
size_t imagelen
length of imagedata
Definition: oslayer.h:200
eid_vwr_pinops
Definition: oslayer.h:47
perform a login and return whether the login was successful
Definition: oslayer.h:48
DllExport void eid_vwr_be_mainloop()
Loop over eid_vwr_poll().
Definition: oslayer.c:19
eid_vwr_result
Definition: oslayer.h:53
The data was determined to be invalid. That is, the card could be read, but signature validation fail...
Definition: oslayer.h:77
eid_vwr_loglevel
Log levels.
Definition: oslayer.h:39
Definition: oslayer.h:42
Unknown. Used as initializer.
Definition: oslayer.h:32
Definition: oslayer.h:43
Reading identity data.
Definition: oslayer.h:69
Dutch.
Definition: oslayer.h:90
change the PIN code of the card
Definition: oslayer.h:49
DllExport void eid_vwr_be_deserialize(const EID_CHAR *source_file)
Open a file.
Definition: oslayer.c:72
Ready to receive a token (eID card)
Definition: oslayer.h:66
DllExport struct eid_vwr_ui_callbacks * eid_vwr_cbstruct()
Create the eid_vwr_ui_callbacks struct.
Definition: backend.c:58
eid_vwr_states
Possible states.
Definition: oslayer.h:63
An error occurred while dealing with the card.
Definition: oslayer.h:73
DllExport void eid_vwr_pinop(enum eid_vwr_pinops op)
Perform a PIN operation.
Definition: backend.c:66
The library has been opened. Used as an initializer.
Definition: oslayer.h:64
Definition: oslayer.h:40
eid_vwr_langs
Definition: oslayer.h:85
English.
Definition: oslayer.h:88
We finished parsing the file.
Definition: oslayer.h:76
No language has yet been selected. Used as initializer.
Definition: oslayer.h:86
No source. UI should be cleared.
Definition: oslayer.h:29
int have_data
nonzero if there is actually any data
Definition: oslayer.h:201
DllExport void eid_vwr_convert_set_lang(enum eid_vwr_langs which)
Set the backend language.
Definition: convert.cpp:39
File source. "Print", "Validate" and "Close" operations should be allowed, PIN-related operations are...
Definition: oslayer.h:30
A token (eID card) has been found.
Definition: oslayer.h:67
We&#39;re reading from the file currently.
Definition: oslayer.h:75
DllExport int eid_vwr_createcallbacks(struct eid_vwr_ui_callbacks *cb)
Initialize the callbacks.
Definition: oslayer.c:13
the operation returned successfully
Definition: oslayer.h:55
void * imagedata
JPEG photo of the inspected XML file.
Definition: oslayer.h:199
German.
Definition: oslayer.h:87
eid_vwr_source
Definition: oslayer.h:28
We don&#39;t have a card, and we also don&#39;t have a file.
Definition: oslayer.h:78
operation failed
Definition: oslayer.h:54
Definition: oslayer.h:198
We&#39;re dealing with files.
Definition: oslayer.h:74
DllExport void eid_vwr_poll()
Check if there is an event to be handled.
Definition: oslayer.c:26
EID_CHAR * description
A human-readable name for the reader.
Definition: oslayer.h:24