pEpCOMServerAdapter.idl
author Volker Birk <vb@pep-project.org>
Tue, 05 May 2015 10:27:36 +0200
changeset 18 79c848166413
parent 17 3288634317bb
child 19 3cfb847e13cd
permissions -rw-r--r--
renaming, adding keylist param
vb@0
     1
// pEpCOMServerAdapter.idl : IDL source for pEpCOMServerAdapter
vb@0
     2
//
vb@0
     3
vb@0
     4
// This file will be processed by the MIDL tool to
vb@0
     5
// produce the type library (pEpCOMServerAdapter.tlb) and marshalling code.
vb@0
     6
vb@0
     7
import "oaidl.idl";
vb@0
     8
import "ocidl.idl";
vb@0
     9
vb@15
    10
vb@15
    11
[
vb@15
    12
    object,
vb@15
    13
    uuid(161538F9-53C8-4D9C-8BA4-0FB43AEC7106),
vb@15
    14
    oleautomation,
vb@15
    15
    nonextensible,
vb@15
    16
    pointer_default(unique)
vb@15
    17
]
vb@15
    18
interface ITextMessage : IUnknown {
vb@15
    19
    typedef enum _pEp_text_format {
vb@15
    20
        pEp_text_format_plain = 0,
vb@15
    21
        pEp_text_format_html,
vb@15
    22
        pEp_text_format_other = 0xff
vb@15
    23
    } pEp_text_format;
vb@15
    24
vb@15
    25
    typedef enum _pEp_msg_direction {
vb@15
    26
        pEp_dir_incoming = 0,
vb@15
    27
        pEp_dir_outgoing
vb@15
    28
    } pEp_msg_direction;
vb@15
    29
vb@15
    30
    typedef enum _pEp_MIME_format {
vb@15
    31
        pEp_MIME_none = 0,                      // message is not MIME encoded
vb@15
    32
        pEp_MIME_fields_omitted,                // message content but no fields
vb@15
    33
        pEp_MIME                                // message is fully MIME encoded
vb@15
    34
    } pEp_MIME_format;
vb@15
    35
vb@15
    36
    typedef enum _pEp_enc_format {
vb@15
    37
        pEp_enc_none = 0,                       // message is not encrypted
vb@15
    38
        pEp_enc_pieces,                         // inline PGP + PGP extensions
vb@15
    39
        pEp_enc_S_MIME,                         // RFC5751
vb@15
    40
        pEp_enc_PGP_MIME,                       // RFC3156
vb@15
    41
        pEp_enc_pEp                             // pEp encryption format
vb@15
    42
    } pEp_enc_format;
vb@15
    43
vb@15
    44
    [propget] HRESULT dir([out, retval] pEp_msg_direction *pVal);
vb@15
    45
    [propput] HRESULT dir([in] pEp_msg_direction newVal);
vb@15
    46
vb@15
    47
    [propget] HRESULT id([out, retval] BSTR *pVal);
vb@15
    48
    [propput] HRESULT id([in] BSTR newVal);
vb@15
    49
vb@15
    50
    [propget] HRESULT shortmsg([out, retval] BSTR *pVal);
vb@15
    51
    [propput] HRESULT shortmsg([in] BSTR newVal);
vb@15
    52
vb@15
    53
    [propget] HRESULT longmsg([out, retval] BSTR *pVal);
vb@15
    54
    [propput] HRESULT longmsg([in] BSTR newVal);
vb@15
    55
vb@15
    56
    [propget] HRESULT longmsg_formatted([out, retval] BSTR *pVal);
vb@15
    57
    [propput] HRESULT longmsg_formatted([in] BSTR newVal);
vb@15
    58
vb@15
    59
    HRESULT add_attachment([in] SAFEARRAY(BYTE) data, [in, optional] BSTR mime_type, [in, optional] BSTR filename);
vb@15
    60
    HRESULT has_attachments([out, retval] boolean *result);
vb@15
    61
    HRESULT next_attachment([out] SAFEARRAY(BYTE) * data, [out] BSTR * mime_type, [out] BSTR * filename, [out, retval] boolean *result);
vb@15
    62
vb@15
    63
    [propget] HRESULT sent([out, retval] hyper * result);
vb@15
    64
    [propput] HRESULT sent([in] hyper val);
vb@15
    65
vb@15
    66
    [propget] HRESULT recv([out, retval] hyper * result);
vb@15
    67
    [propput] HRESULT recv([in] hyper val);
vb@15
    68
vb@15
    69
    [propget] HRESULT from([out, retval] struct pEp_identity_s *pVal);
vb@15
    70
    [propput] HRESULT from([in] struct pEp_identity_s *newVal);
vb@15
    71
vb@15
    72
    [propget] HRESULT to([out, retval] SAFEARRAY(struct pEp_identity_s) *pVal);
vb@15
    73
    [propput] HRESULT to([in] SAFEARRAY(struct pEp_identity_s) newVal);
vb@15
    74
vb@15
    75
    [propget] HRESULT recv_by([out, retval] struct pEp_identity_s *pVal);
vb@15
    76
    [propput] HRESULT recv_by([in] struct pEp_identity_s *newVal);
vb@15
    77
vb@15
    78
    [propget] HRESULT cc([out, retval] SAFEARRAY(struct pEp_identity_s) *pVal);
vb@15
    79
    [propput] HRESULT cc([in] SAFEARRAY(struct pEp_identity_s) newVal);
vb@15
    80
vb@15
    81
    [propget] HRESULT bcc([out, retval] SAFEARRAY(struct pEp_identity_s) *pVal);
vb@15
    82
    [propput] HRESULT bcc([in] SAFEARRAY(struct pEp_identity_s) newVal);
vb@15
    83
vb@15
    84
    [propget] HRESULT reply_to([out, retval] SAFEARRAY(struct pEp_identity_s) *pVal);
vb@15
    85
    [propput] HRESULT reply_to([in] SAFEARRAY(struct pEp_identity_s) newVal);
vb@15
    86
vb@15
    87
    [propget] HRESULT references([out, retval] SAFEARRAY(BSTR) *pVal);
vb@15
    88
    [propput] HRESULT references([in] SAFEARRAY(BSTR) newVal);
vb@15
    89
vb@15
    90
    [propget] HRESULT keywords([out, retval] SAFEARRAY(BSTR) *pVal);
vb@15
    91
    [propput] HRESULT keywords([in] SAFEARRAY(BSTR) newVal);
vb@15
    92
vb@15
    93
    [propget] HRESULT comments([out, retval] BSTR *pVal);
vb@15
    94
    [propput] HRESULT comments([in] BSTR newVal);
vb@15
    95
};
vb@5
    96
