pEpCOMServerAdapter.idl
author Thomas
Thu, 08 Nov 2018 12:21:49 +0100
branchsync
changeset 322 a0d12fc1ca68
parent 295 f55ec2fd694f
child 329 d8e00097b49e
permissions -rw-r--r--
Startup of the dynamic part of the engine
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@240
    18
    typedef [v1_enum] enum SyncHandshakeSignal {
markus@240
    19
        SyncNotifyUndefined = 0,
markus@243
    20
markus@243
    21
        // request show handshake dialog
markus@240
    22
        SyncNotifyInitAddOurDevice = 1,
markus@240
    23
        SyncNotifyInitAddOtherDevice = 2,
markus@240
    24
        SyncNotifyInitFormGroup = 3,
markus@240
    25
        SyncNotifyInitMoveOurDevice = 4,
markus@243
    26
markus@243
    27
        // handshake process timed out
markus@240
    28
        SyncNotifyTimeout = 5,
markus@243
    29
markus@243
    30
        // handshake accepted by user
markus@240
    31
        SyncNotifyAcceptedDeviceAdded = 6,
markus@240
    32
        SyncNotifyAcceptedGroupCreated = 7,
markus@243
    33
        SyncNotifyAcceptedDeviceMoved = 8,
markus@243
    34
markus@243
    35
        // handshake dialog must be closed
markus@243
    36
        SyncNotifyOvertaken = 9,
markus@240
    37
    } SyncHandshakeSignal;
markus@172
    38
markus@172
    39
    typedef [v1_enum] enum SyncHandshakeResult {
markus@181
    40
        SyncHandshakeCancel = -1,
markus@181
    41
        SyncHandshakeAccepted = 0,
markus@181
    42
        SyncHandshakeRejected = 1
markus@172
    43
    } SyncHandshakeResult;
markus@172
    44
markus@181
    45
    [id(1)] HRESULT MessageToSend([in] struct TextMessage * msg);
markus@271
    46
vb@227
    47
    [id(2)] HRESULT NotifyHandshake([in] struct pEpIdentity * self, [in] struct pEpIdentity * partner, [in] SyncHandshakeSignal signal, [out, retval] SyncHandshakeResult * result);
markus@84
    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@271
    63
    [id(1)] HRESULT VerboseLogging([in] VARIANT_BOOL enable);
vb@51
    64
vb@60
    65
    // runtime config of the engine
vb@60
    66
markus@271
    67
    [id(2)] HRESULT PassiveMode([in] VARIANT_BOOL enable);
markus@271
    68
    [id(3)] HRESULT UnencryptedSubject([in] VARIANT_BOOL enable);
vb@60
    69
vb@60
    70
    // basic API
vb@60
    71
markus@271
    72
    [id(4)] HRESULT ExportKey([in] BSTR fpr, [out, retval] BSTR * keyData);
markus@271
    73
    [id(5)] HRESULT Log([in] BSTR title, [in] BSTR entity, [in, defaultvalue("")] BSTR description, [in, defaultvalue("")] BSTR comment);
markus@271
    74
    [id(6)] HRESULT Trustwords([in] BSTR fpr, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] LONG maxWords, [out, retval] BSTR * words);
markus@271
    75
    [id(7)] 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@271
    76
    [id(8)] HRESULT GetCrashdumpLog([in, defaultvalue(0)] LONG maxlines, [out, retval] BSTR * log);
markus@271
    77
    [id(9)] HRESULT GetEngineVersion([out, retval] BSTR * engineVersion);
markus@271
    78
    [id(10)] 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
