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