vb@0
    97
[
vb@0
    98
    object,
vb@0
    99
    uuid(9A9F4422-CF0A-45D7-90CD-1D1B7B2A4540),
vb@0
   100
    oleautomation,
vb@0
   101
    nonextensible,
vb@0
   102
    pointer_default(unique)
vb@0
   103
]
vb@0
   104
interface IpEpEngine : IUnknown {
vb@0
   105
    typedef enum _pEp_STATUS {
vb@0
   106
        pEp_STATUS_OK = 0,
vb@0
   107
vb@0
   108
        pEp_KEY_NOT_FOUND = 0x0201,
vb@0
   109
        pEp_KEY_HAS_AMBIG_NAME = 0x0202,
vb@0
   110
        pEp_GET_KEY_FAILED = 0x0203,
vb@0
   111
vb@0
   112
        pEp_UNENCRYPTED = 0x0400,
vb@0
   113
        pEp_VERIFIED = 0x0401,
vb@0
   114
        pEp_DECRYPTED = 0x0402,
vb@0
   115
        pEp_DECRYPTED_AND_VERIFIED = 0x0403,
vb@0
   116
        pEp_DECRYPT_WRONG_FORMAT = 0x0404,
vb@0
   117
        pEp_DECRYPT_NO_KEY = 0x0405,
vb@0
   118
        pEp_DECRYPT_SIGNATURE_DOES_NOT_MATCH = 0x0406,
vb@0
   119
        pEp_VERIFY_NO_KEY = 0x0407,
vb@0
   120
        pEp_VERIFIED_AND_TRUSTED = 0x0408,
vb@0
   121
vb@0
   122
        pEp_ILLEGAL_VALUE = -4,
vb@0
   123
        pEp_BUFFER_TOO_SMALL = -3,
vb@0
   124
        pEp_OUT_OF_MEMORY = -2,
vb@0
   125
        pEp_UNKNOWN_ERROR = -1
vb@0
   126
    } pEp_STATUS;
vb@0
   127
vb@4
   128
    HRESULT log([in] BSTR title, [in] BSTR entity, [in, defaultvalue("")] BSTR description, [in, defaultvalue("")] BSTR comment);
vb@4
   129
    HRESULT decrypt([in] BSTR ctext, [out] BSTR * ptext, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * decrypt_status);
vb@4
   130
    HRESULT decrypt_b([in] BSTR ctext, [out] SAFEARRAY(BYTE) * ptext, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * decrypt_status);
vb@4
   131
    HRESULT encrypt([in] SAFEARRAY(BSTR) key_list, [in] BSTR ptext, [out] BSTR * ctext, [out, retval] pEp_STATUS * status);
vb@4
   132
    HRESULT encrypt_b([in] SAFEARRAY(BSTR) key_list, [in] SAFEARRAY(BYTE) ptext, [out] BSTR * ctext, [out, retval] pEp_STATUS * status);
vb@4
   133
    HRESULT verify([in] BSTR text, [in] BSTR signature, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * verify_status);
vb@17
   134
    HRESULT trustword([in] LONG value, [in, defaultvalue("en")] BSTR lang, [out, retval] BSTR * word);
vb@17
   135
    HRESULT trustwords([in] BSTR fpr, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] LONG max_words, [out, retval] BSTR * words);
