2003-01-19 Miguel Coca <mcoca@gnu.org>
[gpgme.git] / gpgme / engine.h
1 /* engine.h -  GPGME engine interface.
2    Copyright (C) 2000 Werner Koch (dd9jn)
3    Copyright (C) 2001, 2002 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 /* Get the path of the engine for PROTOCOL.  */
27 const char *_gpgme_engine_get_path (GpgmeProtocol proto);
28
29 /* Get the version number of the engine for PROTOCOL.  */
30 const char *_gpgme_engine_get_version (GpgmeProtocol proto);
31
32 /* Verify the version requirement for the engine for PROTOCOL.  */
33 const char *_gpgme_engine_get_info (GpgmeProtocol proto);
34
35 GpgmeError _gpgme_engine_new (GpgmeProtocol proto, EngineObject *r_engine);
36 void _gpgme_engine_release (EngineObject engine);
37 void _gpgme_engine_set_status_handler (EngineObject engine,
38                                        GpgmeStatusHandler fnc, void *fnc_value);
39 GpgmeError _gpgme_engine_set_command_handler (EngineObject engine,
40                                               GpgmeCommandHandler fnc,
41                                               void *fnc_value,
42                                               GpgmeData data);
43 GpgmeError _gpgme_engine_set_colon_line_handler (EngineObject engine,
44                                                  GpgmeColonLineHandler fnc,
45                                                  void *fnc_value);
46 void _gpgme_engine_set_verbosity (EngineObject engine, int verbosity);
47 GpgmeError _gpgme_engine_op_decrypt (EngineObject engine, GpgmeData ciph,
48                                      GpgmeData plain);
49 GpgmeError _gpgme_engine_op_delete (EngineObject engine, GpgmeKey key,
50                                     int allow_secret);
51 GpgmeError _gpgme_engine_op_edit (EngineObject engine, GpgmeKey key,
52                                   GpgmeData out, GpgmeCtx ctx /* FIXME */);
53 GpgmeError _gpgme_engine_op_encrypt (EngineObject engine, GpgmeRecipients recp,
54                                      GpgmeData plain, GpgmeData ciph,
55                                      int use_armor);
56 GpgmeError _gpgme_engine_op_encrypt_sign (EngineObject engine,
57                                           GpgmeRecipients recp,
58                                           GpgmeData plain, GpgmeData ciph,
59                                           int use_armor,
60                                           GpgmeCtx ctx /* FIXME */);
61 GpgmeError _gpgme_engine_op_export (EngineObject engine, GpgmeRecipients recp,
62                                     GpgmeData keydata, int use_armor);
63 GpgmeError _gpgme_engine_op_genkey (EngineObject engine, GpgmeData help_data,
64                                     int use_armor, GpgmeData pubkey,
65                                     GpgmeData seckey);
66 GpgmeError _gpgme_engine_op_import (EngineObject engine, GpgmeData keydata);
67 GpgmeError _gpgme_engine_op_keylist (EngineObject engine, const char *pattern,
68                                      int secret_only,
69                                      int keylist_mode);
70 GpgmeError _gpgme_engine_op_keylist_ext (EngineObject engine,
71                                          const char *pattern[],
72                                          int secret_only,
73                                          int reserved,
74                                          int keylist_mode);
75 GpgmeError _gpgme_engine_op_sign (EngineObject engine, GpgmeData in,
76                                   GpgmeData out, GpgmeSigMode mode,
77                                   int use_armor, int use_textmode,
78                                   int include_certs,
79                                   GpgmeCtx ctx /* FIXME */);
80 GpgmeError _gpgme_engine_op_trustlist (EngineObject engine,
81                                        const char *pattern);
82 GpgmeError _gpgme_engine_op_verify (EngineObject engine, GpgmeData sig,
83                                     GpgmeData signed_text, GpgmeData plaintext);
84
85 void _gpgme_engine_set_io_cbs (EngineObject engine,
86                                struct GpgmeIOCbs *io_cbs);
87 void _gpgme_engine_io_event (EngineObject engine,
88                              GpgmeEventIO type, void *type_data);
89
90 #endif /* ENGINE_H */