gwenhywfar
4.6.0beta
|
This module contains the definition of GWEN_GUI. More...
Modules | |
GUI Implementation for the Console |
Macros | |
#define | GWEN_GUI_CHECK_PERIOD 750 |
#define | GWEN_GUI_CPU_TIMEOUT 200 |
#define | GWEN_GUI_DELAY_SECS 2 |
Typedefs | |
typedef struct GWEN_GUI | GWEN_GUI |
Functions | |
GWENHYWFAR_API GWEN_LOGGER_LEVEL | GWEN_Gui_GetMinProgressLogLevel (const GWEN_GUI *gui) |
GWENHYWFAR_API const char * | GWEN_Gui_GetName (void) |
GWENHYWFAR_API GWEN_PASSWD_STORE * | GWEN_Gui_GetPasswdStore (const GWEN_GUI *gui) |
GWENHYWFAR_API void | GWEN_Gui_SetMinProgressLogLevel (GWEN_GUI *gui, GWEN_LOGGER_LEVEL ll) |
GWENHYWFAR_API void | GWEN_Gui_SetPasswdStore (GWEN_GUI *gui, GWEN_PASSWD_STORE *sto) |
Flags For GWEN_Gui_ProgressStart | |
These flags are given to GWEN_Gui_ProgressStart to modify its behaviour. | |
#define | GWEN_GUI_PROGRESS_DELAY 0x00000001 |
#define | GWEN_GUI_PROGRESS_SHOW_LOG 0x00000002 |
#define | GWEN_GUI_PROGRESS_SHOW_ABORT 0x00000004 |
#define | GWEN_GUI_PROGRESS_ALLOW_SUBLEVELS 0x00000008 |
#define | GWEN_GUI_PROGRESS_ALLOW_EMBED 0x00000010 |
#define | GWEN_GUI_PROGRESS_SHOW_PROGRESS 0x00000020 |
#define | GWEN_GUI_PROGRESS_KEEP_OPEN 0x00000040 |
#define | GWEN_GUI_PROGRESS_ALWAYS_SHOW_LOG 0x00000080 |
Flags For GWEN_Gui_InputBox | |
These flags are given to GWEN_Gui_InputBox to modify its behaviour. | |
#define | GWEN_GUI_INPUT_FLAGS_CONFIRM 0x00000001 |
#define | GWEN_GUI_INPUT_FLAGS_SHOW 0x00000002 |
#define | GWEN_GUI_INPUT_FLAGS_NUMERIC 0x00000004 |
#define | GWEN_GUI_INPUT_FLAGS_RETRY 0x00000008 |
#define | GWEN_GUI_INPUT_FLAGS_ALLOW_DEFAULT 0x00000010 |
#define | GWEN_GUI_INPUT_FLAGS_TAN 0x00000020 |
#define | GWEN_GUI_INPUT_FLAGS_OPTICAL 0x00000040 |
#define | GWEN_GUI_INPUT_FLAGS_DIRECT 0x00000080 |
Flags For GWEN_Gui_MessageBox | |
These flags are given to GWEN_Gui_MessageBox to modify its behaviour. You may OR-combine the flags.
A note about confirmation buttons: Gwenhywfar 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 GWEN_GUI_MSG_FLAGS_SEVERITY_DANGEROUS) to avoid data loss. | |
#define | GWEN_GUI_MSG_FLAGS_TYPE_MASK 0x07 |
#define | GWEN_GUI_MSG_FLAGS_TYPE_INFO 0 |
#define | GWEN_GUI_MSG_FLAGS_TYPE_IS_INFO(fl) ((fl & GWEN_GUI_MSG_FLAGS_TYPE_MASK)==GWEN_GUI_MSG_FLAGS_TYPE_INFO) |
#define | GWEN_GUI_MSG_FLAGS_TYPE_WARN 1 |
#define | GWEN_GUI_MSG_FLAGS_TYPE_IS_WARN(fl) ((fl & GWEN_GUI_MSG_FLAGS_TYPE_MASK)==GWEN_GUI_MSG_FLAGS_TYPE_WARN) |
#define | GWEN_GUI_MSG_FLAGS_TYPE_ERROR 2 |
#define | GWEN_GUI_MSG_FLAGS_TYPE_IS_ERROR ((fl & GWEN_GUI_MSG_FLAGS_TYPE_MASK)==GWEN_GUI_MSG_FLAGS_TYPE_ERROR) |
#define | GWEN_GUI_MSG_FLAGS_CONFIRM_B1 (1<<3) |
#define | GWEN_GUI_MSG_FLAGS_CONFIRM_B2 (2<<3) |
#define | GWEN_GUI_MSG_FLAGS_CONFIRM_B3 (3<<3) |
#define | GWEN_GUI_MSG_FLAGS_CONFIRM_BUTTON(fl) (((fl)>>3) & 0x3) |
#define | GWEN_GUI_MSG_FLAGS_SEVERITY_MASK (0x7<<5) |
#define | GWEN_GUI_MSG_FLAGS_SEVERITY_NORMAL (0x0<<5) |
#define | GWEN_GUI_MSG_FLAGS_SEVERITY_IS_NORMAL(fl) |
#define | GWEN_GUI_MSG_FLAGS_SEVERITY_DANGEROUS (0x1<<5) |
#define | GWEN_GUI_MSG_FLAGS_SEVERITY_IS_DANGEROUS(fl) |
Flags For GWEN_Gui_ShowBox | |
#define | GWEN_GUI_SHOWBOX_FLAGS_BEEP 0x00000001 |
Special Progress Values for GWEN_Gui_ProgressAdvance | |
#define | GWEN_GUI_PROGRESS_NONE (0xffffffffUL) |
#define | GWEN_GUI_PROGRESS_ONE (0xfffffffeUL) |
Constructor, Destructor etc | |
GWENHYWFAR_API GWEN_GUI * | GWEN_Gui_new (void) |
GWENHYWFAR_API void | GWEN_Gui_free (GWEN_GUI *gui) |
GWENHYWFAR_API void | GWEN_Gui_Attach (GWEN_GUI *gui) |
GWENHYWFAR_API void | GWEN_Gui_SetGui (GWEN_GUI *gui) |
GWENHYWFAR_API GWEN_GUI * | GWEN_Gui_GetGui (void) |
Character Set | |
All messages and texts can be converted from UTF8 automatically. This needs the name of the destination character set. See output of iconv –list for a list of supported character sets. | |
GWENHYWFAR_API const char * | GWEN_Gui_GetCharSet (const GWEN_GUI *gui) |
GWENHYWFAR_API void | GWEN_Gui_SetCharSet (GWEN_GUI *gui, const char *s) |
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. | |
enum | GWEN_GUI_FILENAME_TYPE { GWEN_Gui_FileNameType_OpenFileName = 0, GWEN_Gui_FileNameType_SaveFileName, GWEN_Gui_FileNameType_OpenDirectory } |
GWENHYWFAR_API int | GWEN_Gui_MessageBox (uint32_t flags, const char *title, const char *text, const char *b1, const char *b2, const char *b3, uint32_t guiid) |
GWENHYWFAR_API void | GWEN_Gui_ShowError (const char *title, const char *text,...) |
GWENHYWFAR_API int | GWEN_Gui_InputBox (uint32_t flags, const char *title, const char *text, char *buffer, int minLen, int maxLen, uint32_t guiid) |
GWENHYWFAR_API uint32_t | GWEN_Gui_ShowBox (uint32_t flags, const char *title, const char *text, uint32_t guiid) |
GWENHYWFAR_API void | GWEN_Gui_HideBox (uint32_t id) |
GWENHYWFAR_API uint32_t | GWEN_Gui_ProgressStart (uint32_t progressFlags, const char *title, const char *text, uint64_t total, uint32_t guiid) |
GWENHYWFAR_API int | GWEN_Gui_ProgressAdvance (uint32_t id, uint32_t progress) |
GWENHYWFAR_API int | GWEN_Gui_ProgressSetTotal (uint32_t id, uint64_t total) |
GWENHYWFAR_API int | GWEN_Gui_ProgressLog (uint32_t id, GWEN_LOGGER_LEVEL level, const char *text) |
GWENHYWFAR_API int | GWEN_Gui_ProgressLog2 (uint32_t id, GWEN_LOGGER_LEVEL level, const char *text,...) |
GWENHYWFAR_API int | GWEN_Gui_ProgressEnd (uint32_t id) |
GWENHYWFAR_API int | GWEN_Gui_Print (const char *docTitle, const char *docType, const char *descr, const char *text, uint32_t guiid) |
GWENHYWFAR_API int | GWEN_Gui_GetPassword (uint32_t flags, const char *token, const char *title, const char *text, char *buffer, int minLen, int maxLen, uint32_t guiid) |
GWENHYWFAR_API int | GWEN_Gui_SetPasswordStatus (const char *token, const char *pin, GWEN_GUI_PASSWORD_STATUS status, uint32_t guiid) |
GWENHYWFAR_API int | GWEN_Gui_LogHook (const char *logDomain, GWEN_LOGGER_LEVEL priority, const char *s) |
GWENHYWFAR_API int | GWEN_Gui_WaitForSockets (GWEN_SOCKET_LIST2 *readSockets, GWEN_SOCKET_LIST2 *writeSockets, uint32_t guiid, int msecs) |
GWENHYWFAR_API int | GWEN_Gui_CheckCert (const GWEN_SSLCERTDESCR *cert, GWEN_SYNCIO *sio, uint32_t guiid) |
GWENHYWFAR_API int | GWEN_Gui_KeyDataFromText_OpenSSL (const char *text, unsigned char *buffer, unsigned int bufLength) |
GWENHYWFAR_API int | GWEN_Gui_ExecDialog (GWEN_DIALOG *dlg, uint32_t guiid) |
GWENHYWFAR_API int | GWEN_Gui_OpenDialog (GWEN_DIALOG *dlg, uint32_t guiid) |
GWENHYWFAR_API int | GWEN_Gui_CloseDialog (GWEN_DIALOG *dlg) |
GWENHYWFAR_API int | GWEN_Gui_RunDialog (GWEN_DIALOG *dlg, int untilEnd) |
GWENHYWFAR_API int | GWEN_Gui_GetFileName (const char *caption, GWEN_GUI_FILENAME_TYPE fnt, uint32_t flags, const char *patterns, GWEN_BUFFER *pathBuffer, uint32_t guiid) |
GWENHYWFAR_API int | GWEN_Gui_GetSyncIo (const char *url, const char *defaultProto, int defaultPort, GWEN_SYNCIO **pSio) |
Flags | |
Functions in this group influence the behaviour of GWEN_GUI implementations. These functions operate on a specific GUI object which applications create. | |
GWENHYWFAR_API uint32_t | GWEN_Gui_GetFlags (const GWEN_GUI *gui) |
GWENHYWFAR_API void | GWEN_Gui_SetFlags (GWEN_GUI *gui, uint32_t fl) |
GWENHYWFAR_API void | GWEN_Gui_AddFlags (GWEN_GUI *gui, uint32_t fl) |
GWENHYWFAR_API void | GWEN_Gui_SubFlags (GWEN_GUI *gui, uint32_t fl) |
#define | GWEN_GUI_FLAGS_NONINTERACTIVE 0x00000001 |
#define | GWEN_GUI_FLAGS_ACCEPTVALIDCERTS 0x00000002 |
#define | GWEN_GUI_FLAGS_REJECTINVALIDCERTS 0x00000004 |
#define | GWEN_GUI_FLAGS_PERMPASSWORDS 0x00000008 |
#define | GWEN_GUI_FLAGS_DIALOGSUPPORTED 0x80000000 |
Password Cache | |
This implementation provides a password cache. This will be consulted upon GWEN_Gui_GetPassword. The implementation of GWEN_Gui_SetPasswordStatus also accesses this password cache. Normally this cache is filled from password files (like those specified via option -P of aqbanking-cli). | |
GWENHYWFAR_API void | GWEN_Gui_SetPasswordDb (GWEN_GUI *gui, GWEN_DB_NODE *dbPasswords, int persistent) |
GWENHYWFAR_API GWEN_DB_NODE * | GWEN_Gui_GetPasswordDb (const GWEN_GUI *gui) |
This module contains the definition of GWEN_GUI.
The concept of this module is to have a single GWEN_GUI object per application which is created at the start of your application. This GWEN_GUI object tells Gwenhywfar (and libraries using the GWEN_GUI-mechanism) how to handle user interaction.
The GWEN_GUI object contains callbacks for message display, user input, progress reports, SSL certificate checking etc.
There are implementations of GWEN_GUI based on console, QT3, QT4 and FOX.
GWEN_GUI uses flags to tell implementations what the caller needs of the GUI implementation.
Callbacks which might create windows when using graphical user interfaces like QT or FOX return GUI IDs (like GWEN_Gui_ProgressStart()). These ids can be used to create window stacks. The implementation can freely choose how to generate those ids. The only fixed definition is that a GUIID of 0 refers to the last opened context (opened by e.g. GWEN_Gui_ProgressStart()).
A simple example of how GWEN_GUI is used:
In this example a progress context is started (with the GUIID stored in the variable pid). Then in this context a message box is opened and finally the progress context is closed.
As seen in the example above the GUI ID returned by GWEN_Gui_ProgressStart() is used as argument GUIID of the function GWEN_Gui_MessageBox(). Effectively this makes the message box appear in the context of the open progress.
An implementation which uses a graphical interface (QT, FOX) will most probably use windows for GWEN_Gui_ProgressStart() and GWEN_Gui_MessageBox(). In such a case the GUI IDs shown above can be used to establish a parental relationship between those windows. In the example above the message box will have the open progress dialog as parent window.
However applications can use additional mechanisms to determine parent windows. QBankManager for example uses its own GWEN_GUI implementation based on QT3. It contains methods for maintaining a stack of parent windows. So whenever QBankManager wants GWEN_GUI user interaction to appear in a special window it calls QGui::pushParentWidget() just before calling Gwenhywfar or AqBanking functions which might need user interaction and QGui::popParentWidget() directly therafter.
This mechanism makes it unnecessary to have multiple GUI objects. In fact using multiple GWEN_GUI objects is strongly discouraged. The implementation should use the GUIID parameter of each callback instead to establish a relationship between multiple windows.
#define GWEN_GUI_CPU_TIMEOUT 200 |
Definition at line 117 of file gui.h.
Referenced by GWEN_Gui_WaitForSockets().
#define GWEN_GUI_DELAY_SECS 2 |
Definition at line 120 of file gui.h.
Referenced by GWEN_Gui_CProgress_Advance(), and GWEN_Gui_Internal_CheckShow().
#define GWEN_GUI_FLAGS_ACCEPTVALIDCERTS 0x00000002 |
GUI automatically accepts valid certs
Definition at line 866 of file gui.h.
Referenced by GWEN_Gui_CGui_CheckCert(), GWEN_Gui_CGui_GetAcceptAllValidCerts(), and GWEN_Gui_CGui_SetAcceptAllValidCerts().
#define GWEN_GUI_FLAGS_DIALOGSUPPORTED 0x80000000 |
GUI implementation supports dialogs (see MOD_GUI_DIALOG)
Definition at line 873 of file gui.h.
Referenced by Cocoa_Gui_new(), FOX16_Gui::FOX16_Gui(), Gtk2_Gui_new(), and QT4_Gui::QT4_Gui().
#define GWEN_GUI_FLAGS_NONINTERACTIVE 0x00000001 |
GUI is non-interactive
Definition at line 864 of file gui.h.
Referenced by GWEN_Gui_CGui_CheckCert(), GWEN_Gui_CGui_GetIsNonInteractive(), GWEN_Gui_CGui_MessageBox(), GWEN_Gui_CGui_SetIsNonInteractive(), GWEN_Gui_CProgress_Advance(), GWEN_Gui_CProgress_End(), GWEN_Gui_CProgress_Log(), GWEN_Gui_Internal_GetPassword(), and test_gui().
#define GWEN_GUI_FLAGS_PERMPASSWORDS 0x00000008 |
GUI uses permanent password storage
Definition at line 870 of file gui.h.
Referenced by GWEN_DlgInput_new(), and GWEN_Gui_SetPasswdStore().
#define GWEN_GUI_FLAGS_REJECTINVALIDCERTS 0x00000004 |
#define GWEN_GUI_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 157 of file gui.h.
Referenced by GWEN_Gui_CGui__input().
#define GWEN_GUI_INPUT_FLAGS_CONFIRM 0x00000001 |
input must be confirmed (e.g. by asking for the same input twice)
Definition at line 148 of file gui.h.
Referenced by GWEN_Crypt_Token_GetPin(), GWEN_DlgInput_CheckInput(), GWEN_DlgInput_new(), GWEN_Gui_CGui_InputBox(), GWEN_Gui_Internal_GetPassword(), and GWEN_PasswordStore_EncryptWriteFile().
#define GWEN_GUI_INPUT_FLAGS_DIRECT 0x00000080 |
The input MUST come via user input, not from some sort of password cache
Definition at line 163 of file gui.h.
Referenced by GWEN_DlgInput_new(), GWEN_Gui_Internal_GetPassword(), GWEN_PasswordStore_EncryptWriteFile(), and GWEN_PasswordStore_ReadDecryptFile().
#define GWEN_GUI_INPUT_FLAGS_NUMERIC 0x00000004 |
numeric input is requested (e.g. for PINs)
Definition at line 152 of file gui.h.
Referenced by GWEN_Crypt_Token_GetPin(), and GWEN_Gui_CGui__input().
#define GWEN_GUI_INPUT_FLAGS_OPTICAL 0x00000040 |
The input contains optical data encapsuled in "$OBEGIN$" and "$OEND$" (this is used by GWEN_Gui_GetPassword)
#define GWEN_GUI_INPUT_FLAGS_RETRY 0x00000008 |
#define GWEN_GUI_INPUT_FLAGS_SHOW 0x00000002 |
input may be shown (otherwise it should be hidden, e.g. for passwords)
Definition at line 150 of file gui.h.
Referenced by GWEN_DlgInput_new(), GWEN_Gui_CGui__input(), and test7().
#define GWEN_GUI_INPUT_FLAGS_TAN 0x00000020 |
The input is a TAN (this is used by GWEN_Gui_GetPassword)
Definition at line 159 of file gui.h.
Referenced by GWEN_DlgInput_new(), and GWEN_Gui_Internal_GetPassword().
#define GWEN_GUI_MSG_FLAGS_CONFIRM_B1 (1<<3) |
button 1 is the confirmation button
Definition at line 236 of file gui.h.
Referenced by GWEN_Crypt_Token_InsertCorrectToken(), GWEN_Crypt_Token_InsertToken(), GWEN_Gui_CGui__input(), GWEN_Gui_CheckCertBuiltIn(), GWEN_Gui_Internal_GetPassword(), and GWEN_Gui_ShowError().
#define GWEN_GUI_MSG_FLAGS_CONFIRM_B2 (2<<3) |
#define GWEN_GUI_MSG_FLAGS_CONFIRM_B3 (3<<3) |
#define GWEN_GUI_MSG_FLAGS_CONFIRM_BUTTON | ( | fl | ) | (((fl)>>3) & 0x3) |
Determine which button is the confirmation button
Definition at line 242 of file gui.h.
Referenced by GWEN_DlgMessage_new(), and GWEN_Gui_CGui_MessageBox().
#define GWEN_GUI_MSG_FLAGS_SEVERITY_DANGEROUS (0x1<<5) |
Message is considered dangerous and thus should be attended to by a humanoid ;-)
Definition at line 274 of file gui.h.
Referenced by GWEN_Crypt_Token_InsertCorrectToken(), GWEN_Crypt_Token_InsertToken(), GWEN_Gui_CGui__input(), GWEN_Gui_CheckCertBuiltIn(), and GWEN_Gui_Internal_GetPassword().
#define GWEN_GUI_MSG_FLAGS_SEVERITY_IS_DANGEROUS | ( | fl | ) |
Definition at line 275 of file gui.h.
Referenced by GWEN_Gui_CGui_MessageBox().
#define GWEN_GUI_MSG_FLAGS_SEVERITY_IS_NORMAL | ( | fl | ) |
#define GWEN_GUI_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 message "Application started" is not that dangerous ;-)
The following example allows to determine whether a message is dangerous:
#define GWEN_GUI_MSG_FLAGS_SEVERITY_NORMAL (0x0<<5) |
Message does not affect security or induce any problem to the system
Definition at line 268 of file gui.h.
Referenced by GWEN_Crypt_Token_InsertToken(), and GWEN_Gui_ShowError().
#define GWEN_GUI_MSG_FLAGS_TYPE_ERROR 2 |
The message is a error message
Definition at line 230 of file gui.h.
Referenced by GWEN_Crypt_Token_InsertCorrectToken(), GWEN_Crypt_Token_InsertToken(), GWEN_Gui_Internal_GetPassword(), and GWEN_Gui_ShowError().
#define GWEN_GUI_MSG_FLAGS_TYPE_INFO 0 |
The message is a simple information.
Definition at line 218 of file gui.h.
Referenced by GWEN_Gui_CGui__input(), and test2().
#define GWEN_GUI_MSG_FLAGS_TYPE_IS_ERROR ((fl & GWEN_GUI_MSG_FLAGS_TYPE_MASK)==GWEN_GUI_MSG_FLAGS_TYPE_ERROR) |
#define GWEN_GUI_MSG_FLAGS_TYPE_IS_INFO | ( | fl | ) | ((fl & GWEN_GUI_MSG_FLAGS_TYPE_MASK)==GWEN_GUI_MSG_FLAGS_TYPE_INFO) |
#define GWEN_GUI_MSG_FLAGS_TYPE_IS_WARN | ( | fl | ) | ((fl & GWEN_GUI_MSG_FLAGS_TYPE_MASK)==GWEN_GUI_MSG_FLAGS_TYPE_WARN) |
#define GWEN_GUI_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:
#define GWEN_GUI_MSG_FLAGS_TYPE_WARN 1 |
The message is a warning
Definition at line 224 of file gui.h.
Referenced by GWEN_Crypt_Token_InsertCorrectToken(), GWEN_Crypt_Token_InsertToken(), and GWEN_Gui_CheckCertBuiltIn().
#define GWEN_GUI_PROGRESS_ALLOW_EMBED 0x00000010 |
Definition at line 133 of file gui.h.
Referenced by GWEN_Crypt_Token_PluginManager_CheckToken(), GWEN_Gui_WaitForSockets(), GWEN_Sar__UnpackArchive(), GWEN_Sar_AddAndDigestFileReg(), GWEN_Sar_CheckArchive(), GWEN_Sar_ExtractAndDigestFileReg(), GWEN_Sar_Sign(), GWEN_Sar_Verify(), GWEN_SyncIo_Http_RecvBody(), and GWEN_SyncIo_Http_RecvBodyToSio().
#define GWEN_GUI_PROGRESS_ALWAYS_SHOW_LOG 0x00000080 |
Definition at line 136 of file gui.h.
Referenced by GWEN_Crypt_Token_PluginManager_CheckToken().
#define GWEN_GUI_PROGRESS_DELAY 0x00000001 |
Definition at line 129 of file gui.h.
Referenced by GWEN_Crypt_Token_PluginManager_CheckToken(), GWEN_Gui_CProgress_new(), GWEN_Gui_Internal_CheckShow(), GWEN_Gui_WaitForSockets(), GWEN_Sar__UnpackArchive(), GWEN_Sar_AddAndDigestFileReg(), GWEN_Sar_CheckArchive(), GWEN_Sar_ExtractAndDigestFileReg(), GWEN_Sar_Sign(), GWEN_Sar_Verify(), GWEN_SyncIo_Http_RecvBody(), GWEN_SyncIo_Http_RecvBodyToSio(), test2(), test3(), test4(), and test6().
#define GWEN_GUI_PROGRESS_KEEP_OPEN 0x00000040 |
Definition at line 135 of file gui.h.
Referenced by GWEN_Gui_Internal_ProgressLog(), GWEN_Gui_ShowProgress(), test2(), test3(), test4(), and test6().
#define GWEN_GUI_PROGRESS_NONE (0xffffffffUL) |
This value is used with GWEN_Gui_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 305 of file gui.h.
Referenced by GWEN_Gui_CProgress_Advance(), and GWEN_Gui_Internal_ProgressAdvance().
#define GWEN_GUI_PROGRESS_ONE (0xfffffffeUL) |
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 313 of file gui.h.
Referenced by GWEN_Gui_CProgress_Advance(), GWEN_Gui_Internal_ProgressAdvance(), GWEN_Sar__UnpackArchive(), GWEN_Sar_CheckArchive(), GWEN_Sar_Sign(), and GWEN_Sar_Verify().
#define GWEN_GUI_PROGRESS_SHOW_ABORT 0x00000004 |
Definition at line 131 of file gui.h.
Referenced by GWEN_Crypt_Token_PluginManager_CheckToken(), GWEN_Gui_WaitForSockets(), GWEN_Sar__UnpackArchive(), GWEN_Sar_AddAndDigestFileReg(), GWEN_Sar_CheckArchive(), GWEN_Sar_ExtractAndDigestFileReg(), GWEN_Sar_Sign(), GWEN_Sar_Verify(), GWEN_SyncIo_Http_RecvBody(), GWEN_SyncIo_Http_RecvBodyToSio(), test2(), test3(), test4(), and test6().
#define GWEN_GUI_PROGRESS_SHOW_LOG 0x00000002 |
Definition at line 130 of file gui.h.
Referenced by GWEN_Crypt_Token_PluginManager_CheckToken(), GWEN_Gui_ShowProgress(), test2(), test3(), test4(), and test6().
#define GWEN_GUI_PROGRESS_SHOW_PROGRESS 0x00000020 |
Definition at line 134 of file gui.h.
Referenced by GWEN_Crypt_Token_PluginManager_CheckToken(), GWEN_Gui_WaitForSockets(), GWEN_Sar__UnpackArchive(), GWEN_Sar_AddAndDigestFileReg(), GWEN_Sar_CheckArchive(), GWEN_Sar_ExtractAndDigestFileReg(), GWEN_Sar_Sign(), GWEN_Sar_Verify(), GWEN_SyncIo_Http_RecvBody(), GWEN_SyncIo_Http_RecvBodyToSio(), and test2().
#define GWEN_GUI_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 290 of file gui.h.
Referenced by GWEN_Crypt_Token_BeginEnterPin().
This status is used for passwords, pins and tans, e.g. by the CryptToken code. It can be used by implementations to mark bad pins, used/unused tans etc.
GWENHYWFAR_API void GWEN_Gui_AddFlags | ( | GWEN_GUI * | gui, |
uint32_t | fl | ||
) |
Definition at line 581 of file gui.c.
Referenced by Cocoa_Gui_new(), FOX16_Gui::FOX16_Gui(), Gtk2_Gui_new(), GWEN_Gui_CGui_SetAcceptAllValidCerts(), GWEN_Gui_CGui_SetIsNonInteractive(), QT4_Gui::QT4_Gui(), and test_gui().
GWENHYWFAR_API void GWEN_Gui_Attach | ( | GWEN_GUI * | gui | ) |
Definition at line 138 of file gui.c.
Referenced by GWEN_Gui_SetGui().
GWENHYWFAR_API int GWEN_Gui_CheckCert | ( | const GWEN_SSLCERTDESCR * | cert, |
GWEN_SYNCIO * | sio, | ||
uint32_t | guiid | ||
) |
This function checks the given certificate. The default implementation just shows the given certificate to the user and asks whether to accept it.
cert | certificate description |
io | IO layer from which the certificate was received |
guiid | id as returned by GWEN_Gui_ProgressStart or GWEN_Gui_ShowBox) |
Definition at line 1056 of file gui.c.
References GWEN_ERROR_NOT_IMPLEMENTED, and gwenhywfar_gui.
Referenced by GWEN_SyncIo_Tls_Connect().
GWENHYWFAR_API int GWEN_Gui_CloseDialog | ( | GWEN_DIALOG * | dlg | ) |
Definition at line 1271 of file gui.c.
References GWEN_ERROR_NOT_IMPLEMENTED, and gwenhywfar_gui.
Referenced by GWEN_Gui_Internal_HideBox(), and GWEN_Gui_Internal_ProgressEnd().
GWENHYWFAR_API int GWEN_Gui_ExecDialog | ( | GWEN_DIALOG * | dlg, |
uint32_t | guiid | ||
) |
This function shows and executes the given dialog and returns the result. See MOD_GUI_DIALOG for a description of the dialog framework.
guiid | id as returned by GWEN_Gui_ProgressStart, GWEN_Gui_ShowBox or as can be found via GWEN_Dialog_GetGuiId()) |
Definition at line 1255 of file gui.c.
References GWEN_ERROR_NOT_IMPLEMENTED, and gwenhywfar_gui.
Referenced by GWEN_Gui_Internal_InputBox(), GWEN_Gui_Internal_MessageBox(), test1(), test10(), test3(), test8(), and test9().
GWENHYWFAR_API void GWEN_Gui_free | ( | GWEN_GUI * | gui | ) |
Definition at line 99 of file gui.c.
References GWEN_DB_Group_free(), GWEN_FREE_OBJECT, GWEN_INHERIT_FINI, GWEN_PasswordStore_free(), and GWEN_StringList_free().
Referenced by GWEN_Gui_SetGui(), test_gui(), and CppGui::~CppGui().
GWENHYWFAR_API const char* GWEN_Gui_GetCharSet | ( | const GWEN_GUI * | gui | ) |
GWENHYWFAR_API int GWEN_Gui_GetFileName | ( | const char * | caption, |
GWEN_GUI_FILENAME_TYPE | fnt, | ||
uint32_t | flags, | ||
const char * | patterns, | ||
GWEN_BUFFER * | pathBuffer, | ||
uint32_t | guiid | ||
) |
This function is used to get the path and name of a single file or folder.
caption | title for the dialog |
fnt | type of the operation (see GWEN_Gui_FileNameType_OpenFileName and following) |
flags | currently reserved, use 0 |
patterns | multiple tab-separated entries like in: "All Files (*)\tC++ Sources (*.cpp,*.cc)\tC++ Headers (*.hpp,*.hh,*.h)" |
pathBuffer | upon call this may contain a preselected path/filename, upon return this will contain the selected name |
Definition at line 1288 of file gui.c.
References GWEN_ERROR_NOT_IMPLEMENTED, and gwenhywfar_gui.
GWENHYWFAR_API uint32_t GWEN_Gui_GetFlags | ( | const GWEN_GUI * | gui | ) |
Definition at line 567 of file gui.c.
Referenced by GWEN_DlgInput_new(), GWEN_Gui_CGui_CheckCert(), GWEN_Gui_CGui_GetAcceptAllValidCerts(), GWEN_Gui_CGui_GetIsNonInteractive(), GWEN_Gui_CGui_InputBox(), GWEN_Gui_CGui_MessageBox(), GWEN_Gui_CProgress_Advance(), GWEN_Gui_CProgress_End(), and GWEN_Gui_CProgress_Log().
GWENHYWFAR_API GWEN_GUI* GWEN_Gui_GetGui | ( | void | ) |
Definition at line 156 of file gui.c.
References gwenhywfar_gui.
Referenced by CppGui::getCppGui(), and GWEN_DlgInput_new().
GWENHYWFAR_API GWEN_LOGGER_LEVEL GWEN_Gui_GetMinProgressLogLevel | ( | const GWEN_GUI * | gui | ) |
GWENHYWFAR_API const char* GWEN_Gui_GetName | ( | void | ) |
Definition at line 603 of file gui.c.
References gwenhywfar_gui, and NULL.
GWENHYWFAR_API GWEN_PASSWD_STORE* GWEN_Gui_GetPasswdStore | ( | const GWEN_GUI * | gui | ) |
GWENHYWFAR_API int GWEN_Gui_GetPassword | ( | uint32_t | flags, |
const char * | token, | ||
const char * | title, | ||
const char * | text, | ||
char * | buffer, | ||
int | minLen, | ||
int | maxLen, | ||
uint32_t | guiid | ||
) |
This function retrieves a password or pin. The implementation might want to use a cache or a password file. The default implementation simply asks the user for input. The function GWEN_Gui_SetPasswordStatus() is used to communicate the status of a password. So if this function here uses a password cache then the callback for GWEN_Gui_SetPasswordStatus() should also be implemented.
flags | flags, see GWEN_GUI_INPUT_FLAGS_CONFIRM ff. |
token | unique identification for the password or pin. This can be used to read the password from a cache or file. |
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 the password (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. |
guiid | id as returned by GWEN_Gui_ProgressStart or GWEN_Gui_ShowBox) |
Definition at line 851 of file gui.c.
References GWEN_ERROR_NOT_IMPLEMENTED, and gwenhywfar_gui.
Referenced by GWEN_Crypt_Token_GetPin(), and test10().
GWENHYWFAR_API GWEN_DB_NODE* GWEN_Gui_GetPasswordDb | ( | const GWEN_GUI * | gui | ) |
Returns a pointer to the internally used password cache. The GUI object remains the owner of the object returned (if any).
Definition at line 661 of file gui.c.
Referenced by GWEN_Gui_CGui_GetPasswordDb().
GWENHYWFAR_API int GWEN_Gui_GetSyncIo | ( | const char * | url, |
const char * | defaultProto, | ||
int | defaultPort, | ||
GWEN_SYNCIO ** | pSio | ||
) |
This function creates a base layer GWEN_SYNCIO. The idea is to allow applications to implement their own PROXY handling.
url | url to which the caller wants to connect to. You should call GWEN_Url_fromString() to get the information required to determine the protocol and destination. |
defaultProto | default protocol name if not specified by the url (e.g. "http", "https", "hbci") |
defaultPort | default port if not specified by the url |
pSio | pointer to a variable to receive the created GWEN_SYNCIO. |
Definition at line 1326 of file gui.c.
References GWEN_ERROR_NOT_IMPLEMENTED, and gwenhywfar_gui.
Referenced by GWEN_HttpSession_Init().
GWENHYWFAR_API void GWEN_Gui_HideBox | ( | uint32_t | id | ) |
Hides a message box previously shown by a call to GWEN_Gui_ShowBox.
This function MUST return immediately (non-blocking).
ab | banking interface |
id | id returned by GWEN_Gui_ShowBox. If 0 then the last message shown is referred to. |
Definition at line 751 of file gui.c.
References gwenhywfar_gui.
Referenced by GWEN_Crypt_Token_EndEnterPin(), and test_gui().
GWENHYWFAR_API int GWEN_Gui_InputBox | ( | uint32_t | flags, |
const char * | title, | ||
const char * | text, | ||
char * | buffer, | ||
int | minLen, | ||
int | maxLen, | ||
uint32_t | guiid | ||
) |
Ask the user for input.
This function is blocking.
flags | flags, see GWEN_GUI_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. |
guiid | id as returned by GWEN_Gui_ProgressStart or GWEN_Gui_ShowBox) |
Definition at line 717 of file gui.c.
References GWEN_ERROR_NOT_IMPLEMENTED, and gwenhywfar_gui.
Referenced by GWEN_Gui_Internal_GetPassword(), GWEN_PasswordStore_EncryptWriteFile(), GWEN_PasswordStore_ReadDecryptFile(), test7(), and test_gui().
GWENHYWFAR_API int GWEN_Gui_KeyDataFromText_OpenSSL | ( | const char * | text, |
unsigned char * | buffer, | ||
unsigned int | bufLength | ||
) |
This function is not officially part of the API but is needed for some ancient OpenHBCI keyfiles. License issues forbid us to link against OpenSSL so we leave it up to the application to implement this function. A converter tool might use this function once to convert an anciant OpenHBCI key file.
text | phrase to generate a key from |
buffer | buffer to write the keydata generated from the given passphrase |
bufLengthr | size of that buffer |
Definition at line 1242 of file gui.c.
References GWEN_ERROR_NOT_IMPLEMENTED, and gwenhywfar_gui.
GWENHYWFAR_API int GWEN_Gui_LogHook | ( | const char * | logDomain, |
GWEN_LOGGER_LEVEL | priority, | ||
const char * | s | ||
) |
This function is called internally by GWEN_Logger_Log. PLEASE NOTE: If you save the information in a file make sure to ignore messages from the log domain "gwenhywfar" with log level debug or higher, because those might contain sensitive information! Information of that level is not supposed to be saved to a file!
logDomain | logdomain of the given log message (e.g. "gwenhywfar") |
priority | priority of the message |
s | string to log |
Definition at line 898 of file gui.c.
References GWEN_LoggerLevel_Debug, and gwenhywfar_gui.
Referenced by GWEN_Logger_Log().
GWENHYWFAR_API int GWEN_Gui_MessageBox | ( | uint32_t | flags, |
const char * | title, | ||
const char * | text, | ||
const char * | b1, | ||
const char * | b2, | ||
const char * | b3, | ||
uint32_t | guiid | ||
) |
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.
flags | flags, see GWEN_GUI_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 |
guiid | id as returned by GWEN_Gui_ProgressStart or GWEN_Gui_ShowBox) |
Definition at line 676 of file gui.c.
References GWEN_ERROR_NOT_IMPLEMENTED, and gwenhywfar_gui.
Referenced by GWEN_Crypt_Token_InsertCorrectToken(), GWEN_Crypt_Token_InsertToken(), GWEN_Gui_CGui__input(), GWEN_Gui_CheckCertBuiltIn(), GWEN_Gui_Internal_GetPassword(), GWEN_Gui_ShowError(), test2(), and test_gui().
GWENHYWFAR_API GWEN_GUI* GWEN_Gui_new | ( | void | ) |
Definition at line 73 of file gui.c.
References GWEN_DB_Group_new(), GWEN_Gui_CheckCertBuiltIn(), GWEN_Gui_Internal_GetPassword(), GWEN_Gui_Internal_GetSyncIo(), GWEN_Gui_Internal_SetPasswordStatus(), GWEN_INHERIT_INIT, GWEN_LoggerLevel_Info, GWEN_NEW_OBJECT, and GWEN_StringList_new().
Referenced by Cocoa_Gui_new(), CppGui::CppGui(), Gtk2_Gui_new(), and GWEN_Gui_CGui_new().
GWENHYWFAR_API int GWEN_Gui_OpenDialog | ( | GWEN_DIALOG * | dlg, |
uint32_t | guiid | ||
) |
Definition at line 1263 of file gui.c.
References GWEN_ERROR_NOT_IMPLEMENTED, and gwenhywfar_gui.
Referenced by GWEN_Gui_Internal_ShowBox(), and GWEN_Gui_ShowProgress().
GWENHYWFAR_API int GWEN_Gui_Print | ( | const char * | docTitle, |
const char * | docType, | ||
const char * | descr, | ||
const char * | text, | ||
uint32_t | guiid | ||
) |
This function makes the application print something.
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). |
guiid | id as returned by GWEN_Gui_ProgressStart or GWEN_Gui_ShowBox) |
Definition at line 834 of file gui.c.
References GWEN_ERROR_NOT_IMPLEMENTED, and gwenhywfar_gui.
GWENHYWFAR_API int GWEN_Gui_ProgressAdvance | ( | uint32_t | id, |
uint32_t | 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).
id | id assigned by GWEN_Gui_ProgressStart (if 0 then the last started progress dialog is referred to) |
progress | new value for progress. A special value is GWEN_GUI_PROGRESS_NONE which means that the progress is unchanged. This might be used as a keepalive call to a GUI. |
Definition at line 775 of file gui.c.
References gwenhywfar_gui.
Referenced by GWEN_Crypt_Token_PluginManager_CheckToken(), GWEN_Gui_WaitForSockets(), GWEN_Sar__UnpackArchive(), GWEN_Sar_AddAndDigestFileReg(), GWEN_Sar_CheckArchive(), GWEN_Sar_ExtractAndDigestFileReg(), GWEN_Sar_Sign(), GWEN_Sar_Verify(), GWEN_SyncIo_Http_RecvBody(), GWEN_SyncIo_Http_RecvBodyToSio(), test2(), test3(), test4(), and test6().
GWENHYWFAR_API int GWEN_Gui_ProgressEnd | ( | uint32_t | 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).
Whether this function is blocking or not depends on the status of the progress dialog and its initial flags. If the dialog needs to stay open for the user to read the log messages etc then this function only needs to return after the user manually closes the dialog.
If there is no reason to keep the dialog open then this function should simply close the dialog window and return immediately.
id | id assigned by GWEN_Gui_ProgressStart (if 0 then the last started progress dialog is referred to) |
Definition at line 826 of file gui.c.
References GWEN_ERROR_NOT_IMPLEMENTED, and gwenhywfar_gui.
Referenced by GWEN_Crypt_Token_PluginManager_CheckToken(), GWEN_Gui_WaitForSockets(), GWEN_Sar__UnpackArchive(), GWEN_Sar_AddAndDigestFileReg(), GWEN_Sar_CheckArchive(), GWEN_Sar_ExtractAndDigestFileReg(), GWEN_Sar_Sign(), GWEN_Sar_Verify(), GWEN_SyncIo_Http_RecvBody(), GWEN_SyncIo_Http_RecvBodyToSio(), test2(), test3(), test4(), and test6().
GWENHYWFAR_API int GWEN_Gui_ProgressLog | ( | uint32_t | id, |
GWEN_LOGGER_LEVEL | level, | ||
const char * | text | ||
) |
Adds a log message to the referred process dialog.
This function MUST return immediately (non-blocking).
id | id assigned by GWEN_Gui_ProgressStart (if 0 then the last started progress dialog is referred to) |
level | log level (see GWEN_Gui_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. |
Definition at line 795 of file gui.c.
References gwenhywfar_gui.
Referenced by GWEN_Crypt_Token_InsertCorrectToken(), GWEN_Crypt_Token_InsertToken(), GWEN_Crypt_Token_PluginManager_CheckToken(), GWEN_Crypt_TokenFile__ActivateKey(), GWEN_Crypt_TokenFile__CloseFile(), GWEN_Crypt_TokenFile__GenerateKey(), GWEN_Crypt_TokenFile__SetKeyInfo(), GWEN_Gui_ProgressLog2(), GWEN_HttpSession_ConnectionTest(), GWEN_HttpSession_RecvPacket(), GWEN_HttpSession_RecvPacketToFile(), GWEN_HttpSession_SendPacket(), GWEN_SyncIo_Http_RecvBody(), GWEN_SyncIo_Http_RecvBodyToSio(), GWEN_SyncIo_Tls_Connect(), GWEN_SyncIo_Tls_GetPeerCert(), test2(), test3(), test4(), and test6().
GWENHYWFAR_API int GWEN_Gui_ProgressLog2 | ( | uint32_t | id, |
GWEN_LOGGER_LEVEL | level, | ||
const char * | text, | ||
... | |||
) |
Adds a log message to the referred process dialog and returns immediately.
This is a convenience function to be used with variable number of arguments (like printf). It uses the given arguments to prepare a buffer which is then handed to GWEN_Gui_ProgressLog.
id | id assigned by GWEN_Gui_ProgressStart (if 0 then the last started progress dialog is referred to) |
level | log level (see GWEN_Gui_LogLevelPanic ff.) |
text | Text of the box (possibly including printf format string characters): UTF-8, with both a normal text and a HTML variant of the text in the same string. See text restrictions note above. |
Definition at line 806 of file gui.c.
References DBG_WARN, GWEN_Gui_ProgressLog(), and GWEN_LOGDOMAIN.
Referenced by GWEN_Crypt_TokenFile__ActivateKey(), GWEN_HttpSession__RecvPacket(), GWEN_HttpSession__RecvPacketToSio(), GWEN_HttpSession_SendPacket(), GWEN_MDigest_CheckFileTree(), GWEN_SyncIo_Http_RecvBody(), GWEN_SyncIo_Http_RecvBodyToSio(), GWEN_SyncIo_Socket_Connect(), GWEN_SyncIo_Tls_Connect(), GWEN_SyncIo_Tls_Disconnect(), GWEN_SyncIo_Tls_Read(), GWEN_SyncIo_Tls_Write(), and test2().
GWENHYWFAR_API int GWEN_Gui_ProgressSetTotal | ( | uint32_t | id, |
uint64_t | total | ||
) |
Definition at line 785 of file gui.c.
References gwenhywfar_gui.
Referenced by GWEN_SyncIo_Http_RecvBody(), and GWEN_SyncIo_Http_RecvBodyToSio().
GWENHYWFAR_API uint32_t GWEN_Gui_ProgressStart | ( | uint32_t | progressFlags, |
const char * | title, | ||
const char * | text, | ||
uint64_t | total, | ||
uint32_t | guiid | ||
) |
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 GWEN_Gui_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 GWEN_Gui_ProgressEnd the user should not be allowed to close the dialog window.
This function MUST return immediately (non-blocking).
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%) |
guiid | id as returned by GWEN_Gui_ProgressStart or GWEN_Gui_ShowBox) |
Definition at line 758 of file gui.c.
References gwenhywfar_gui.
Referenced by GWEN_Crypt_Token_PluginManager_CheckToken(), GWEN_Gui_WaitForSockets(), GWEN_Sar__UnpackArchive(), GWEN_Sar_AddAndDigestFileReg(), GWEN_Sar_CheckArchive(), GWEN_Sar_ExtractAndDigestFileReg(), GWEN_Sar_Sign(), GWEN_Sar_Verify(), GWEN_SyncIo_Http_RecvBody(), GWEN_SyncIo_Http_RecvBodyToSio(), test2(), test3(), test4(), and test6().
GWENHYWFAR_API int GWEN_Gui_RunDialog | ( | GWEN_DIALOG * | dlg, |
int | untilEnd | ||
) |
Definition at line 1279 of file gui.c.
References GWEN_ERROR_NOT_IMPLEMENTED, and gwenhywfar_gui.
Referenced by GWEN_Gui_Internal_ProgressAdvance(), GWEN_Gui_Internal_ProgressEnd(), GWEN_Gui_Internal_ProgressLog(), GWEN_Gui_Internal_ProgressSetTotal(), and GWEN_Gui_ShowProgress().
GWENHYWFAR_API void GWEN_Gui_SetCharSet | ( | GWEN_GUI * | gui, |
const char * | s | ||
) |
GWENHYWFAR_API void GWEN_Gui_SetFlags | ( | GWEN_GUI * | gui, |
uint32_t | fl | ||
) |
GWENHYWFAR_API void GWEN_Gui_SetGui | ( | GWEN_GUI * | gui | ) |
Definition at line 146 of file gui.c.
References GWEN_Gui_Attach(), GWEN_Gui_free(), and gwenhywfar_gui.
Referenced by test1(), test10(), test2(), test3(), test4(), test5(), test6(), test7(), test8(), test9(), and test_gui().
GWENHYWFAR_API void GWEN_Gui_SetMinProgressLogLevel | ( | GWEN_GUI * | gui, |
GWEN_LOGGER_LEVEL | ll | ||
) |
GWENHYWFAR_API void GWEN_Gui_SetPasswdStore | ( | GWEN_GUI * | gui, |
GWEN_PASSWD_STORE * | sto | ||
) |
Definition at line 639 of file gui.c.
References GWEN_GUI_FLAGS_PERMPASSWORDS, and GWEN_PasswordStore_free().
Referenced by CppGui::setPasswordStore().
GWENHYWFAR_API void GWEN_Gui_SetPasswordDb | ( | GWEN_GUI * | gui, |
GWEN_DB_NODE * | dbPasswords, | ||
int | persistent | ||
) |
Set the password DB. Takes over the given DB.
gui | GUI object |
dbPasswords | password cache |
persistent | if !=0 then the passwords come from a password file and a request to clear the password cache will be ignored. |
Definition at line 651 of file gui.c.
References GWEN_DB_Group_free().
Referenced by GWEN_Gui_CGui_SetPasswordDb(), and CppGui::setPasswordDb().
GWENHYWFAR_API int GWEN_Gui_SetPasswordStatus | ( | const char * | token, |
const char * | pin, | ||
GWEN_GUI_PASSWORD_STATUS | status, | ||
uint32_t | guiid | ||
) |
This functions sets the status of a password.
guiid | id as returned by GWEN_Gui_ProgressStart or GWEN_Gui_ShowBox) |
Definition at line 886 of file gui.c.
References GWEN_ERROR_NOT_IMPLEMENTED, and gwenhywfar_gui.
Referenced by GWEN_Crypt_Token_SetPinStatus().
GWENHYWFAR_API uint32_t GWEN_Gui_ShowBox | ( | uint32_t | flags, |
const char * | title, | ||
const char * | text, | ||
uint32_t | guiid | ||
) |
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 GWEN_Gui_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 GWEN_Gui_HideBox.
This function MUST return immediately (non-blocking).
ab | banking interface |
flags | flags, see GWEN_GUI_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. |
guiid | id as returned by GWEN_Gui_ProgressStart or GWEN_Gui_ShowBox) |
Definition at line 736 of file gui.c.
References gwenhywfar_gui.
Referenced by GWEN_Crypt_Token_BeginEnterPin(), and test_gui().
GWENHYWFAR_API void GWEN_Gui_ShowError | ( | const char * | title, |
const char * | text, | ||
... | |||
) |
This is a convenience function which calls GWEN_Gui_MessageBox showing the given message and a single "Close" button. It is especially well suited to show an error message.
Definition at line 694 of file gui.c.
References DBG_WARN, GWEN_Gui_MessageBox(), GWEN_GUI_MSG_FLAGS_CONFIRM_B1, GWEN_GUI_MSG_FLAGS_SEVERITY_NORMAL, GWEN_GUI_MSG_FLAGS_TYPE_ERROR, GWEN_LOGDOMAIN, I18N, and NULL.
GWENHYWFAR_API void GWEN_Gui_SubFlags | ( | GWEN_GUI * | gui, |
uint32_t | fl | ||
) |
Definition at line 588 of file gui.c.
Referenced by GWEN_Gui_CGui_SetAcceptAllValidCerts(), and GWEN_Gui_CGui_SetIsNonInteractive().
GWENHYWFAR_API int GWEN_Gui_WaitForSockets | ( | GWEN_SOCKET_LIST2 * | readSockets, |
GWEN_SOCKET_LIST2 * | writeSockets, | ||
uint32_t | guiid, | ||
int | msecs | ||
) |
This function waits for activity on the given sockets. it is called by GWEN_Io_Manager_Wait(). The default implementation uses GWEN_Socket_Select() for this purpose.
readSockets | list of sockets to wait for to become readable |
writeSockets | list of sockets to wait for to become writeable |
guiid | id as returned by GWEN_Gui_ProgressStart or GWEN_Gui_ShowBox) |
msecs | time in milliseconds to wait for at max |
Definition at line 931 of file gui.c.
References DBG_DEBUG, GWEN_ERROR_TIMEOUT, GWEN_ERROR_USER_ABORTED, GWEN_GUI_CPU_TIMEOUT, GWEN_GUI_PROGRESS_ALLOW_EMBED, GWEN_GUI_PROGRESS_DELAY, GWEN_GUI_PROGRESS_SHOW_ABORT, GWEN_GUI_PROGRESS_SHOW_PROGRESS, GWEN_Gui_ProgressAdvance(), GWEN_Gui_ProgressEnd(), GWEN_Gui_ProgressStart(), GWEN_LOGDOMAIN, GWEN_Socket_Select(), GWEN_SocketSet_AddSocket(), GWEN_SocketSet_free(), GWEN_SocketSet_GetSocketCount(), GWEN_SocketSet_new(), GWEN_TIMEOUT_FOREVER, GWEN_TIMEOUT_NONE, gwenhywfar_gui, I18N, and NULL.
Referenced by GWEN_SyncIo_Socket_Read(), and GWEN_SyncIo_Socket_Write().