vb@0
   136
vb@0
   137
    typedef enum _pEp_comm_type {
vb@0
   138
        pEp_ct_unknown = 0,
vb@0
   139
vb@0
   140
        // range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
vb@0
   141
vb@0
   142
        pEp_ct_no_encryption = 0x01,                // generic
vb@0
   143
        pEp_ct_no_encrypted_channel = 0x02,
vb@0
   144
        pEp_ct_key_not_found = 0x03,
vb@0
   145
        pEp_ct_key_expired = 0x04,
vb@0
   146
        pEp_ct_key_revoked = 0x05,
vb@0
   147
        pEp_ct_key_b0rken = 0x06,
vb@0
   148
        pEp_ct_my_key_not_included = 0x09,
vb@0
   149
vb@0
   150
        pEp_ct_security_by_obscurity = 0x0a,
vb@0
   151
        pEp_ct_b0rken_crypto = 0x0b,
vb@0
   152
        pEp_ct_key_too_short = 0x0e,
vb@0
   153
vb@0
   154
        pEp_ct_compromized = 0x0f,                  // known compromized connection
vb@0
   155
vb@0
   156
        // range 0x10 to 0x3f: unconfirmed encryption
vb@0
   157
vb@0
   158
        pEp_ct_unconfirmed_encryption = 0x10,       // generic
vb@0
   159
        pEp_ct_OpenPGP_1024_RSA_unconfirmed = 0x11,	// RSA 1024 is weak
vb@0
   160
        pEp_ct_OpenPGP_unconfirmed = 0x3f,          // key at least 2048 bit RSA
vb@0
   161
        // or 1024 bit DSA
vb@0
   162
vb@0
   163
        // range 0x40 to 0x7f: unconfirmed encryption and anonymization
vb@0
   164
vb@0
   165
        pEp_ct_unconfirmed_enc_anon = 0x40,         // generic
vb@0
   166
        pEp_ct_pEp_unconfirmed = 0x7f,
vb@0
   167
vb@0
   168
        pEp_ct_confirmed = 0x80,                    // this bit decides if trust is confirmed
vb@0
   169
vb@0
   170
        // range 0x81 to 0x8f: reserved
vb@0
   171
        // range 0x90 to 0xbf: confirmed encryption
vb@0
   172
vb@0
   173
        pEp_ct_confirmed_encryption = 0x90,         // generic
vb@0
   174
        pEp_ct_OpenPGP_1024_RSA = 0x91, // RSA 1024 is weak
vb@0
   175
        pEp_ct_OpenPGP = 0xbf, // key at least 2048 bit RSA or 1024 bit DSA
vb@0
   176
vb@0
   177
        // range 0xc0 to 0xff: confirmed encryption and anonymization
vb@0
   178
vb@0
   179
        pEp_ct_confirmed_enc_anon = 0xc0,           // generic
vb@0
   180
        pEp_ct_pEp = 0xff
vb@0
   181
    } pEp_comm_type;
vb@0
   182
vb@13
   183
    [uuid(CAAC4CFB-4EE6-4C27-81F7-E5B4E0A46816)] struct pEp_identity_s {
vb@0
   184
        BSTR address;
vb@0
   185
        BSTR fpr;
vb@0
   186
        BSTR user_id;
vb@0
   187
        BSTR username;
vb@0
   188
        pEp_comm_type comm_type;
vb@0
   189
        BSTR lang;
vb@0
   190
    };
vb@0
   191
vb@4
   192
    HRESULT get_identity([in] BSTR address, [out, retval] struct pEp_identity_s * ident);
vb@4
   193
    HRESULT set_identity([in] struct pEp_identity_s * ident);
vb@4
   194
    HRESULT generate_keypair([in] struct pEp_identity_s * ident, [out, retval] BSTR * fpr);
vb@4
   195
    HRESULT delete_keypair([in] BSTR fpr);