markus@273
   140
    typedef enum pEpStatus {
markus@273
   141
        pEpStatusOk = 0,
markus@273
   142
markus@273
   143
        pEpInitCannotLoadGpgme = 0x0110,
markus@273
   144
        pEpInitGpgmeInitFailed = 0x0111,
markus@273
   145
        pEpInitNoGpgHome = 0x0112,
markus@273
   146
        pEpInitNetpgpInitFailed = 0x0113,
markus@273
   147
        pEpInitCannotDetermineGpgVersion = 0x0114,
markus@273
   148
        pEpInitUnsupportedGpgVersion = 0x0115,
markus@273
   149
        pEpInitCannotConfigGpgAgent = 0x0116,
markus@273
   150
markus@273
   151
        pEpInitSqlite3WithoutMutex = 0x0120,
markus@273
   152
        pEpInitCannotOpenDb = 0x0121,
markus@273
   153
        pEpInitCannotOpenSystemDb = 0x0122,
markus@273
   154
markus@273
   155
        pEpKeyNotFound = 0x0201,
markus@273
   156
        pEpKeyHasAmbigName = 0x0202,
markus@273
   157
        pEpGetKeyFailed = 0x0203,
markus@273
   158
        pEpCannotExportKey = 0x0204,
markus@273
   159
        pEpCannotEditKey = 0x0205,
markus@273
   160
        pEpKeyUnsuitable = 0x0206,
markus@273
   161
markus@273
   162
        pEpCannotFindIdentity = 0x0301,
markus@273
   163
        pEpCannotSetPerson = 0x0381,
markus@273
   164
        pEpCannotSetPgpKeypair = 0x0382,
markus@273
   165
        pEpCannotSetIdentity = 0x0383,
markus@273
   166
        pEpCannotSetTrust = 0x0384,
markus@273
   167
        pEpKeyBlacklisted = 0x0385,
markus@273
   168
        pEpCannotFindPerson = 0x0386,
markus@273
   169
markus@273
   170
        pEpCannotFindAlias = 0x0391,
markus@273
   171
        pEpCannotSetAlias = 0x0392,
markus@273
   172
markus@273
   173
        pEpUnencrypted = 0x0400,
markus@273
   174
        pEpVerified = 0x0401,
markus@273
   175
        pEpDecrypted = 0x0402,
markus@273
   176
        pEpDecryptedAndVerified = 0x0403,
markus@273
   177
        pEpDecryptWrongFormat = 0x0404,
markus@273
   178
        pEpDecryptNoKey = 0x0405,
markus@273
   179
        pEpDecryptSignatureDoesNotMatch = 0x0406,
markus@273
   180
        pEpVerifyNoKey = 0x0407,
markus@273
   181
        pEpVerifiedAndTrusted = 0x0408,
markus@273
   182
        pEpCannotDecryptUnknown = 0x04ff,
markus@273
   183
markus@273
   184
        pEpTrustwordNotFound = 0x0501,
markus@273
   185
        pEpTrustwordsFprWrongLength = 0x0502,
markus@273
   186
        pEpTrustwordsDuplicateFpr = 0x0503,
markus@273
   187
markus@273
   188
        pEpCannotCreateKey = 0x0601,
markus@273
   189
        pEpCannotSendKey = 0x0602,
markus@273
   190
markus@273
   191
        pEpPhraseNotFound = 0x0701,
markus@273
   192
markus@273
   193
        pEpSendFunctionNotRegistered = 0x0801,
markus@273
   194
        pEpContraintsViolated = 0x0802,
markus@273
   195
        pEpCannotEncode = 0x0803,
markus@273
   196
markus@273
   197
        pEpSyncNoNotifyCallback = 0x0901,
markus@273
   198
        pEpSyncIllegalMessage = 0x0902,
markus@273
   199
        pEpSyncNoInjectCallback = 0x0903,
markus@273
   200
markus@273
   201
        pEpSequenceViolated = 0x0970,
markus@273
   202
        pEpCannotIncreaseSequence = 0x0971,
markus@273
   203
        pEpCannotSetSequenceValue = 0x0972,
markus@273
   204
        pEpOwnSequence = 0x097f,
markus@273
   205
markus@273
   206
        pEpSyncStatemachineError = 0x0980,
markus@273
   207
        pEpSyncNoTrust = 0x0981,
markus@273
   208
        pEpStatemachineInvalidState = 0x0982,
markus@273
   209
        pEpStatemachineInvalidEvent = 0x0983,
markus@273
   210
        pEpStatemachineInvalidCondition = 0x0984,
markus@273
   211
        pEpStatemachineInvalidAction = 0x0985,
markus@273
   212
        pEpStatemachineInhibitedEvent = 0x0986,
markus@273
   213
markus@273
   214
        pEpCommitFailed = 0xff01,
markus@273
   215
        pEpMessageConsume = 0xff02,
markus@273
   216
        pEpMessageIgnore = 0xff03,
markus@273
   217
markus@273
   218
        pEpRecordNotFound = -6,
markus@273
   219
        pEpCannotCreateTempFile = -5,
markus@273
   220
        pEpIllegalValue = -4,
markus@273
   221
        pEpBufferTooSmall = -3,
markus@273
   222
        pEpOutOfMemory = -2,
markus@273
   223
        pEpUnknownError = -1,
markus@273
   224
markus@273
   225
        pEpVersionMismatch = -7,
markus@273
   226
    } pEpStatus;
