monotone

monotone Mtn Source Tree

Root/botan/ui.h

1/*************************************************
2* User Interface Header File *
3* (C) 1999-2005 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_UI_H__
7#define BOTAN_UI_H__
8
9#include <string>
10
11namespace Botan {
12
13/*************************************************
14* User Interface *
15*************************************************/
16class User_Interface
17 {
18 public:
19 enum UI_Result { OK, CANCEL_ACTION };
20
21 virtual std::string get_passphrase(const std::string&,
22 const std::string&,
23 UI_Result&) const;
24 User_Interface(const std::string& = "");
25 virtual ~User_Interface() {}
26 protected:
27 const std::string preset_passphrase;
28 mutable bool first_try;
29 };
30
31namespace UI {
32
33/*************************************************
34* Pulse Function *
35*************************************************/
36enum Pulse_Type {
37 GENERAL_PULSE,
38
39 PIPE_WRITE,
40
41 PRIME_SEARCHING,
42 PRIME_SIEVING,
43 PRIME_PASSED_SIEVE,
44 PRIME_TESTING,
45 PRIME_FOUND
46};
47typedef void (*pulse_func)(Pulse_Type, void*);
48
49/*************************************************
50* Set the UI pulse function *
51*************************************************/
52void set_pulse(pulse_func, void* = 0);
53
54/*************************************************
55* Call the UI pulse function *
56*************************************************/
57void pulse(Pulse_Type = GENERAL_PULSE);
58
59}
60
61}
62
63#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status