vb@4
   196
    HRESULT import_key([in] BSTR key_data);
vb@4
   197
    HRESULT import_key_b([in] SAFEARRAY(BYTE) key_data);
vb@4
   198
    HRESULT export_key([in] BSTR fpr, [out, retval] BSTR * key_data);
vb@4
   199
    HRESULT recv_key([in] BSTR pattern);
vb@4
   200
    HRESULT find_keys([in] BSTR pattern, [out, retval] SAFEARRAY(BSTR) * key_list);
vb@4
   201
    HRESULT send_key([in] BSTR pattern);
vb@0
   202
vb@4
   203
    HRESULT examine_identity([in] struct pEp_identity_s * ident);
vb@4
   204
    HRESULT examine_myself([in] struct pEp_identity_s * myself);
vb@4
   205
    HRESULT myself([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
vb@4
   206
    HRESULT update_identity([in] struct pEp_identity_s *ident, [out, retval] struct pEp_identity_s *result);
vb@8
   207
    HRESULT key_compromized([in] BSTR fpr);
vb@4
   208
vb@15
   209
    // Message API
vb@12
   210
vb@15
   211
    typedef enum _pEp_color {
vb@18
   212
        pEp_rating_undefined = 0,
vb@18
   213
        pEp_rating_unencrypted,
vb@18
   214
        pEp_rating_cannot_decrypt,
vb@18
   215
        pEp_rating_unreliable,
vb@18
   216
        pEp_rating_reliable,
vb@18
   217
        pEp_rating_yellow = pEp_rating_reliable,
vb@18
   218
        pEp_rating_trusted,
vb@18
   219
        pEp_rating_green = pEp_rating_trusted,
vb@18
   220
        pEp_rating_trusted_and_anonymized,
vb@18
   221
        pEp_rating_fully_anonymous,
vb@12
   222
vb@18
   223
        pEp_rating_under_attack = -1,
vb@18
   224
        pEp_rating_red = pEp_rating_under_attack,
vb@18
   225
        pEp_rating_b0rken = -2
vb@15
   226
    } pEp_color;
vb@13
   227
vb@18
   228
    HRESULT encrypt_message([in] ITextMessage *src, [out] ITextMessage ** dst, [in, optional] SAFEARRAY(BSTR) extra);
vb@18
   229
    HRESULT decrypt_message([in] ITextMessage *src, [out] ITextMessage ** dst, [out] SAFEARRAY(BSTR) *keylist);
vb@15
   230
    HRESULT message_color([in] ITextMessage *msg, [out, retval] pEp_color * pVal);
vb@18
   231
    HRESULT identity_color([in] struct pEp_identity_s * ident, [out, retval] pEp_color * pVal);
vb@8
   232
};
vb@4
   233
vb@8
   234
[
vb@0
   235
    uuid(3EC2E1A4-40E8-48E4-A7B0-1876D34F9462),
vb@0
   236
    version(1.0),
vb@0
   237
]
vb@0
   238
library pEpCOMServerAdapterLib
vb@0
   239
{
vb@0
   240
    importlib("stdole2.tlb");
vb@0
   241
    [
vb@0
   242
        uuid(B6BC9B8E-D9E2-4419-A3A4-7B4B58175549)
vb@0
   243
    ]
vb@0
   244
    dispinterface _IpEpEngineEvents
vb@0
   245
    {
vb@0
   246
    properties:
vb@0
   247
    methods:
vb@0
   248
    };
vb@0
   249
    [
vb@0
   250
        uuid(EF1B073D-5058-4E0E-829E-B4D22CA21EA2)
vb@0
   251
    ]
vb@0
   252
    coclass pEpEngine {
vb@0
   253
        [default] interface IpEpEngine;
vb@0
   254
        [default, source] dispinterface _IpEpEngineEvents;
vb@0
   255
    };
vb@8
   256
	[
vb@8
   257
		uuid(844B5363-4EF4-4A39-A030-16452783A6F7)		
vb@8
   258
	]
vb@8
   259
	dispinterface _ITextMessageEvents
vb@8
   260
	{
vb@8
   261
		properties:
vb@8
   262
		methods:
vb@8
   263
	};
vb@8
   264
	[
vb@8
   265
		uuid(B6CC444F-FE14-4DFE-8315-81E4EA16C1CC)		
vb@8
   266
	]
vb@8
   267
	coclass TextMessage
vb@8
   268
	{
vb@8
   269
		[default] interface ITextMessage;
vb@8
   270
		[default, source] dispinterface _ITextMessageEvents;
vb@8
   271
	};
vb@0
   272
};