eid-viewer
eid-viewer library
oslayer.h
Go to the documentation of this file.
1 
12 #ifndef EID_VWR_OSLAYER_H
13 #define EID_VWR_OSLAYER_H
14 
15 #include <stdlib.h>
16 #include <stdarg.h>
17 #include <eid-util/utftranslate.h>
18 #include <eid-viewer/macros.h>
19 
20 typedef struct _slotdesc slotdesc;
21 
23 struct _slotdesc
24 {
25  unsigned long slot;
26  EID_CHAR *description;
27 };
28 
31 {
36 };
37 
43 {
44 
52 };
53 
56 {
59 };
60 
63 {
67 };
68 
74 {
91 
92  STATE_COUNT,
93 };
94 
97 {
103 };
104 
105 
118 {
119 
135  int version;
136 
146  void (*newsrc) (enum eid_vwr_source new_source);
147 
160  void (*newstringdata) (const EID_CHAR * label, const EID_CHAR * data);
161 
173  void (*newbindata) (const EID_CHAR * label, const unsigned char *data,
174  int datalen);
175 
184  void (*log) (enum eid_vwr_loglevel level, const EID_CHAR * line);
185 
201  void (*logv) (enum eid_vwr_loglevel level, const EID_CHAR * line,
202  va_list ap);
203 
212  void (*newstate) (enum eid_vwr_states new_state);
213 
226  void (*pinop_result) (enum eid_vwr_pinops op,
227  enum eid_vwr_result res);
228 
235  void (*readers_changed) (unsigned long nreaders, slotdesc * slots);
236 };
237 
240 {
241  void *imagedata;
242  size_t imagelen;
243  int have_data;
244 };
245 
255 DllExport void eid_vwr_pinop(enum eid_vwr_pinops op);
256 
269 DllExport int eid_vwr_createcallbacks(struct eid_vwr_ui_callbacks *cb);
270 
282 DllExport struct eid_vwr_ui_callbacks *eid_vwr_cbstruct();
283 
292 DllExport struct eid_vwr_preview *eid_vwr_get_preview(const EID_CHAR *
293  filename);
294 
304 DllExport int eid_vwr_poll();
305 
310 #ifdef WIN32
311 DWORD WINAPI eid_vwr_be_mainloop(void* val);
312 #else
313 void* eid_vwr_be_mainloop(void* val);
314 #endif
315 
327 DllExport void eid_vwr_be_serialize(const EID_CHAR * target_file);
328 
339 DllExport void eid_vwr_be_deserialize(const EID_CHAR * source_file);
340 
353 DllExport const char *eid_vwr_be_get_xmlform();
354 
363 DllExport void eid_vwr_be_select_slot(int automatic,
364  unsigned long manualslot);
365 
383 DllExport void eid_vwr_be_set_invalid();
384 
390 DllExport void eid_vwr_close_file();
391 
402 DllExport void eid_vwr_convert_set_lang(enum eid_vwr_langs which);
403 
410 DllExport enum eid_vwr_langs eid_vwr_convert_get_lang();
411 
412 DllExport void eid_vwr_init_crypto();
413 
416 #endif
Callbacks which the backend can perform towards the UI.
Definition: oslayer.h:117
DllExport void eid_vwr_be_select_slot(int automatic, unsigned long manualslot)
Select the current reader.
Definition: oslayer.c:160
Reading certificates.
Definition: oslayer.h:81
The card has been read, we&#39;re now waiting for events to do something else.
Definition: oslayer.h:79
unsigned long slot
The number of the slot, to be used with eid_vwr_be_select_slot()
Definition: oslayer.h:25
Performing a PIN operation.
Definition: oslayer.h:82
Definition: oslayer.h:47
the operation did not finish
Definition: oslayer.h:66
DllExport enum eid_vwr_langs eid_vwr_convert_get_lang()
Return the backend language.
Definition: convert.cpp:77
DllExport void eid_vwr_be_serialize(const EID_CHAR *target_file)
Save the currently-open data.
Definition: oslayer.c:137
We don&#39;t have a reader (yet?)
Definition: oslayer.h:90
DllExport void eid_vwr_be_set_invalid()
Mark the current data as invalid.
Definition: oslayer.c:164
DllExport struct eid_vwr_preview * eid_vwr_get_preview(const EID_CHAR *filename)
Create a preview for the given file.
Definition: preview.c:16
DllExport void eid_vwr_close_file()
Close the current file.
Definition: oslayer.c:168
Saving data to a file.
Definition: oslayer.h:83
Definition: oslayer.h:23
The callbacks have been defined.
Definition: oslayer.h:76
DllExport const char * eid_vwr_be_get_xmlform()
Get the currently-open data in XML form.
Definition: oslayer.c:147
French.
Definition: oslayer.h:101
Card source. Close should not be allowed, everything else should be.
Definition: oslayer.h:34
size_t imagelen
length of imagedata
Definition: oslayer.h:242
eid_vwr_pinops
Definition: oslayer.h:55
perform a login and return whether the login was successful
Definition: oslayer.h:57
void * eid_vwr_be_mainloop(void *val)
Loop over eid_vwr_poll().
Definition: oslayer.c:78
eid_vwr_result
Definition: oslayer.h:62
The data was determined to be invalid. That is, the card could be read, but signature validation fail...
Definition: oslayer.h:88
eid_vwr_loglevel
Log levels.
Definition: oslayer.h:42
Definition: oslayer.h:49
DllExport int eid_vwr_poll()
Check if there is an event to be handled.
Definition: oslayer.c:87
Unknown. Used as initializer.
Definition: oslayer.h:35
Definition: oslayer.h:51
Reading identity data.
Definition: oslayer.h:80
Dutch.
Definition: oslayer.h:102
change the PIN code of the card
Definition: oslayer.h:58
DllExport void eid_vwr_be_deserialize(const EID_CHAR *source_file)
Open a file.
Definition: oslayer.c:142
Ready to receive a token (eID card)
Definition: oslayer.h:77
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:73
An error occurred while dealing with the card.
Definition: oslayer.h:84
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:75
Definition: oslayer.h:45
eid_vwr_langs
Definition: oslayer.h:96
English.
Definition: oslayer.h:100
We finished parsing the file.
Definition: oslayer.h:87
No language has yet been selected. Used as initializer.
Definition: oslayer.h:98
No source. UI should be cleared.
Definition: oslayer.h:32
int have_data
nonzero if there is actually any data
Definition: oslayer.h:243
DllExport void eid_vwr_convert_set_lang(enum eid_vwr_langs which)
Set the backend language.
Definition: convert.cpp:48
File source. "Print", "Validate" and "Close" operations should be allowed, PIN-related operations are...
Definition: oslayer.h:33
int version
The version number of this struct.
Definition: oslayer.h:135
A token (eID card) has been found.
Definition: oslayer.h:78
We&#39;re reading from the file currently.
Definition: oslayer.h:86
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:65
void * imagedata
JPEG photo of the inspected XML file.
Definition: oslayer.h:241
German.
Definition: oslayer.h:99
eid_vwr_source
Definition: oslayer.h:30
We don&#39;t have a card, and we also don&#39;t have a file.
Definition: oslayer.h:89
operation failed
Definition: oslayer.h:64
Definition: oslayer.h:239
We&#39;re dealing with files.
Definition: oslayer.h:85
EID_CHAR * description
A human-readable name for the reader.
Definition: oslayer.h:26