markus@273
   227
markus@240
   228
    typedef [v1_enum] enum pEpIdentityFlags {
markus@240
   229
        pEpIdfNone = 0,
markus@240
   230
        pEpIdfNotForSync = 0x0001,
markus@240
   231
        pEpIdfList = 0x0002,
markus@240
   232
        pEpIdfDevicegroup = 0x0100
markus@240
   233
    } pEpIdentityFlags;
vb@217
   234
markus@181
   235
    [uuid(C3A3814E-567F-4D1C-9F44-9B1DA3957A89)] struct pEpIdentity {
markus@180
   236
        BSTR Address;
markus@180
   237
        BSTR Fpr;
markus@180
   238
        BSTR UserId;
markus@180
   239
        BSTR UserName;
markus@180
   240
        pEpComType CommType;
markus@180
   241
        BSTR Lang;
markus@240
   242
        pEpIdentityFlags Flags;
vb@0
   243
    };
markus@181
   244
markus@271
   245
    [id(11)] HRESULT SetIdentityFlags([in] struct pEpIdentity *identity, [in] pEpIdentityFlags flags);
markus@271
   246
    [id(12)] HRESULT UnsetIdentityFlags([in] struct pEpIdentity *identity, [in] pEpIdentityFlags flags);
vb@218
   247
markus@177
   248
    // Keymanagement API
Dean@183
   249
markus@271
   250
    [id(13)] HRESULT StartKeyserverLookup();
markus@271
   251
    [id(14)] HRESULT StopKeyserverLookup();
vb@24
   252
