Imported Upstream version 1.14.0
[platform/upstream/gpgme.git] / src / context.h
index 69d8d9b..25dfc79 100644 (file)
@@ -3,19 +3,19 @@
    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2010 g10 Code GmbH
 
    This file is part of GPGME.
+
    GPGME is free software; you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as
    published by the Free Software Foundation; either version 2.1 of
    the License, or (at your option) any later version.
-   
+
    GPGME is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.
-   
+
    You should have received a copy of the GNU Lesser General Public
-   License along with this program; if not, see <http://www.gnu.org/licenses/>.
+   License along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #ifndef CONTEXT_H
@@ -38,7 +38,8 @@ typedef enum
     OPDATA_DECRYPT, OPDATA_SIGN, OPDATA_ENCRYPT, OPDATA_PASSPHRASE,
     OPDATA_IMPORT, OPDATA_GENKEY, OPDATA_KEYLIST, OPDATA_EDIT,
     OPDATA_VERIFY, OPDATA_TRUSTLIST, OPDATA_ASSUAN, OPDATA_VFS_MOUNT,
-    OPDATA_PASSWD
+    OPDATA_PASSWD, OPDATA_EXPORT, OPDATA_KEYSIGN, OPDATA_TOFU_POLICY,
+    OPDATA_QUERY_SWDB
   } ctx_op_data_id_t;
 
 
@@ -98,26 +99,81 @@ struct gpgme_context
   /* True if text mode should be used.  */
   unsigned int use_textmode : 1;
 
+  /* True if offline mode should be used.  */
+  unsigned int offline : 1;
+
+  /* True if a status callback shall be called for nearly all status
+   * lines.  */
+  unsigned int full_status : 1;
+
+  /* The Tofu info has a human readable string which is presented to
+   * the user in a directly usable format.  By enabling this flag the
+   * unmodified string, as received form gpg, will be returned.  */
+  unsigned int raw_description : 1;
+
+  /* True if session keys should be exported upon decryption.  */
+  unsigned int export_session_keys : 1;
+
+  /* True if a Pinentry was launched during the last operation.  This
+   * flag is cleared with each operation.  */
+  unsigned int redraw_suggested : 1;
+
+  /* True if the option --include-key-block shall be passed to gpg.  */
+  unsigned int include_key_block : 1;
+
+  /* True if the option --auto-key-import shall be passed to gpg.  */
+  unsigned int auto_key_import : 1;
+
+  /* True if the option --auto-key-retrieve shall be passed to gpg.  */
+  unsigned int auto_key_retrieve : 1;
+
+  /* Do not use the symmtric encryption passphrase cache.  */
+  unsigned int no_symkey_cache : 1;
+
+  /* Pass --ignore-mdc-error to gpg.  Note that this flag is reset
+   * after the operation.  */
+  unsigned int ignore_mdc_error : 1;
+
+  /* Pass --expert to gpg edit key. */
+  unsigned int extended_edit : 1;
+
   /* Flags for keylist mode.  */
   gpgme_keylist_mode_t keylist_mode;
 
+  /* The current pinentry mode.  */
+  gpgme_pinentry_mode_t pinentry_mode;
+
   /* Number of certs to be included.  */
   unsigned int include_certs;
 
-  /* The number of keys in signers.  */
+  /* The actual number of keys in SIGNERS, the allocated size of the
+   * array, and the array with the signing keys.  */
   unsigned int signers_len;
-
-  /* Size of the following array.  */
   unsigned int signers_size;
   gpgme_key_t *signers;
 
   /* The signature notations for this context.  */
   gpgme_sig_notation_t sig_notations;
 
+  /* The sender's addr-spec or NULL.  */
+  char *sender;
+
+  /* The gpg specific override session key or NULL. */
+  char *override_session_key;
+
+  /* The optional request origin.  */
+  char *request_origin;
+
+  /* The optional auto key locate options.  */
+  char *auto_key_locate;
+
   /* The locale for the pinentry.  */
   char *lc_ctype;
   char *lc_messages;
 
+  /* The optional trust-model override.  */
+  char *trust_model;
+
   /* The operation data hooked into the context.  */
   ctx_op_data_t op_data;
 
@@ -129,6 +185,10 @@ struct gpgme_context
   gpgme_progress_cb_t progress_cb;
   void *progress_cb_value;
 
+  /* The user provided status callback and its hook value.  */
+  gpgme_status_cb_t status_cb;
+  void *status_cb_value;
+
   /* A list of file descriptors in active use by the current
      operation.  */
   struct fd_table fdt;