diff options
author | lloyd <[email protected]> | 2006-05-18 18:33:19 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-05-18 18:33:19 +0000 |
commit | a2c99d3270eb73ef2db5704fc54356c6b75096f8 (patch) | |
tree | ad3d6c4fcc8dd0f403f8105598943616246fe172 /include/ui.h |
Initial checkin1.5.6
Diffstat (limited to 'include/ui.h')
-rw-r--r-- | include/ui.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/include/ui.h b/include/ui.h new file mode 100644 index 000000000..a956518d6 --- /dev/null +++ b/include/ui.h @@ -0,0 +1,63 @@ +/************************************************* +* User Interface Header File * +* (C) 1999-2006 The Botan Project * +*************************************************/ + +#ifndef BOTAN_UI_H__ +#define BOTAN_UI_H__ + +#include <string> + +namespace Botan { + +/************************************************* +* User Interface * +*************************************************/ +class User_Interface + { + public: + enum UI_Result { OK, CANCEL_ACTION }; + + virtual std::string get_passphrase(const std::string&, + const std::string&, + UI_Result&) const; + User_Interface(const std::string& = ""); + virtual ~User_Interface() {} + protected: + const std::string preset_passphrase; + mutable bool first_try; + }; + +namespace UI { + +/************************************************* +* Pulse Function * +*************************************************/ +enum Pulse_Type { + GENERAL_PULSE, + + PIPE_WRITE, + + PRIME_SEARCHING, + PRIME_SIEVING, + PRIME_PASSED_SIEVE, + PRIME_TESTING, + PRIME_FOUND +}; +typedef void (*pulse_func)(Pulse_Type, void*); + +/************************************************* +* Set the UI pulse function * +*************************************************/ +void set_pulse(pulse_func, void* = 0); + +/************************************************* +* Call the UI pulse function * +*************************************************/ +void pulse(Pulse_Type = GENERAL_PULSE); + +} + +} + +#endif |