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