pEpCOMServerAdapter.idl
branchkeysync
changeset 172 112b0fac353d
parent 171 44bfd5428aa9
child 174 1fa1296363f9
     1.1 --- a/pEpCOMServerAdapter.idl	Mon Oct 03 19:15:35 2016 +0200
     1.2 +++ b/pEpCOMServerAdapter.idl	Mon Oct 03 22:06:35 2016 +0200
     1.3 @@ -7,29 +7,29 @@
     1.4  import "oaidl.idl";
     1.5  import "ocidl.idl";
     1.6  
     1.7 -
     1.8 -typedef enum _sync_handshake_result_s {
     1.9 -	SYNC_HANDSHAKE_CANCEL_S = -1,
    1.10 -	SYNC_HANDSHAKE_ACCEPTED_S = 0,
    1.11 -	SYNC_HANDSHAKE_REJECTED_S = 1
    1.12 -} sync_handshake_result_s;
    1.13 -
    1.14  [
    1.15  	object,
    1.16 -	uuid(3BA1B15B-27EF-433C-B780-0D08F46B0FF3),
    1.17 +	uuid(4DA92647-A858-448E-B01F-BE4DCB8C86A1),
    1.18  	oleautomation,
    1.19  	nonextensible,
    1.20  	pointer_default(unique)
    1.21  ]
    1.22  interface IpEpEngineCallbacks : IUnknown {
    1.23 -	[id(1)] HRESULT MessageToSend([in] struct text_message * msg);
    1.24 -	[id(2)] HRESULT ShowHandshake([in] struct pEp_identity_s * self, [in] struct pEp_identity_s * partner, [out, retval] sync_handshake_result_s * result);
    1.25 +
    1.26 +    typedef [v1_enum] enum SyncHandshakeResult {
    1.27 +	    SyncHandshakeCancel = -1,
    1.28 +	    SyncHandshakeAccepted = 0,
    1.29 +	    SyncHandshakeRejected = 1
    1.30 +    } SyncHandshakeResult;
    1.31 +
    1.32 +	[id(1)] HRESULT MessageToSend([in] struct TextMessage * msg);
    1.33 +	[id(2)] HRESULT ShowHandshake([in] struct pEpIdentity * self, [in] struct pEpIdentity * partner, [out, retval] SyncHandshakeResult * result);
    1.34  };
    1.35  
    1.36  
    1.37  [
    1.38      object,
    1.39 -    uuid(9A9F4422-CF0A-45D7-90CD-1D1B7B2A4540),
    1.40 +    uuid(045E49AF-0975-4876-A53B-8CA5AB28C0F8),
    1.41      oleautomation,
    1.42      nonextensible,
    1.43      pointer_default(unique)
    1.44 @@ -37,202 +37,203 @@
    1.45  interface IpEpEngine : IUnknown {
    1.46      // runtime config of the adapter
    1.47  
    1.48 -    HRESULT verbose_logging([in] VARIANT_BOOL enable);
    1.49 +    HRESULT VerboseLogging([in] VARIANT_BOOL enable);
    1.50  
    1.51      // runtime config of the engine
    1.52  
    1.53 -    HRESULT passive_mode([in] VARIANT_BOOL enable);
    1.54 -    HRESULT unencrypted_subject([in] VARIANT_BOOL enable);
    1.55 +    HRESULT PassiveMode([in] VARIANT_BOOL enable);
    1.56 +    HRESULT UnencryptedSubject([in] VARIANT_BOOL enable);
    1.57  
    1.58      // basic API
    1.59  
    1.60 -    typedef enum _pEp_STATUS {
    1.61 -        pEp_STATUS_OK = 0,
    1.62 +   // // TODO: Remove this enum, it is not needed in the interface, but it currently is still used in the code...
    1.63 +   //typedef [v1_enum] enum pEpStatus {
    1.64 +   //     pEpStatusOK = 0,
    1.65  
    1.66 -        pEp_INIT_CANNOT_LOAD_GPGME = 0x0110,
    1.67 -        pEp_INIT_GPGME_INIT_FAILED = 0x0111,
    1.68 -        pEp_INIT_NO_GPG_HOME = 0x0112,
    1.69 -        pEp_INIT_NETPGP_INIT_FAILED = 0x0113,
    1.70 +   //     pEp_INIT_CANNOT_LOAD_GPGME = 0x0110,
    1.71 +   //     pEp_INIT_GPGME_INIT_FAILED = 0x0111,
    1.72 +   //     pEp_INIT_NO_GPG_HOME = 0x0112,
    1.73 +   //     pEp_INIT_NETPGP_INIT_FAILED = 0x0113,
    1.74  
    1.75 -        pEp_INIT_SQLITE3_WITHOUT_MUTEX = 0x0120,
    1.76 -        pEp_INIT_CANNOT_OPEN_DB = 0x0121,
    1.77 -        pEp_INIT_CANNOT_OPEN_SYSTEM_DB = 0x0122,
    1.78 +   //     pEp_INIT_SQLITE3_WITHOUT_MUTEX = 0x0120,
    1.79 +   //     pEp_INIT_CANNOT_OPEN_DB = 0x0121,
    1.80 +   //     pEp_INIT_CANNOT_OPEN_SYSTEM_DB = 0x0122,
    1.81  
    1.82 -        pEp_KEY_NOT_FOUND = 0x0201,
    1.83 -        pEp_KEY_HAS_AMBIG_NAME = 0x0202,
    1.84 -        pEp_GET_KEY_FAILED = 0x0203,
    1.85 +   //     pEp_KEY_NOT_FOUND = 0x0201,
    1.86 +   //     pEp_KEY_HAS_AMBIG_NAME = 0x0202,
    1.87 +   //     pEp_GET_KEY_FAILED = 0x0203,
    1.88  
    1.89 -        pEp_CANNOT_FIND_IDENTITY = 0x0301,
    1.90 -        pEp_CANNOT_SET_PERSON = 0x0381,
    1.91 -        pEp_CANNOT_SET_PGP_KEYPAIR = 0x0382,
    1.92 -        pEp_CANNOT_SET_IDENTITY = 0x0383,
    1.93 -        pEp_CANNOT_SET_TRUST = 0x0384,
    1.94 +   //     pEp_CANNOT_FIND_IDENTITY = 0x0301,
    1.95 +   //     pEp_CANNOT_SET_PERSON = 0x0381,
    1.96 +   //     pEp_CANNOT_SET_PGP_KEYPAIR = 0x0382,
    1.97 +   //     pEp_CANNOT_SET_IDENTITY = 0x0383,
    1.98 +   //     pEp_CANNOT_SET_TRUST = 0x0384,
    1.99  
   1.100 -        pEp_UNENCRYPTED = 0x0400,
   1.101 -        pEp_VERIFIED = 0x0401,
   1.102 -        pEp_DECRYPTED = 0x0402,
   1.103 -        pEp_DECRYPTED_AND_VERIFIED = 0x0403,
   1.104 -        pEp_DECRYPT_WRONG_FORMAT = 0x0404,
   1.105 -        pEp_DECRYPT_NO_KEY = 0x0405,
   1.106 -        pEp_DECRYPT_SIGNATURE_DOES_NOT_MATCH = 0x0406,
   1.107 -        pEp_VERIFY_NO_KEY = 0x0407,
   1.108 -        pEp_VERIFIED_AND_TRUSTED = 0x0408,
   1.109 -        pEp_CANNOT_DECRYPT_UNKNOWN = 0x04ff,
   1.110 +   //     pEp_UNENCRYPTED = 0x0400,
   1.111 +   //     pEp_VERIFIED = 0x0401,
   1.112 +   //     pEp_DECRYPTED = 0x0402,
   1.113 +   //     pEp_DECRYPTED_AND_VERIFIED = 0x0403,
   1.114 +   //     pEp_DECRYPT_WRONG_FORMAT = 0x0404,
   1.115 +   //     pEp_DECRYPT_NO_KEY = 0x0405,
   1.116 +   //     pEp_DECRYPT_SIGNATURE_DOES_NOT_MATCH = 0x0406,
   1.117 +   //     pEp_VERIFY_NO_KEY = 0x0407,
   1.118 +   //     pEp_VERIFIED_AND_TRUSTED = 0x0408,
   1.119 +   //     pEp_CANNOT_DECRYPT_UNKNOWN = 0x04ff,
   1.120  
   1.121 -        pEp_TRUSTWORD_NOT_FOUND = 0x0501,
   1.122 +   //     pEp_TRUSTWORD_NOT_FOUND = 0x0501,
   1.123  
   1.124 -        pEp_CANNOT_CREATE_KEY = 0x0601,
   1.125 -        pEp_CANNOT_SEND_KEY = 0x0602,
   1.126 +   //     pEp_CANNOT_CREATE_KEY = 0x0601,
   1.127 +   //     pEp_CANNOT_SEND_KEY = 0x0602,
   1.128  
   1.129 -        pEp_PHRASE_NOT_FOUND = 0x0701,
   1.130 +   //     pEp_PHRASE_NOT_FOUND = 0x0701,
   1.131  
   1.132 -        pEp_COMMIT_FAILED = 0xff01,
   1.133 +   //     pEp_COMMIT_FAILED = 0xff01,
   1.134  
   1.135 -        pEp_CANNOT_CREATE_TEMP_FILE = -5,
   1.136 -        pEp_ILLEGAL_VALUE = -4,
   1.137 -        pEp_BUFFER_TOO_SMALL = -3,
   1.138 -        pEp_OUT_OF_MEMORY = -2,
   1.139 -        pEp_UNKNOWN_ERROR = -1
   1.140 -    } pEp_STATUS;
   1.141 +   //     pEp_CANNOT_CREATE_TEMP_FILE = -5,
   1.142 +   //     pEp_ILLEGAL_VALUE = -4,
   1.143 +   //     pEp_BUFFER_TOO_SMALL = -3,
   1.144 +   //     pEp_OUT_OF_MEMORY = -2,
   1.145 +   //     pEp_UNKNOWN_ERROR = -1
   1.146 +   // } pEpStatus;
   1.147  
   1.148 -    HRESULT log([in] BSTR title, [in] BSTR entity, [in, defaultvalue("")] BSTR description, [in, defaultvalue("")] BSTR comment);
   1.149 -    HRESULT decrypt([in] BSTR ctext, [out] BSTR * ptext, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * decrypt_status);
   1.150 -    HRESULT decrypt_b([in] BSTR ctext, [out] SAFEARRAY(BYTE) * ptext, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * decrypt_status);
   1.151 -    HRESULT encrypt([in] SAFEARRAY(BSTR) key_list, [in] BSTR ptext, [out] BSTR * ctext, [out, retval] pEp_STATUS * status);
   1.152 -    HRESULT encrypt_b([in] SAFEARRAY(BSTR) key_list, [in] SAFEARRAY(BYTE) ptext, [out] BSTR * ctext, [out, retval] pEp_STATUS * status);
   1.153 -    HRESULT verify([in] BSTR text, [in] BSTR signature, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * verify_status);
   1.154 -    HRESULT trustword([in] LONG value, [in, defaultvalue("en")] BSTR lang, [out, retval] BSTR * word);
   1.155 -    HRESULT trustwords([in] BSTR fpr, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] LONG max_words, [out, retval] BSTR * words);
   1.156 -    HRESULT get_crashdump_log([in, defaultvalue(0)] LONG maxlines, [out, retval] BSTR * log);
   1.157 -    HRESULT get_engine_version([out, retval] BSTR * engine_version);
   1.158 -    HRESULT get_languagelist([out, retval] BSTR * languages);
   1.159 -    HRESULT get_phrase([in] BSTR lang, [in] LONG phrase_id, [out, retval] BSTR * phrase);
   1.160 +    // HRESULT log([in] BSTR title, [in] BSTR entity, [in, defaultvalue("")] BSTR description, [in, defaultvalue("")] BSTR comment);
   1.161 +    // HRESULT decrypt([in] BSTR ctext, [out] BSTR * ptext, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEpStatus * decrypt_status);
   1.162 +    // HRESULT decrypt_b([in] BSTR ctext, [out] SAFEARRAY(BYTE) * ptext, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEpStatus * decrypt_status);
   1.163 +    // HRESULT encrypt([in] SAFEARRAY(BSTR) key_list, [in] BSTR ptext, [out] BSTR * ctext, [out, retval] pEpStatus * status);
   1.164 +    // HRESULT encrypt_b([in] SAFEARRAY(BSTR) key_list, [in] SAFEARRAY(BYTE) ptext, [out] BSTR * ctext, [out, retval] pEpStatus * status);
   1.165 +    // HRESULT verify([in] BSTR text, [in] BSTR signature, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEpStatus * verify_status);
   1.166 +    // HRESULT trustword([in] LONG value, [in, defaultvalue("en")] BSTR lang, [out, retval] BSTR * word);
   1.167 +    HRESULT TrustWords([in] BSTR fpr, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] LONG max_words, [out, retval] BSTR * words);
   1.168 +    HRESULT GetCrashdumpLog([in, defaultvalue(0)] LONG maxlines, [out, retval] BSTR * log);
   1.169 +    HRESULT GetEngineVersion([out, retval] BSTR * engine_version);
   1.170 +    HRESULT GetLanguagelist([out, retval] BSTR * languages);
   1.171 +    // HRESULT get_phrase([in] BSTR lang, [in] LONG phrase_id, [out, retval] BSTR * phrase);
   1.172  
   1.173 -    typedef enum _pEp_comm_type {
   1.174 -        pEp_ct_unknown = 0,
   1.175 +    typedef [v1_enum] enum pEpComType {
   1.176 +        pEpCtUnknown = 0,
   1.177  
   1.178          // range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
   1.179  
   1.180 -        pEp_ct_no_encryption = 0x01,                // generic
   1.181 -        pEp_ct_no_encrypted_channel = 0x02,
   1.182 -        pEp_ct_key_not_found = 0x03,
   1.183 -        pEp_ct_key_expired = 0x04,
   1.184 -        pEp_ct_key_revoked = 0x05,
   1.185 -        pEp_ct_key_b0rken = 0x06,
   1.186 -        pEp_ct_my_key_not_included = 0x09,
   1.187 +        pEpCtNoEncryption = 0x01,                // generic
   1.188 +        pEpCtNoEncryptedChannel = 0x02,
   1.189 +        pEpCtKeyNotFound = 0x03,
   1.190 +        pEpCtKeyExpired = 0x04,
   1.191 +        pEpCtKeyRevoked = 0x05,
   1.192 +        pEpCtKeyB0rken = 0x06,
   1.193 +        pEpCtMyKeyNotIncluded = 0x09,
   1.194  
   1.195 -        pEp_ct_security_by_obscurity = 0x0a,
   1.196 -        pEp_ct_b0rken_crypto = 0x0b,
   1.197 -        pEp_ct_key_too_short = 0x0c,
   1.198 +        pEpCtSecurityByObscurity = 0x0a,
   1.199 +        pEpCtB0rkenCrypto = 0x0b,
   1.200 +        pEpCtKeyTooShort = 0x0c,
   1.201  
   1.202 -        pEp_ct_compromized = 0x0e,                  // known compromized connection
   1.203 -        pEp_ct_mistrusted = 0x0f,                   // known mistrusted key
   1.204 +        pEpCtCompromised = 0x0e,                  // known compromized connection
   1.205 +        pEpCtMistrusted = 0x0f,                   // known mistrusted key
   1.206  
   1.207          // range 0x10 to 0x3f: unconfirmed encryption
   1.208  
   1.209 -        pEp_ct_unconfirmed_encryption = 0x10,       // generic
   1.210 -        pEp_ct_OpenPGP_weak_unconfirmed = 0x11,     // RSA 1024 is weak
   1.211 +        pEpCtUnconfirmedEncryption = 0x10,       // generic
   1.212 +        pEpCtOpenPGPWeakUnconfirmed = 0x11,     // RSA 1024 is weak
   1.213  
   1.214 -        pEp_ct_to_be_checked = 0x20,                // generic
   1.215 -        pEp_ct_SMIME_unconfirmed = 0x21,
   1.216 -        pEp_ct_CMS_unconfirmed = 0x22,
   1.217 +        pEpCtToBeChecked = 0x20,                // generic
   1.218 +        pEpCtSMIMEUnconfirmed = 0x21,
   1.219 +        pEpCtCMSUnconfirmed = 0x22,
   1.220  
   1.221 -        pEp_ct_strong_but_unconfirmed = 0x30,       // generic
   1.222 -        pEp_ct_OpenPGP_unconfirmed = 0x38,          // key at least 2048 bit RSA or EC
   1.223 -        pEp_ct_OTR_unconfirmed = 0x3a,
   1.224 +        pEpCtStrongButUnconfirmed = 0x30,       // generic
   1.225 +        pEpCtOpenPGPUnconfirmed = 0x38,          // key at least 2048 bit RSA or EC
   1.226 +        pEpCtOTRUnconfirmed = 0x3a,
   1.227  
   1.228          // range 0x40 to 0x7f: unconfirmed encryption and anonymization
   1.229  
   1.230 -        pEp_ct_unconfirmed_enc_anon = 0x40,         // generic
   1.231 -        pEp_ct_pEp_unconfirmed = 0x7f,
   1.232 +        pEpCtUnconfirmedEncAnon = 0x40,         // generic
   1.233 +        pEpCtpEpUnconfirmed = 0x7f,
   1.234  
   1.235 -        pEp_ct_confirmed = 0x80,                    // this bit decides if trust is confirmed
   1.236 +        pEpCtConfirmed = 0x80,                    // this bit decides if trust is confirmed
   1.237  
   1.238          // range 0x81 to 0x8f: reserved
   1.239          // range 0x90 to 0xbf: confirmed encryption
   1.240  
   1.241 -        pEp_ct_confirmed_encryption = 0x90,         // generic
   1.242 -        pEp_ct_OpenPGP_weak = 0x91,                 // RSA 1024 is weak
   1.243 +        pEpCtConfirmedEncryption = 0x90,         // generic
   1.244 +        pEpCtOpenPGPWeak = 0x91,                 // RSA 1024 is weak
   1.245  
   1.246 -        pEp_ct_to_be_checked_confirmed = 0xa0,      //generic
   1.247 -        pEp_ct_SMIME = 0xa1,
   1.248 -        pEp_ct_CMS = 0xa2,
   1.249 +        pEpCtToBeCheckedConfirmed = 0xa0,      //generic
   1.250 +        pEpCtSMIME = 0xa1,
   1.251 +        pEpCtCMS = 0xa2,
   1.252  
   1.253 -        pEp_ct_strong_encryption = 0xb0,            // generic
   1.254 -        pEp_ct_OpenPGP = 0xb8,                      // key at least 2048 bit RSA or EC
   1.255 -        pEp_ct_OTR = 0xba,
   1.256 +        pEpCtStrongEncryption = 0xb0,            // generic
   1.257 +        pEpCtOpenPGP = 0xb8,                      // key at least 2048 bit RSA or EC
   1.258 +        pEpCtOTR = 0xba,
   1.259  
   1.260          // range 0xc0 to 0xff: confirmed encryption and anonymization
   1.261  
   1.262 -        pEp_ct_confirmed_enc_anon = 0xc0,           // generic
   1.263 -        pEp_ct_pEp = 0xff
   1.264 -    } pEp_comm_type;
   1.265 +        pEpCtConfirmedEncAnon = 0xc0,           // generic
   1.266 +        pEpCtpEp = 0xff
   1.267 +    } pEpComType;
   1.268  
   1.269 -    [uuid(0CB90E62-8A6A-4CA0-99D7-481704051FF0)] struct pEp_identity_s {
   1.270 +    [uuid(0CB90E62-8A6A-4CA0-99D7-481704051FF0)] struct pEpIdentity {
   1.271          BSTR address;
   1.272          BSTR fpr;
   1.273          BSTR user_id;
   1.274          BSTR username;
   1.275 -        pEp_comm_type comm_type;
   1.276 +        pEpComType comm_type;
   1.277          BSTR lang;
   1.278      };
   1.279  
   1.280 -    HRESULT get_identity([in] BSTR address, [in] BSTR user_id, [out, retval] struct pEp_identity_s * ident);
   1.281 -    HRESULT set_identity([in] struct pEp_identity_s * ident);
   1.282 -    HRESULT generate_keypair([in] struct pEp_identity_s * ident, [out, retval] BSTR * fpr);
   1.283 -    HRESULT delete_keypair([in] BSTR fpr);
   1.284 -    HRESULT import_key([in] BSTR key_data);
   1.285 -    HRESULT import_key_b([in] SAFEARRAY(BYTE) key_data);
   1.286 -    HRESULT export_key([in] BSTR fpr, [out, retval] BSTR * key_data);
   1.287 -    HRESULT recv_key([in] BSTR pattern);
   1.288 -    HRESULT find_keys([in] BSTR pattern, [out, retval] SAFEARRAY(BSTR) * key_list);
   1.289 -    HRESULT send_key([in] BSTR pattern);
   1.290 +    //HRESULT get_identity([in] BSTR address, [in] BSTR user_id, [out, retval] struct pEpIdentity * ident);
   1.291 +    //HRESULT set_identity([in] struct pEpIdentity * ident);
   1.292 +    //HRESULT generate_keypair([in] struct pEpIdentity * ident, [out, retval] BSTR * fpr);
   1.293 +    //HRESULT delete_keypair([in] BSTR fpr);
   1.294 +    //HRESULT import_key([in] BSTR key_data);
   1.295 +    //HRESULT import_key_b([in] SAFEARRAY(BYTE) key_data);
   1.296 +    //HRESULT export_key([in] BSTR fpr, [out, retval] BSTR * key_data);
   1.297 +    //HRESULT recv_key([in] BSTR pattern);
   1.298 +    //HRESULT find_keys([in] BSTR pattern, [out, retval] SAFEARRAY(BSTR) * key_list);
   1.299 +    //HRESULT send_key([in] BSTR pattern);
   1.300  
   1.301 -    HRESULT start_keyserver_lookup();
   1.302 -    HRESULT stop_keyserver_lookup();
   1.303 +    HRESULT StartKeyserverLookup();
   1.304 +    HRESULT StopKeyserverLookup();
   1.305  
   1.306 -    HRESULT examine_identity([in] struct pEp_identity_s * ident);
   1.307 -    HRESULT myself([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
   1.308 -    HRESULT update_identity([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
   1.309 -    HRESULT key_mistrusted([in] struct pEp_identity_s *ident);
   1.310 -    HRESULT key_reset_trust([in] struct pEp_identity_s *ident);
   1.311 -    HRESULT trust_personal_key([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
   1.312 +    //HRESULT examine_identity([in] struct pEpIdentity * ident);
   1.313 +    HRESULT Myself([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
   1.314 +    HRESULT UpdateIdentity([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
   1.315 +    HRESULT KeyMistrusted([in] struct pEpIdentity *ident);
   1.316 +    HRESULT KeyResetTrust([in] struct pEpIdentity *ident);
   1.317 +    HRESULT TrustPersonalKey([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
   1.318  
   1.319      // Blacklist API
   1.320  
   1.321 -    HRESULT blacklist_add([in] BSTR fpr);
   1.322 -    HRESULT blacklist_delete([in] BSTR fpr);
   1.323 -    HRESULT blacklist_is_listed([in] BSTR fpr, [out, retval] VARIANT_BOOL *listed);
   1.324 -    HRESULT blacklist_retrieve([out, retval] SAFEARRAY(BSTR) *blacklist);
   1.325 +    HRESULT BlacklistAdd([in] BSTR fpr);
   1.326 +    HRESULT BlacklistDelete([in] BSTR fpr);
   1.327 +    HRESULT BlacklistIsListed([in] BSTR fpr, [out, retval] VARIANT_BOOL *listed);
   1.328 +    HRESULT BlacklistRetreive([out, retval] SAFEARRAY(BSTR) *blacklist);
   1.329  
   1.330  	// PGP compatibility functions
   1.331  	HRESULT OpenPGP_list_keyinfo([in] BSTR search_pattern, [out, retval] SAFEARRAY(struct StringPair)* keyinfo_list);
   1.332  
   1.333      // Message API
   1.334  
   1.335 -	typedef enum _pEp_rating {
   1.336 -		pEp_rating_undefined = 0,
   1.337 -		pEp_rating_cannot_decrypt,
   1.338 -		pEp_rating_have_no_key,
   1.339 -		pEp_rating_unencrypted,
   1.340 -		pEp_rating_unencrypted_for_some,
   1.341 -		pEp_rating_unreliable,
   1.342 -		pEp_rating_reliable,
   1.343 -		pEp_rating_trusted,
   1.344 -		pEp_rating_trusted_and_anonymized,
   1.345 -		pEp_rating_fully_anonymous,
   1.346 +	typedef [v1_enum] enum pEpRating {
   1.347 +		pEpRatingUndefined = 0,
   1.348 +		pEpRatingCannotDecrypt,
   1.349 +		pEpRatingHaveNoKey,
   1.350 +		pEpRatingUnencrypted,
   1.351 +		pEpRatingUnencryptedForSome,
   1.352 +		pEpRatingUnreliable,
   1.353 +		pEpRatingReliable,
   1.354 +		pEpRatingTrusted,
   1.355 +		pEpRatingTrustedAndAnonymized,
   1.356 +		pEpRatingFullyAnonymous,
   1.357  
   1.358 -		pEp_rating_mistrust = -1,
   1.359 -		pEp_rating_b0rken = -2,
   1.360 -		pEp_rating_under_attack = -3
   1.361 -	} pEp_rating;
   1.362 +		pEpRatingMistrust = -1,
   1.363 +		pEpRatingB0rken = -2,
   1.364 +		pEpRatingUnderAttack = -3
   1.365 +	} pEpRating;
   1.366  
   1.367 -	typedef enum _pEp_color {
   1.368 -		pEp_color_no_color = 0,
   1.369 -		pEp_color_yellow,
   1.370 -		pEp_color_green,
   1.371 -		pEp_color_red = -1,
   1.372 -	} pEp_color;
   1.373 +	typedef [v1_enum] enum pEpColor {
   1.374 +		pEpColorNoColor = 0,
   1.375 +		pEpColorYellow,
   1.376 +		pEpColorGreen,
   1.377 +		pEpColorRed = -1,
   1.378 +	} pEpColor;
   1.379  
   1.380  	typedef [v1_enum] enum pEpEncryptFlags {
   1.381  		pEpEncryptFlagsNone = 0,
   1.382 @@ -244,84 +245,74 @@
   1.383  		pEpDecryptFlagOwnPrivateKey = 0x1
   1.384  	} pEpDecryptFlags;
   1.385  
   1.386 -    typedef  enum _pEp_msg_direction {
   1.387 -        pEp_dir_incoming = 0,
   1.388 -        pEp_dir_outgoing
   1.389 -    } pEp_msg_direction;
   1.390 +    typedef [v1_enum] enum pEpMsgDirection {
   1.391 +        pEpDirIncoming = 0,
   1.392 +        pEpDirOutgoing
   1.393 +    } pEpMsgDirection;
   1.394  
   1.395 -    typedef  enum _pEp_enc_format {
   1.396 -        pEp_enc_none = 0,                       // message is not encrypted
   1.397 -        pEp_enc_pieces,                         // inline PGP + PGP extensions
   1.398 -        pEp_enc_S_MIME,                         // RFC5751
   1.399 -        pEp_enc_PGP_MIME,                       // RFC3156
   1.400 -        pEp_enc_pEp                             // pEp encryption format
   1.401 -    } pEp_enc_format;
   1.402 +    //typedef  enum _pEp_enc_format {
   1.403 +    //    pEp_enc_none = 0,                       // message is not encrypted
   1.404 +    //    pEp_enc_pieces,                         // inline PGP + PGP extensions
   1.405 +    //    pEp_enc_S_MIME,                         // RFC5751
   1.406 +    //    pEp_enc_PGP_MIME,                       // RFC3156
   1.407 +    //    pEp_enc_pEp                             // pEp encryption format
   1.408 +    //} pEp_enc_format;
   1.409  
   1.410      [uuid(3A8A4F13-3402-4C4C-94AB-598D87869380)] struct StringPair {
   1.411          BSTR name;
   1.412          BSTR value;
   1.413      };
   1.414  
   1.415 -    [uuid(61DA7AD4-192E-4616-8678-B19AEFB45B45)] struct blob {
   1.416 +    [uuid(61DA7AD4-192E-4616-8678-B19AEFB45B45)] struct Blob {
   1.417          SAFEARRAY(BYTE) value;
   1.418          BSTR mime_type;
   1.419          BSTR filename;
   1.420      };
   1.421  
   1.422 -    [uuid(D763A8F3-BA23-4229-A037-1BB7BDC3E0C8)] struct text_message {
   1.423 -        pEp_msg_direction dir;
   1.424 +    [uuid(D763A8F3-BA23-4229-A037-1BB7BDC3E0C8)] struct TextMessage {
   1.425 +        pEpMsgDirection dir;
   1.426          BSTR id;
   1.427          BSTR shortmsg;
   1.428          BSTR longmsg;
   1.429          BSTR longmsg_formatted;
   1.430 -        SAFEARRAY(struct blob) attachments;
   1.431 -        hyper sent;
   1.432 -        hyper recv;
   1.433 -        struct pEp_identity_s from;
   1.434 -        SAFEARRAY(struct pEp_identity_s) to;
   1.435 -        struct pEp_identity_s recv_by;
   1.436 -        SAFEARRAY(struct pEp_identity_s) cc;
   1.437 -        SAFEARRAY(struct pEp_identity_s) bcc;
   1.438 -        SAFEARRAY(struct pEp_identity_s) reply_to;
   1.439 +        SAFEARRAY(struct Blob) attachments;
   1.440 +        hyper sent; // Timestamp: 64 Bit time_t from mktime(), seconds since January 1, 1970, 0:00 UTC.
   1.441 +        hyper recv; // Timestamp: 64 Bit time_t from mktime(), seconds since January 1, 1970, 0:00 UTC.
   1.442 +        struct pEpIdentity from;
   1.443 +        SAFEARRAY(struct pEpIdentity) to;
   1.444 +        struct pEpIdentity recv_by;
   1.445 +        SAFEARRAY(struct pEpIdentity) cc;
   1.446 +        SAFEARRAY(struct pEpIdentity) bcc;
   1.447 +        SAFEARRAY(struct pEpIdentity) reply_to;
   1.448          SAFEARRAY(BSTR) references;
   1.449          SAFEARRAY(BSTR) keywords;
   1.450          BSTR comments;
   1.451          SAFEARRAY(struct StringPair) opt_fields;
   1.452      };
   1.453  
   1.454 -    HRESULT encrypt_message([in] struct text_message *src, [out] struct text_message * dst, [in] SAFEARRAY(BSTR) extra, [in, defaultvalue(pEpEncryptFlagsNone)] pEpEncryptFlags flags);
   1.455 -    HRESULT decrypt_message([in] struct text_message *src, [out] struct text_message * dst, [out] SAFEARRAY(BSTR) *keylist, [out] pEpDecryptFlags* flags, [out, retval] pEp_rating *rating);
   1.456 -    HRESULT outgoing_message_rating([in] struct text_message *msg, [out, retval] pEp_rating * pVal);
   1.457 -    HRESULT identity_rating([in] struct pEp_identity_s * ident, [out, retval] pEp_rating * pVal);
   1.458 -	HRESULT color_from_rating([in] pEp_rating rating, [out, retval] pEp_color* pVal);
   1.459 +    HRESULT EncryptMessage([in] struct TextMessage *src, [out] struct TextMessage * dst, [in] SAFEARRAY(BSTR) extra, [in, defaultvalue(pEpEncryptFlagsNone)] pEpEncryptFlags flags);
   1.460 +    HRESULT DecryptMessage([in] struct TextMessage *src, [out] struct TextMessage * dst, [out] SAFEARRAY(BSTR) *keylist, [out] pEpDecryptFlags* flags, [out, retval] pEpRating *rating);
   1.461 +    HRESULT OutgoingMessageRating([in] struct TextMessage *msg, [out, retval] pEpRating * pVal);
   1.462 +    HRESULT IdentityRating([in] struct pEpIdentity * ident, [out, retval] pEpRating * pVal);
   1.463 +	HRESULT ColorFromRating([in] pEpRating rating, [out, retval] pEpColor* pVal);
   1.464  
   1.465 -	HRESULT register_callbacks([in] IpEpEngineCallbacks* new_callback);
   1.466 +	HRESULT RegisterCallbacks([in] IpEpEngineCallbacks* new_callback);
   1.467  
   1.468 -	HRESULT unregister_callbacks([in] IpEpEngineCallbacks* obsolete_callback);
   1.469 +	HRESULT UnregisterCallbacks([in] IpEpEngineCallbacks* obsolete_callback);
   1.470  };
   1.471  
   1.472  [
   1.473 -    uuid(3EC2E1A4-40E8-48E4-A7B0-1876D34F9462),
   1.474 +    uuid(564A4350-419E-47F1-B0DF-6FCCF0CD0BBC),
   1.475      version(1.0),
   1.476  ]
   1.477  library pEpCOMServerAdapterLib
   1.478  {
   1.479      importlib("stdole2.tlb");
   1.480 +    
   1.481      [
   1.482 -        uuid(B6BC9B8E-D9E2-4419-A3A4-7B4B58175549)
   1.483 -    ]
   1.484 -    dispinterface _IpEpEngineEvents
   1.485 -    {
   1.486 -    properties:
   1.487 -    methods:
   1.488 -		// test code - remove before shipping
   1.489 -		// [id(1)] HRESULT TestEvent([in] LONG test,[in] BSTR testtest);
   1.490 -	};
   1.491 -    [
   1.492 -        uuid(EF1B073D-5058-4E0E-829E-B4D22CA21EA2)
   1.493 +        uuid(5FF6682B-727B-4DFE-A68D-28982874C0C7)
   1.494      ]
   1.495      coclass pEpEngine {
   1.496          [default] interface IpEpEngine;
   1.497 -        [default, source] dispinterface _IpEpEngineEvents;
   1.498      };
   1.499  };