doc/
[gpgme.git] / gpgme / engine.h
1 /* engine.h -  GPGME engine interface.
2    Copyright (C) 2000 Werner Koch (dd9jn)
3    Copyright (C) 2001, 2002, 2003 g10 Code GmbH
4  
5    This file is part of GPGME.
6  
7    GPGME is free software; you can redistribute it and/or modify it
8    under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11  
12    GPGME is distributed in the hope that it will be useful, but
13    WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15    General Public License for more details.
16  
17    You should have received a copy of the GNU General Public License
18    along with GPGME; if not, write to the Free Software Foundation,
19    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
20
21 #ifndef ENGINE_H
22 #define ENGINE_H
23
24 #include "types.h"
25  
26 GpgmeError _gpgme_engine_new (GpgmeProtocol proto, EngineObject *r_engine);
27 void _gpgme_engine_release (EngineObject engine);
28 void _gpgme_engine_set_status_handler (EngineObject engine,
29                                        GpgmeStatusHandler fnc,
30                                        void *fnc_value);
31 GpgmeError _gpgme_engine_set_command_handler (EngineObject engine,
32                                               GpgmeCommandHandler fnc,
33                                               void *fnc_value,
34                                               GpgmeData data);
35 GpgmeError _gpgme_engine_set_colon_line_handler (EngineObject engine,
36                                                  GpgmeColonLineHandler fnc,
37                                                  void *fnc_value);
38 void _gpgme_engine_set_verbosity (EngineObject engine, int verbosity);
39 GpgmeError _gpgme_engine_op_decrypt (EngineObject engine, GpgmeData ciph,
40                                      GpgmeData plain);
41 GpgmeError _gpgme_engine_op_delete (EngineObject engine, GpgmeKey key,
42                                     int allow_secret);
43 GpgmeError _gpgme_engine_op_edit (EngineObject engine, GpgmeKey key,
44                                   GpgmeData out, GpgmeCtx ctx /* FIXME */);
45 GpgmeError _gpgme_engine_op_encrypt (EngineObject engine, GpgmeRecipients recp,
46                                      GpgmeData plain, GpgmeData ciph,
47                                      int use_armor);
48 GpgmeError _gpgme_engine_op_encrypt_sign (EngineObject engine,
49                                           GpgmeRecipients recp,
50                                           GpgmeData plain, GpgmeData ciph,
51                                           int use_armor,
52                                           GpgmeCtx ctx /* FIXME */);
53 GpgmeError _gpgme_engine_op_export (EngineObject engine, GpgmeRecipients recp,
54                                     GpgmeData keydata, int use_armor);
55 GpgmeError _gpgme_engine_op_genkey (EngineObject engine, GpgmeData help_data,
56                                     int use_armor, GpgmeData pubkey,
57                                     GpgmeData seckey);
58 GpgmeError _gpgme_engine_op_import (EngineObject engine, GpgmeData keydata);
59 GpgmeError _gpgme_engine_op_keylist (EngineObject engine, const char *pattern,
60                                      int secret_only,
61                                      int keylist_mode);
62 GpgmeError _gpgme_engine_op_keylist_ext (EngineObject engine,
63                                          const char *pattern[],
64                                          int secret_only,
65                                          int reserved,
66                                          int keylist_mode);
67 GpgmeError _gpgme_engine_op_sign (EngineObject engine, GpgmeData in,
68                                   GpgmeData out, GpgmeSigMode mode,
69                                   int use_armor, int use_textmode,
70                                   int include_certs,
71                                   GpgmeCtx ctx /* FIXME */);
72 GpgmeError _gpgme_engine_op_trustlist (EngineObject engine,
73                                        const char *pattern);
74 GpgmeError _gpgme_engine_op_verify (EngineObject engine, GpgmeData sig,
75                                     GpgmeData signed_text,
76                                     GpgmeData plaintext);
77
78 void _gpgme_engine_set_io_cbs (EngineObject engine,
79                                struct GpgmeIOCbs *io_cbs);
80 void _gpgme_engine_io_event (EngineObject engine,
81                              GpgmeEventIO type, void *type_data);
82
83 #endif /* ENGINE_H */