pEpCOMServerAdapter.idl
author Edouard Tisserant <edouard@pep-project.org>
Tue, 21 Feb 2017 12:43:43 +0100
changeset 237 589b9cb32b07
parent 232 4c6d44bed519
child 238 0f19cbd5f1cd
permissions -rw-r--r--
Updated SyncHandshakeSignal enum
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
markus@84
    10
[
markus@181
    11
    object,
markus@181
    12
    uuid(4DA92647-A858-448E-B01F-BE4DCB8C86A1),
markus@181
    13
    oleautomation,
markus@181
    14
    nonextensible,
markus@181
    15
    pointer_default(unique)
markus@84
    16
]
markus@84
    17
interface IpEpEngineCallbacks : IUnknown {
markus@232
    18
	typedef [v1_enum] enum SyncHandshakeSignal {
edouard@237
    19
		SyncNotifyUndefined = 0,
edouard@237
    20
		SyncNotifyInitAddOurDevice = 1,
edouard@237
    21
		SyncNotifyInitAddOtherDevice = 2,
edouard@237
    22
		SyncNotifyInitFormGroup = 3,
edouard@237
    23
		SyncNotifyInitMoveOurDevice = 4,
edouard@237
    24
		SyncNotifyTimeout = 5,
edouard@237
    25
		SyncNotifyAcceptedDeviceAdded = 6,
edouard@237
    26
		SyncNotifyAcceptedGroupCreated = 7,
edouard@237
    27
		SyncNotifyAcceptedDeviceMoved = 8
markus@232
    28
	} SyncHandshakeSignal;
markus@172
    29
markus@172
    30
    typedef [v1_enum] enum SyncHandshakeResult {
markus@181
    31
        SyncHandshakeCancel = -1,
markus@181
    32
        SyncHandshakeAccepted = 0,
markus@181
    33
        SyncHandshakeRejected = 1
markus@172
    34
    } SyncHandshakeResult;
markus@172
    35
markus@181
    36
    [id(1)] HRESULT MessageToSend([in] struct TextMessage * msg);
vb@227
    37
    [id(2)] HRESULT NotifyHandshake([in] struct pEpIdentity * self, [in] struct pEpIdentity * partner, [in] SyncHandshakeSignal signal, [out, retval] SyncHandshakeResult * result);
markus@84
    38
};
markus@84
    39
markus@232
    40
[
markus@232
    41
    object,
markus@232
    42
    uuid(64E964B2-880A-4E92-B0B5-66FF4286A3B3),
markus@232
    43
    oleautomation,
markus@232
    44
    nonextensible,
markus@232
    45
    pointer_default(unique)
markus@232
    46
]
markus@232
    47
interface IpEpEngineCallbacks2 : IpEpEngineCallbacks 
markus@232
    48
{
markus@232
    49
    [id(3)] HRESULT NeedFastPolling([in] VARIANT_BOOL enableFastPolling);
markus@232
    50
};
markus@84
    51
vb@0
    52
[
vb@0
    53
    object,
markus@172
    54
    uuid(045E49AF-0975-4876-A53B-8CA5AB28C0F8),
vb@0
    55
    oleautomation,
vb@0
    56
    nonextensible,
vb@0
    57
    pointer_default(unique)
vb@0
    58
]
vb@0
    59
interface IpEpEngine : IUnknown {
markus@177
    60
vb@60
    61
    // runtime config of the adapter
vb@60
    62
markus@172
    63
    HRESULT VerboseLogging([in] VARIANT_BOOL enable);
vb@51
    64
vb@60
    65
    // runtime config of the engine
vb@60
    66
markus@172
    67
    HRESULT PassiveMode([in] VARIANT_BOOL enable);
markus@172
    68
    HRESULT UnencryptedSubject([in] VARIANT_BOOL enable);
vb@60
    69
vb@60
    70
    // basic API
vb@60
    71
Dean@184
    72
    HRESULT ExportKey([in] BSTR fpr, [out, retval] BSTR * keyData);
markus@177
    73
    HRESULT Log([in] BSTR title, [in] BSTR entity, [in, defaultvalue("")] BSTR description, [in, defaultvalue("")] BSTR comment);
Dean@202
    74
    HRESULT Trustwords([in] BSTR fpr, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] LONG maxWords, [out, retval] BSTR * words);
Dean@202
    75
    HRESULT GetTrustwords([in] struct pEpIdentity * id1, [in] struct pEpIdentity * id2, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] VARIANT_BOOL full, [out, retval] BSTR * words);
markus@172
    76
    HRESULT GetCrashdumpLog([in, defaultvalue(0)] LONG maxlines, [out, retval] BSTR * log);
markus@177
    77
    HRESULT GetEngineVersion([out, retval] BSTR * engineVersion);