markus@271
   253
    [id(15)] HRESULT Myself([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
markus@271
   254
    [id(16)] HRESULT UpdateIdentity([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
markus@271
   255
    [id(17)] HRESULT KeyMistrusted([in] struct pEpIdentity *ident);
markus@271
   256
    [id(18)] HRESULT KeyResetTrust([in] struct pEpIdentity *ident);
markus@271
   257
    [id(19)] HRESULT TrustPersonalKey([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
markus@271
   258
    [id(20)] HRESULT OwnIdentitiesRetrieve([out, retval] SAFEARRAY(struct pEpIdentity)* ownIdentities);
vb@295
   259
    // [id(21)] HRESULT UndoLastMistrust(); NOT IMPLEMENTED ANY MORE - USE KeyResetTrust() instead
vb@295
   260
    [id(22)] HRESULT IspEpUser([in] struct pEpIdentity *ident, [out, retval] VARIANT_BOOL *ispEp);
vb@4
   261
vb@65
   262
    // Blacklist API
vb@65
   263
markus@274
   264
    [id(23)] HRESULT BlacklistAdd([in] BSTR fpr);
markus@274
   265
    [id(24)] HRESULT BlacklistDelete([in] BSTR fpr);
markus@274
   266
    [id(25)] HRESULT BlacklistIsListed([in] BSTR fpr, [out, retval] VARIANT_BOOL *listed);
markus@274
   267
    [id(26)] HRESULT BlacklistRetrieve([out, retval] SAFEARRAY(BSTR) *blacklist);
vb@65
   268
markus@181
   269
    // PGP compatibility functions
Dean@174
   270
markus@274
   271
    [id(27)] HRESULT OpenPGPListKeyinfo([in] BSTR searchPattern, [out, retval] SAFEARRAY(struct StringPair)* keyinfoList);
krista@157
   272
vb@15
   273
    // Message API
vb@12
   274
markus@181
   275
    typedef [v1_enum] enum pEpRating {
markus@181
   276
        pEpRatingUndefined = 0,
markus@181
   277
        pEpRatingCannotDecrypt,
markus@181
   278
        pEpRatingHaveNoKey,
markus@181
   279
        pEpRatingUnencrypted,
markus@181
   280
        pEpRatingUnencryptedForSome,
markus@181
   281
        pEpRatingUnreliable,
markus@181
   282
        pEpRatingReliable,
markus@181
   283
        pEpRatingTrusted,
markus@181
   284
        pEpRatingTrustedAndAnonymized,
markus@181
   285
        pEpRatingFullyAnonymous,
markus@166
   286
markus@181
   287
        pEpRatingMistrust = -1,
markus@181
   288
        pEpRatingB0rken = -2,
markus@181
   289
        pEpRatingUnderAttack = -3
markus@181
   290
    } pEpRating;
markus@166
   291
markus@181
   292
    typedef [v1_enum] enum pEpColor {
markus@181
   293
        pEpColorNoColor = 0,
markus@181
   294
        pEpColorYellow,
markus@181
   295
        pEpColorGreen,
markus@181
   296
        pEpColorRed = -1,
markus@181
   297
    } pEpColor;
vb@33
   298
markus@181
   299
    typedef [v1_enum] enum pEpEncryptFlags {
markus@242
   300
        pEpEncryptFlagDefault = 0,
markus@181
   301
        pEpEncryptFlagForceEncryption = 0x1,
markus@242
   302
markus@242
   303
        // This flag is for special uses and should not be used
markus@240
   304
        // by normal pEp clients!
markus@242
   305
        pEpEncryptFlagForceUnsigned = 0x2,
markus@242
   306
markus@242
   307
        // This flag is for special uses and should not be used
markus@242
   308
        // by normal pEp clients!
markus@242
   309
        pEpEncryptFlagForceNoAttachedKey = 0x4,
markus@242
   310
Thomas@290
   311
		//This is mainly used by pEp clients to send private keys to 
Thomas@290
   312
		// their own PGP-only device
Thomas@290
   313
		pEpEncryptFlagForceVersion1 = 0x16
markus@181
   314
    } pEpEncryptFlags;
markus@167
   315
markus@181
   316
    typedef [v1_enum] enum pEpDecryptFlags {
markus@181
   317
        pEpDecryptFlagsNone = 0,
Dean@202
   318
        pEpDecryptFlagOwnPrivateKey = 0x1,
edouard@231
   319
        pEpDecryptFlagConsume = 0x2,
Thomas@286
   320
        pEpDecryptFlagIgnore = 0x4,
Thomas@287
   321
		pEpDecryptFlagSrcModified = 0x8,
Thomas@287
   322
		pEpDecryptFlagUntrustedServer = 0x100
markus@181
   323
    } pEpDecryptFlags;
markus@167
   324
markus@172
   325
    typedef [v1_enum] enum pEpMsgDirection {
markus@172
   326
        pEpDirIncoming = 0,
markus@172
   327
        pEpDirOutgoing
markus@172
   328
    } pEpMsgDirection;
vb@33
   329
markus@271
   330
    typedef [v1_enum] enum pEpEncFormat {
markus@271
   331
        pEpEncNone = 0,                       // message is not encrypted
markus@271
   332
        pEpEncPieces,                         // inline PGP + PGP extensions
markus@271
   333
        pEpEncSMime,                          // RFC5751
markus@271
   334
        pEpEncPgpMime,                        // RFC3156
markus@271
   335
        pEpEncPep,                            // pEp encryption format
markus@271
   336
        pEpEncPgpMimeOutlook1                 // Message B0rken by Outlook type 1
markus@271
   337
    } pEpEncFormat;
markus@271
   338
markus@181
   339
    [uuid(47FB0795-6B64-455C-BB0E-54998CAB8ACB)] struct StringPair {
markus@180
   340
        BSTR Name;
markus@180
   341
        BSTR Value;
vb@33
   342
    };
vb@33
   343
markus@181
   344
    [uuid(634EB7CE-99AA-460D-BDF8-F7CDA7232CA6)] struct Blob {
vb@33
   345
        SAFEARRAY(BYTE) value;
markus@180
   346
        BSTR MimeType;
markus@180
   347
        BSTR Filename;
vb@33
   348
    };
vb@33
   349
markus@181
   350
    [uuid(B6F40887-E761-4A47-B204-A0193EE0284D)] struct TextMessage {
markus@180
   351
        pEpMsgDirection Dir;
markus@180
   352
        BSTR Id;
markus@182
   353
        BSTR ShortMsg;
markus@182
   354
        BSTR LongMsg;
markus@182
   355
        BSTR LongMsgFormatted;
markus@180
   356
        SAFEARRAY(struct Blob) Attachments;
markus@180
   357
        hyper Sent; // Timestamp: 64 Bit time_t from mktime(), seconds since January 1, 1970, 0:00 UTC.
markus@180
   358
        hyper Recv; // Timestamp: 64 Bit time_t from mktime(), seconds since January 1, 1970, 0:00 UTC.
markus@180
   359
        struct pEpIdentity From;
markus@180
   360
        SAFEARRAY(struct pEpIdentity) To;
markus@180
   361
        struct pEpIdentity RecvBy;
markus@180
   362
        SAFEARRAY(struct pEpIdentity) Cc;
markus@180
   363
        SAFEARRAY(struct pEpIdentity) Bcc;
markus@180
   364
        SAFEARRAY(struct pEpIdentity) ReplyTo;
markus@180
   365
        SAFEARRAY(BSTR) References;
markus@180
   366
        SAFEARRAY(BSTR) Keywords;
markus@180
   367
        BSTR Comments;
markus@180
   368
        SAFEARRAY(struct StringPair) OptFields;
vb@33
   369
    };
vb@33
   370
markus@274
   371
    [id(28)] HRESULT EncryptMessage(
vb@281
   372
        [in,out] struct TextMessage *src,
markus@241
   373
        [out] struct TextMessage * dst,
markus@241
   374
        [in] SAFEARRAY(BSTR) extra,
markus@271
   375
        [in, defaultvalue(pEpEncryptFlagDefault)] pEpEncryptFlags flags,
markus@271
   376
        // Use pEpEncFormat.pEpEncNone for unencrypted, outgoing messages.
markus@271
   377
        // Default is pEpEncFormat.pEpEncPep, all other formats are only 
markus@271
   378
        // for compatibility and not intended for normal use.
markus@271
   379
        [in, defaultvalue(pEpEncPep)] pEpEncFormat encFormat);
markus@241
   380
markus@274
   381
    [id(29)] HRESULT DecryptMessage(
vb@282
   382
        [in, out] struct TextMessage *src,
markus@241
   383
        [out] struct TextMessage * dst,
Thomas@289
   384
        [in, out] SAFEARRAY(BSTR) *keylist,
vb@282
   385
        [in, out] pEpDecryptFlags* flags,
markus@241
   386
        [out, retval] pEpRating *rating);
markus@177
   387
markus@274
   388
    [id(30)] HRESULT OutgoingMessageRating([in] struct TextMessage *msg, [out, retval] pEpRating * pVal);
markus@274
   389
    [id(31)] HRESULT IdentityRating([in] struct pEpIdentity * ident, [out, retval] pEpRating * pVal);
markus@274
   390
    [id(32)] HRESULT ColorFromRating([in] pEpRating rating, [out, retval] pEpColor* pVal);
markus@84
   391
markus@274
   392
    [id(33)] HRESULT GetMessageTrustwords(
markus@232
   393
        [in] struct TextMessage *msg,
markus@232
   394
        [in] struct pEpIdentity * receivedBy,
markus@232
   395
        [in] SAFEARRAY(BSTR) keylist,
markus@232
   396
        [in, defaultvalue("en")] BSTR lang,
markus@232
   397
        [in, defaultvalue(0)] VARIANT_BOOL full,
markus@232
   398
        [out, retval] BSTR * words
markus@232
   399
    );
markus@238
   400
markus@274
   401
    [id(34)] HRESULT EncryptMessageForSelf(
markus@254
   402
        [in] struct pEpIdentity* targetId,
markus@271
   403
        [in] struct TextMessage* src,
markus@283
   404
        [in] SAFEARRAY(BSTR) extra, // Fingerprints for extra keys for encryption.
markus@240
   405
        [out] struct TextMessage* dst,
markus@242
   406
        [in, defaultvalue(pEpEncryptFlagDefault)] pEpEncryptFlags flags
markus@238
   407
    );
markus@254
   408
markus@274
   409
    [id(35)] HRESULT ReEvaluateMessageRating(
markus@254
   410
        [in] struct TextMessage *src,
markus@254
   411
        [in] SAFEARRAY(BSTR) x_KeyList, // referring to X-KeyList mail header
markus@254
   412
        [in] pEpRating x_EncStatus, // referring to X-EncStatus mail header
markus@254
   413
        [out, retval] pEpRating *rating
markus@254
   414
    );
markus@264
   415
markus@271
   416
    // callback / keysync API
markus@274
   417
    [id(36)] HRESULT RegisterCallbacks([in] IpEpEngineCallbacks* newCallback);
markus@274
   418
    [id(37)] HRESULT UnregisterCallbacks();
vb@278
   419
vb@278
   420
	// mark imported keys as trusted
vb@278
   421
markus@283
   422
	[id(38)] HRESULT SetOwnKey(
vb@278
   423
		[in] struct pEpIdentity * ident,
vb@278
   424
		[in] BSTR fpr,
vb@278
   425
		[out, retval] struct pEpIdentity * result
vb@278
   426
	);
markus@283
   427
markus@283
   428
    [id(39)] HRESULT EncryptMessageAndAddPrivKey(
markus@283
   429
        [in] struct TextMessage *src,
markus@283
   430
        [out] struct TextMessage * dst,
markus@283
   431
        [in] BSTR to_fpr,
markus@283
   432
        [in, defaultvalue(pEpEncryptFlagDefault)] pEpEncryptFlags flags,
markus@283
   433
        // Use pEpEncFormat.pEpEncNone for unencrypted, outgoing messages.
markus@283
   434
        // Default is pEpEncFormat.pEpEncPep, all other formats are only 
markus@283
   435
        // for compatibility and not intended for normal use.
markus@283
   436
        [in, defaultvalue(pEpEncPep)] pEpEncFormat encFormat);
markus@284
   437
markus@284
   438
    // Trigger an immediate update check.
markus@284
   439
    [id(40)] HRESULT UpdateNow();
Thomas@292
   440
Thomas@292
   441
	// Get a preview of the outgoint message rating
Thomas@292
   442
	[id(41)] HRESULT OutgoingMessageRatingPreview([in] struct TextMessage *msg, [out, retval] pEpRating * pVal);
Thomas@322
   443
Thomas@322
   444
	// Engine startup and shutdown
Thomas@322
   445
	[id(42)] HRESULT Startup();
markus@232
   446
};
markus@232
   447
markus@232
   448
[
markus@172
   449
    uuid(564A4350-419E-47F1-B0DF-6FCCF0CD0BBC),
vb@0
   450
    version(1.0),
vb@0
   451
]
vb@0
   452
library pEpCOMServerAdapterLib
vb@0
   453
{
vb@0
   454
    importlib("stdole2.tlb");
markus@181
   455
vb@0
   456
    [
markus@172
   457
        uuid(5FF6682B-727B-4DFE-A68D-28982874C0C7)
vb@0
   458
    ]
vb@0
   459
    coclass pEpEngine {
markus@271
   460
        [default] interface IpEpEngine;
markus@271
   461
        interface IpEpEngineCallbacks;
vb@0
   462
    };
vb@0
   463
};