markus@177
    78
    HRESULT GetLanguageList([out, retval] BSTR * languages);
vb@0
    79
markus@172
    80
    typedef [v1_enum] enum pEpComType {
markus@172
    81
        pEpCtUnknown = 0,
vb@0
    82
vb@0
    83
        // range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
vb@0
    84
markus@172
    85
        pEpCtNoEncryption = 0x01,                // generic
markus@172
    86
        pEpCtNoEncryptedChannel = 0x02,
markus@172
    87
        pEpCtKeyNotFound = 0x03,
markus@172
    88
        pEpCtKeyExpired = 0x04,
markus@172
    89
        pEpCtKeyRevoked = 0x05,
markus@172
    90
        pEpCtKeyB0rken = 0x06,
markus@172
    91
        pEpCtMyKeyNotIncluded = 0x09,
vb@0
    92
markus@172
    93
        pEpCtSecurityByObscurity = 0x0a,
markus@172
    94
        pEpCtB0rkenCrypto = 0x0b,
markus@172
    95
        pEpCtKeyTooShort = 0x0c,
vb@0
    96
Dean@174
    97
        pEpCtCompromised = 0x0e,                 // known compromized connection
Dean@174
    98
        pEpCtMistrusted = 0x0f,                  // known mistrusted key
vb@0
    99
vb@0
   100
        // range 0x10 to 0x3f: unconfirmed encryption
vb@0
   101
markus@172
   102
        pEpCtUnconfirmedEncryption = 0x10,       // generic
Dean@174
   103
        pEpCtOpenPGPWeakUnconfirmed = 0x11,      // RSA 1024 is weak
vb@62
   104
Dean@174
   105
        pEpCtToBeChecked = 0x20,                 // generic
markus@172
   106
        pEpCtSMIMEUnconfirmed = 0x21,
markus@172
   107
        pEpCtCMSUnconfirmed = 0x22,
vb@62
   108
Dean@174
   109
        pEpCtStrongButUnconfirmed = 0x30,        // generic
markus@172
   110
        pEpCtOpenPGPUnconfirmed = 0x38,          // key at least 2048 bit RSA or EC
markus@172
   111
        pEpCtOTRUnconfirmed = 0x3a,
vb@0
   112
vb@0
   113
        // range 0x40 to 0x7f: unconfirmed encryption and anonymization
vb@0
   114
Dean@174
   115
        pEpCtUnconfirmedEncAnon = 0x40,          // generic
markus@172
   116
        pEpCtpEpUnconfirmed = 0x7f,
vb@0
   117
Dean@174
   118
        pEpCtConfirmed = 0x80,                   // this bit decides if trust is confirmed
vb@0
   119
vb@0
   120
        // range 0x81 to 0x8f: reserved
vb@0
   121
        // range 0x90 to 0xbf: confirmed encryption
vb@0
   122
markus@172
   123
        pEpCtConfirmedEncryption = 0x90,         // generic
markus@172
   124
        pEpCtOpenPGPWeak = 0x91,                 // RSA 1024 is weak
vb@62
   125
Dean@174
   126
        pEpCtToBeCheckedConfirmed = 0xa0,        // generic
markus@172
   127
        pEpCtSMIME = 0xa1,
markus@172
   128
        pEpCtCMS = 0xa2,
vb@62
   129
markus@172
   130
        pEpCtStrongEncryption = 0xb0,            // generic
Dean@174
   131
        pEpCtOpenPGP = 0xb8,                     // key at least 2048 bit RSA or EC
markus@172
   132
        pEpCtOTR = 0xba,
vb@0
   133
vb@0
   134
        // range 0xc0 to 0xff: confirmed encryption and anonymization
vb@0
   135
Dean@174
   136
        pEpCtConfirmedEncAnon = 0xc0,            // generic
markus@172
   137
        pEpCtpEp = 0xff
markus@172
   138
    } pEpComType;
vb@0
   139
vb@217
   140
	typedef [v1_enum] enum pEpIdentityFlags {
vb@217
   141
		pEpIdfNone = 0,
vb@217
   142
		pEpIdfNotForSync = 0x0001,
vb@217
   143
		pEpIdfList = 0x0002,
vb@217
   144
		pEpIdfDevicegroup = 0x0100
vb@217
   145
	} pEpIdentityFlags;
vb@217
   146
markus@181
   147
    [uuid(C3A3814E-567F-4D1C-9F44-9B1DA3957A89)] struct pEpIdentity {
markus@180
   148
        BSTR Address;
markus@180
   149
        BSTR Fpr;
markus@180
   150
        BSTR UserId;
markus@180
   151
        BSTR UserName;
markus@180
   152
        pEpComType CommType;
markus@180
   153
        BSTR Lang;
vb@219
   154
		pEpIdentityFlags Flags;
vb@0
   155
    };
markus@181
   156
vb@219
   157
	HRESULT SetIdentityFlags([in] struct pEpIdentity *identity, [in] pEpIdentityFlags flags);
vb@219
   158
	HRESULT UnsetIdentityFlags([in] struct pEpIdentity *identity, [in] pEpIdentityFlags flags);
vb@218
   159
markus@177
   160
    // Keymanagement API
Dean@183
   161
markus@172
   162
    HRESULT StartKeyserverLookup();
markus@172
   163
    HRESULT StopKeyserverLookup();
vb@24
   164
markus@172
   165
    HRESULT Myself([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
markus@172
   166
    HRESULT UpdateIdentity([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
markus@172
   167
    HRESULT KeyMistrusted([in] struct pEpIdentity *ident);
markus@172
   168
    HRESULT KeyResetTrust([in] struct pEpIdentity *ident);
markus@172
   169
    HRESULT TrustPersonalKey([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
vb@219
   170
	HRESULT OwnIdentitiesRetrieve([out, retval] SAFEARRAY(struct pEpIdentity)* own_identities);
vb@4
   171
vb@65
   172
    // Blacklist API
vb@65
   173
markus@172
   174
    HRESULT BlacklistAdd([in] BSTR fpr);
markus@172
   175
    HRESULT BlacklistDelete([in] BSTR fpr);
markus@172
   176
    HRESULT BlacklistIsListed([in] BSTR fpr, [out, retval] VARIANT_BOOL *listed);
Dean@187
   177
    HRESULT BlacklistRetrieve([out, retval] SAFEARRAY(BSTR) *blacklist);
vb@65
   178
markus@181
   179
    // PGP compatibility functions
Dean@174
   180
markus@181
   181
    HRESULT OpenPGPListKeyinfo([in] BSTR searchPattern, [out, retval] SAFEARRAY(struct StringPair)* keyinfoList);
krista@157
   182
vb@15
   183
    // Message API
vb@12
   184
markus@181
   185
    typedef [v1_enum] enum pEpRating {
markus@181
   186
        pEpRatingUndefined = 0,
markus@181
   187
        pEpRatingCannotDecrypt,
markus@181
   188
        pEpRatingHaveNoKey,
markus@181
   189
        pEpRatingUnencrypted,
markus@181
   190
        pEpRatingUnencryptedForSome,
markus@181
   191
        pEpRatingUnreliable,
markus@181
   192
        pEpRatingReliable,
markus@181
   193
        pEpRatingTrusted,
markus@181
   194
        pEpRatingTrustedAndAnonymized,
markus@181
   195
        pEpRatingFullyAnonymous,
markus@166
   196
markus@181
   197
        pEpRatingMistrust = -1,
markus@181
   198
        pEpRatingB0rken = -2,
markus@181
   199
        pEpRatingUnderAttack = -3
markus@181
   200
    } pEpRating;
markus@166
   201
markus@181
   202
    typedef [v1_enum] enum pEpColor {
markus@181
   203
        pEpColorNoColor = 0,
markus@181
   204
        pEpColorYellow,
markus@181
   205
        pEpColorGreen,
markus@181
   206
        pEpColorRed = -1,
markus@181
   207
    } pEpColor;
vb@33
   208
markus@181
   209
    typedef [v1_enum] enum pEpEncryptFlags {
markus@181
   210
        pEpEncryptFlagsNone = 0,
markus@181
   211
        pEpEncryptFlagForceEncryption = 0x1,
markus@181
   212
    } pEpEncryptFlags;
markus@167
   213
markus@181
   214
    typedef [v1_enum] enum pEpDecryptFlags {
markus@181
   215
        pEpDecryptFlagsNone = 0,
Dean@202
   216
        pEpDecryptFlagOwnPrivateKey = 0x1,
edouard@231
   217
        pEpDecryptFlagConsume = 0x2,
edouard@231
   218
        pEpDecryptFlagIgnore = 0x4
markus@181
   219
    } pEpDecryptFlags;
markus@167
   220
markus@172
   221
    typedef [v1_enum] enum pEpMsgDirection {
markus@172
   222
        pEpDirIncoming = 0,
markus@172
   223
        pEpDirOutgoing
markus@172
   224
    } pEpMsgDirection;
vb@33
   225
markus@181
   226
    [uuid(47FB0795-6B64-455C-BB0E-54998CAB8ACB)] struct StringPair {
markus@180
   227
        BSTR Name;
markus@180
   228
        BSTR Value;
vb@33
   229
    };
vb@33
   230
markus@181
   231
    [uuid(634EB7CE-99AA-460D-BDF8-F7CDA7232CA6)] struct Blob {
vb@33
   232
        SAFEARRAY(BYTE) value;
markus@180
   233
        BSTR MimeType;
markus@180
   234
        BSTR Filename;
vb@33
   235
    };
vb@33
   236
markus@181
   237
    [uuid(B6F40887-E761-4A47-B204-A0193EE0284D)] struct TextMessage {
markus@180
   238
        pEpMsgDirection Dir;
markus@180
   239
        BSTR Id;
markus@182
   240
        BSTR ShortMsg;
markus@182
   241
        BSTR LongMsg;
markus@182
   242
        BSTR LongMsgFormatted;
markus@180
   243
        SAFEARRAY(struct Blob) Attachments;
markus@180
   244
        hyper Sent; // Timestamp: 64 Bit time_t from mktime(), seconds since January 1, 1970, 0:00 UTC.
markus@180
   245
        hyper Recv; // Timestamp: 64 Bit time_t from mktime(), seconds since January 1, 1970, 0:00 UTC.
markus@180
   246
        struct pEpIdentity From;
markus@180
   247
        SAFEARRAY(struct pEpIdentity) To;
markus@180
   248
        struct pEpIdentity RecvBy;
markus@180
   249
        SAFEARRAY(struct pEpIdentity) Cc;
markus@180
   250
        SAFEARRAY(struct pEpIdentity) Bcc;
markus@180
   251
        SAFEARRAY(struct pEpIdentity) ReplyTo;
markus@180
   252
        SAFEARRAY(BSTR) References;
markus@180
   253
        SAFEARRAY(BSTR) Keywords;
markus@180
   254
        BSTR Comments;
markus@180
   255
        SAFEARRAY(struct StringPair) OptFields;
vb@33
   256
    };
vb@33
   257
markus@172
   258
    HRESULT EncryptMessage([in] struct TextMessage *src, [out] struct TextMessage * dst, [in] SAFEARRAY(BSTR) extra, [in, defaultvalue(pEpEncryptFlagsNone)] pEpEncryptFlags flags);
markus@172
   259
    HRESULT DecryptMessage([in] struct TextMessage *src, [out] struct TextMessage * dst, [out] SAFEARRAY(BSTR) *keylist, [out] pEpDecryptFlags* flags, [out, retval] pEpRating *rating);
markus@177
   260
markus@172
   261
    HRESULT OutgoingMessageRating([in] struct TextMessage *msg, [out, retval] pEpRating * pVal);
markus@172
   262
    HRESULT IdentityRating([in] struct pEpIdentity * ident, [out, retval] pEpRating * pVal);
markus@181
   263
    HRESULT ColorFromRating([in] pEpRating rating, [out, retval] pEpColor* pVal);
markus@84
   264
markus@177
   265
    // callback / keysync API
markus@181
   266
    HRESULT RegisterCallbacks([in] IpEpEngineCallbacks* newCallback);
markus@188
   267
    HRESULT UnregisterCallbacks();
vb@8
   268
};
vb@4
   269
vb@8
   270
[
markus@232
   271
    object,
markus@232
   272
    uuid(8A042123-D433-4DEA-ADA2-2E5E61A00292),
markus@232
   273
    oleautomation,
markus@232
   274
    nonextensible,
markus@232
   275
    pointer_default(unique)
markus@232
   276
]
markus@232
   277
interface IpEpEngine2 : IpEpEngine
markus@232
   278
{
markus@232
   279
    HRESULT GetMessageTrustwords(
markus@232
   280
        [in] struct TextMessage *msg,
markus@232
   281
        [in] struct pEpIdentity * receivedBy,
markus@232
   282
        [in] SAFEARRAY(BSTR) keylist,
markus@232
   283
        [in, defaultvalue("en")] BSTR lang,
markus@232
   284
        [in, defaultvalue(0)] VARIANT_BOOL full,
markus@232
   285
        [out, retval] BSTR * words
markus@232
   286
    );
markus@232
   287
};
markus@232
   288
markus@232
   289
[
markus@172
   290
    uuid(564A4350-419E-47F1-B0DF-6FCCF0CD0BBC),
vb@0
   291
    version(1.0),
vb@0
   292
]
vb@0
   293
library pEpCOMServerAdapterLib
vb@0
   294
{
vb@0
   295
    importlib("stdole2.tlb");
markus@181
   296
vb@0
   297
    [
markus@172
   298
        uuid(5FF6682B-727B-4DFE-A68D-28982874C0C7)
vb@0
   299
    ]
vb@0
   300
    coclass pEpEngine {
markus@232
   301
        [default] interface IpEpEngine2;
markus@232
   302
        interface IpEpEngine;
markus@232
   303
        interface IpEpEngineCallbacks2;
vb@0
   304
    };
vb@0
   305
};