Browse Source

structs instead of TextMessage objects

COM-121
Volker Birk 7 years ago
parent
commit
49c7789078
13 changed files with 612 additions and 1896 deletions
  1. +19
    -59
      CpEpEngine.cpp
  2. +4
    -4
      CpEpEngine.h
  3. +0
    -882
      TextMessage.cpp
  4. +60
    -114
      pEpCOMServerAdapter.idl
  5. BIN
      pEpCOMServerAdapter.rc
  6. +2
    -6
      pEpCOMServerAdapter.vcxproj
  7. +2
    -14
      pEpCOMServerAdapter.vcxproj.filters
  8. +1
    -10
      pEpCOMServerAdapter_i.c
  9. +76
    -648
      pEpCOMServerAdapter_i.h
  10. +0
    -150
      pEp_identity_helper.cpp
  11. +2
    -8
      pEp_utility.h
  12. +446
    -0
      pEp_utitlity.cpp
  13. +0
    -1
      utf8_helper.h

+ 19
- 59
CpEpEngine.cpp View File

@ -2,7 +2,6 @@
#include "stdafx.h"
#include "CpEpEngine.h"
#include "TextMessage.h"
using namespace std;
using namespace pEp::utility;
@ -866,88 +865,53 @@ HRESULT CpEpEngine::error(_bstr_t msg)
return E_FAIL;
}
STDMETHODIMP CpEpEngine::encrypt_message(ITextMessage * src, ITextMessage * dst, SAFEARRAY * extra)
STDMETHODIMP CpEpEngine::encrypt_message(text_message * src, text_message ** dst, SAFEARRAY * extra)
{
assert(src);
assert(dst);
CTextMessage *_src = dynamic_cast<CTextMessage *>(src);
assert(_src);
CTextMessage *_dst = dynamic_cast<CTextMessage *>(dst);
assert(_dst);
if (_src->msg()->enc_format != PEP_enc_none)
return E_INVALIDARG;
::stringlist_t * _extra = NULL;
if (extra) {
try {
_extra = new_stringlist(extra);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
}
::message *_src = text_message_to_C(src);
::message *msg_dst;
PEP_STATUS status = ::encrypt_message(get_session(), _src->msg(), _extra, &msg_dst, PEP_enc_pieces);
::stringlist_t *_extra = new_stringlist(extra);
PEP_STATUS status = ::encrypt_message(get_session(), _src, _extra, &msg_dst, PEP_enc_pieces);
free_message(_src);
free_stringlist(_extra);
if (status != PEP_STATUS_OK)
FAIL(L"cannot encrypt message");
::free_stringlist(_extra);
if (msg_dst) {
_dst->msg(msg_dst);
*dst = text_message_from_C(msg_dst);
free_message(msg_dst);
}
return S_OK;
}
STDMETHODIMP CpEpEngine::decrypt_message(ITextMessage * src, ITextMessage * dst, SAFEARRAY ** keylist, pEp_color *rating)
STDMETHODIMP CpEpEngine::decrypt_message(text_message * src, text_message ** dst, SAFEARRAY ** keylist, pEp_color *rating)
{
assert(src);
assert(dst);
assert(keylist);
assert(rating);
CTextMessage *_src = dynamic_cast<CTextMessage *>(src);
assert(_src);
CTextMessage *_dst = dynamic_cast<CTextMessage *>(dst);
assert(_dst);
if (_src->msg()->enc_format != PEP_enc_none)
return E_INVALIDARG;
::message *_src = text_message_to_C(src);
::message *msg_dst;
::stringlist_t *_keylist;
::PEP_color _rating;
PEP_STATUS status = ::decrypt_message(get_session(), _src->msg(), &msg_dst, &_keylist, &_rating);
PEP_STATUS status = ::decrypt_message(get_session(), _src, &msg_dst, &_keylist, &_rating);
free_message(_src);
if (status != PEP_STATUS_OK)
return FAIL(L"decrypt message failed");
if (msg_dst) {
_dst->msg(msg_dst);
*dst = text_message_from_C(msg_dst);
}
if (_keylist) {
ULONG len = ::stringlist_length(_keylist);
CComSafeArray<BSTR> sa;
sa.Create(len);
::stringlist_t *_kl;
ULONG i;
for (_kl = _keylist, i = 0; _kl && _kl->value; _kl = _kl->next, i++)
sa.SetAt(i, utf16_bstr(_kl->value).Detach(), false);
::free_stringlist(_keylist);
*keylist = sa.Detach();
}
else {
*keylist = NULL;
*keylist = string_array(_keylist).Detach();
free_stringlist(_keylist);
}
*rating = (pEp_color) _rating;
@ -955,19 +919,15 @@ STDMETHODIMP CpEpEngine::decrypt_message(ITextMessage * src, ITextMessage * dst,
return S_OK;
}
STDMETHODIMP CpEpEngine::outgoing_message_color(ITextMessage *msg, pEp_color * pVal)
STDMETHODIMP CpEpEngine::outgoing_message_color(text_message *msg, pEp_color * pVal)
{
assert(msg);
assert(pVal);
CTextMessage *_msg = dynamic_cast<CTextMessage *>(msg);
assert(_msg);
if (_msg->msg()->dir != PEP_dir_outgoing)
return E_INVALIDARG;
::message *_msg = text_message_to_C(msg);
PEP_color _color;
PEP_STATUS status = ::outgoing_message_color(get_session(), _msg->msg(), &_color);
PEP_STATUS status = ::outgoing_message_color(get_session(), _msg, &_color);
if (status != PEP_STATUS_OK)
return FAIL(L"cannot get message color");


+ 4
- 4
CpEpEngine.h View File

@ -7,7 +7,7 @@
#include "_IpEpEngineEvents_CP.h"
#include "locked_queue.hh"
#include "utf8_helper.h"
#include "pEp_identity_helper.h"
#include "pEp_utility.h"
#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
@ -147,9 +147,9 @@ public:
// Message API
STDMETHOD(encrypt_message)(ITextMessage * src, ITextMessage * dst, SAFEARRAY * extra);
STDMETHOD(decrypt_message)(ITextMessage * src, ITextMessage * dst, SAFEARRAY ** keylist, pEp_color *rating);
STDMETHOD(outgoing_message_color)(ITextMessage *msg, pEp_color * pVal);
STDMETHOD(encrypt_message)(text_message * src, text_message ** dst, SAFEARRAY * extra);
STDMETHOD(decrypt_message)(text_message * src, text_message ** dst, SAFEARRAY ** keylist, pEp_color *rating);
STDMETHOD(outgoing_message_color)(text_message *msg, pEp_color * pVal);
STDMETHOD(identity_color)(pEp_identity_s * ident, pEp_color * pVal);
};


+ 0
- 882
TextMessage.cpp View File

@ -1,882 +0,0 @@
// TextMessage.cpp : Implementation of CTextMessage
#include "stdafx.h"
#include "TextMessage.h"
using namespace pEp::utility;
// CTextMessage
STDMETHODIMP CTextMessage::InterfaceSupportsErrorInfo(REFIID riid)
{
static const IID* const arr[] =
{
&IID_ITextMessage
};
for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
{
if (InlineIsEqualGUID(*arr[i],riid))
return S_OK;
}
return S_FALSE;
}
STDMETHODIMP CTextMessage::get_from(pEp_identity_s* pVal)
{
assert(pVal);
try {
copy_identity(pVal, msg()->from);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
return S_OK;
}
STDMETHODIMP CTextMessage::put_from(pEp_identity_s* newVal)
{
assert(newVal);
::pEp_identity *_from;
try {
_from = new_identity(newVal);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&)
{
return E_FAIL;
}
::free_identity(msg()->from);
msg()->from = _from;
return S_OK;
}
static HRESULT il_get(const identity_list *il, LPSAFEARRAY * sa)
{
assert(sa);
int len = identity_list_length(il);
LPSAFEARRAY _sa = newSafeArray<pEp_identity_s>(len);
if (_sa == NULL)
return E_OUTOFMEMORY;
const identity_list *_il;
LONG i;
for (i = 0, _il = il; _il && _il->ident; _il = _il->next, i++) {
pEp_identity_s cs;
try {
copy_identity(&cs, _il->ident);
::SafeArrayPutElement(_sa, &i, &cs);
IRecordInfo *ir = getRecordInfo<pEp_identity_s>();
ir->RecordClear(&cs);
}
catch (bad_alloc&) {
IRecordInfo *ir = getRecordInfo<pEp_identity_s>();
ir->RecordClear(&cs);
SafeArrayDestroy(_sa);
return E_OUTOFMEMORY;
}
catch (exception&) {
IRecordInfo *ir = getRecordInfo<pEp_identity_s>();
ir->RecordClear(&cs);
SafeArrayDestroy(_sa);
return E_FAIL;
}
}
*sa = _sa;
return S_OK;
}
static HRESULT il_put(identity_list **target, SAFEARRAY * newVal)
{
assert(newVal);
if (newVal == NULL)
return E_INVALIDARG;
identity_list *il = new_identity_list(NULL);
if (il == NULL)
return E_OUTOFMEMORY;
identity_list *_il;
LONG lbound, ubound;
LONG i;
SafeArrayGetLBound(newVal, 1, &lbound);
SafeArrayGetUBound(newVal, 1, &ubound);
for (i = lbound, _il = il; i <= ubound; i++) {
pEp_identity * ident;
pEp_identity_s cs;
memset(&cs, 0, sizeof(pEp_identity_s));
try {
HRESULT hr = ::SafeArrayGetElement(newVal, &i, &cs);
if (hr != S_OK) {
IRecordInfo *ri = getRecordInfo<pEp_identity_s>();
ri->RecordClear(&cs);
free_identity_list(il);
return hr;
}
ident = new_identity(&cs);
IRecordInfo *ri = getRecordInfo<pEp_identity_s>();
ri->RecordClear(&cs);
}
catch (bad_alloc&) {
IRecordInfo *ri = getRecordInfo<pEp_identity_s>();
ri->RecordClear(&cs);
free_identity_list(il);
return E_OUTOFMEMORY;
}
catch (exception&) {
IRecordInfo *ri = getRecordInfo<pEp_identity_s>();
ri->RecordClear(&cs);
free_identity_list(il);
return E_FAIL;
}
_il = identity_list_add(_il, ident);
if (_il == NULL) {
free_identity_list(il);
return E_OUTOFMEMORY;
}
}
free_identity_list(*target);
*target = il;
return S_OK;
}
STDMETHODIMP CTextMessage::get_to(LPSAFEARRAY * pVal)
{
return il_get(msg()->to, pVal);
}
STDMETHODIMP CTextMessage::put_to(SAFEARRAY * newVal)
{
return il_put(&msg()->to, newVal);
}
STDMETHODIMP CTextMessage::get_recv_by(pEp_identity_s* pVal)
{
assert(pVal);
try {
copy_identity(pVal, msg()->recv_by);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
return S_OK;
}
STDMETHODIMP CTextMessage::put_recv_by(pEp_identity_s* newVal)
{
assert(newVal);
::pEp_identity *_recv_by;
try {
_recv_by = new_identity(newVal);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
::free_identity(msg()->recv_by);
msg()->recv_by = _recv_by;
return S_OK;
}
STDMETHODIMP CTextMessage::get_cc(LPSAFEARRAY * pVal)
{
return il_get(msg()->cc, pVal);
}
STDMETHODIMP CTextMessage::put_cc(SAFEARRAY * newVal)
{
return il_put(&msg()->cc, newVal);
}
STDMETHODIMP CTextMessage::get_bcc(LPSAFEARRAY * pVal)
{
return il_get(msg()->bcc, pVal);
}
STDMETHODIMP CTextMessage::put_bcc(SAFEARRAY * newVal)
{
return il_put(&msg()->bcc, newVal);
}
STDMETHODIMP CTextMessage::get_reply_to(LPSAFEARRAY * pVal)
{
return il_get(msg()->reply_to, pVal);
}
STDMETHODIMP CTextMessage::put_reply_to(SAFEARRAY * newVal)
{
return il_put(&msg()->reply_to, newVal);
}
STDMETHODIMP CTextMessage::get_dir(pEp_msg_direction *pVal)
{
assert(pVal);
*pVal = (pEp_msg_direction) msg()->dir;
return S_OK;
}
STDMETHODIMP CTextMessage::put_dir(pEp_msg_direction newVal)
{
msg()->dir = (PEP_msg_direction) newVal;
return S_OK;
}
STDMETHODIMP CTextMessage::get_id(BSTR * pVal)
{
assert(pVal);
_bstr_t val;
if (msg()->id) {
try {
val = utf16_bstr(msg()->id);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
*pVal = val.Detach();
}
return S_OK;
}
STDMETHODIMP CTextMessage::put_id(BSTR newVal)
{
char *_val = NULL;
string val;
if (newVal) {
try {
val = utf8_string(newVal);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
_val = _strdup(val.c_str());
if (_val == NULL)
return E_OUTOFMEMORY;
}
if (msg()->id)
free(msg()->id);
msg()->id = _val;
return S_OK;
}
STDMETHODIMP CTextMessage::get_shortmsg(BSTR * pVal)
{
assert(pVal);
_bstr_t val;
if (msg()->shortmsg) {
try {
val = utf16_bstr(msg()->shortmsg);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
*pVal = val.Detach();
}
return S_OK;
}
STDMETHODIMP CTextMessage::put_shortmsg(BSTR newVal)
{
char *_val = NULL;
if (newVal) {
string val;
try {
val = utf8_string(newVal);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
_val = _strdup(val.c_str());
if (_val == NULL)
return E_OUTOFMEMORY;
}
if (msg()->shortmsg)
free(msg()->shortmsg);
msg()->shortmsg = _val;
return S_OK;
}
STDMETHODIMP CTextMessage::get_longmsg(BSTR * pVal)
{
assert(pVal);
_bstr_t val;
if (msg()->longmsg) {
try {
val = utf16_bstr(msg()->longmsg);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
*pVal = val.Detach();
}
return S_OK;
}
STDMETHODIMP CTextMessage::put_longmsg(BSTR newVal)
{
char * _val = NULL;
if (newVal) {
string val;
try {
val = utf8_string(newVal);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
_val = _strdup(val.c_str());
if (_val == NULL)
return E_OUTOFMEMORY;
}
if (msg()->longmsg)
free(msg()->longmsg);
msg()->longmsg = _val;
return S_OK;
}
STDMETHODIMP CTextMessage::get_longmsg_formatted(BSTR * pVal)
{
assert(pVal);
_bstr_t val;
if (msg()->longmsg_formatted) {
try {
val = utf16_bstr(msg()->longmsg_formatted);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
*pVal = val.Detach();
}
return S_OK;
}
STDMETHODIMP CTextMessage::put_longmsg_formatted(BSTR newVal)
{
char *_val = NULL;
if (newVal) {
string val;
try {
val = utf8_string(newVal);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
_val = _strdup(val.c_str());
if (_val == NULL)
return E_OUTOFMEMORY;
}
if (msg()->longmsg_formatted)
free(msg()->longmsg_formatted);
msg()->longmsg_formatted = _val;
return S_OK;
}
STDMETHODIMP CTextMessage::add_attachment(SAFEARRAY * data, BSTR mime_type, BSTR filename)
{
assert(data);
if (data == NULL)
return E_INVALIDARG;
CComSafeArray<BYTE> sa_data(data);
size_t len = sa_data.GetCount();
char *_data = (char *) malloc(sa_data.GetCount() + 1);
assert(_data);
if (_data == NULL)
return E_OUTOFMEMORY;
memcpy(_data, sa_data.m_psa->pvData, len);
_data[len] = 0;
sa_data.Detach();
string _mime_type;
if (mime_type) {
try {
_mime_type = utf8_string(mime_type);
}
catch (bad_alloc&) {
free(_data);
return E_OUTOFMEMORY;
}
catch (exception&) {
free(_data);
return E_FAIL;
}
}
string _filename;
if (filename) {
try {
_filename = utf8_string(filename);
}
catch (bad_alloc&) {
free(_data);
return E_OUTOFMEMORY;
}
catch (exception&) {
free(_data);
return E_FAIL;
}
}
bloblist_t *blob = bloblist_add(msg()->attachments, _data, len, _mime_type.c_str(), _filename.c_str());
if (blob == NULL) {
free(_data);
return E_OUTOFMEMORY;
}
if (msg()->attachments == NULL)
msg()->attachments = blob;
return S_OK;
}
STDMETHODIMP CTextMessage::has_attachments(boolean *result)
{
assert(result);
if (msg()->attachments == NULL || msg()->attachments->data == NULL) {
m_next_attachment = NULL;
*result = false;
return S_OK;
}
m_next_attachment = msg()->attachments;
*result = true;
return S_OK;
}
STDMETHODIMP CTextMessage::next_attachment(SAFEARRAY ** data, BSTR * mime_type, BSTR * filename, boolean *result)
{
assert(data);
assert(mime_type);
assert(filename);
assert(result);
if (m_next_attachment == NULL)
return E_ILLEGAL_METHOD_CALL;
CComSafeArray<BYTE> sa;
try {
sa.Create(m_next_attachment->size);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
memcpy(sa.m_psa->pvData, m_next_attachment->data, m_next_attachment->size);
_bstr_t _mime_type;
if (m_next_attachment->mime_type) {
try {
_mime_type = utf16_bstr(m_next_attachment->mime_type);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
}
_bstr_t _filename;
if (m_next_attachment->filename) {
try {
_filename = utf16_bstr(m_next_attachment->filename);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
}
*data = sa.Detach();
*mime_type = _mime_type.Detach();
*filename = _filename.Detach();
m_next_attachment = m_next_attachment->next;
*result = m_next_attachment != NULL;
return S_OK;
}
STDMETHODIMP CTextMessage::get_sent(hyper * result)
{
assert(result);
if (msg()->sent == NULL)
return E_NOT_SET;
*result = mktime(msg()->sent);
return S_OK;
}
STDMETHODIMP CTextMessage::put_sent(hyper val)
{
::timestamp * ts = new_timestamp(val);
if (ts == NULL)
return E_OUTOFMEMORY;
if (msg()->sent)
free_timestamp(msg()->sent);
msg()->sent = ts;
return S_OK;
}
STDMETHODIMP CTextMessage::get_recv(hyper * result)
{
assert(result);
if (msg()->recv == NULL)
return E_NOT_SET;
*result = mktime(msg()->recv);
return S_OK;
}
STDMETHODIMP CTextMessage::put_recv(hyper val)
{
::timestamp * ts = new_timestamp(val);
if (ts == NULL)
return E_OUTOFMEMORY;
if (msg()->recv)
free_timestamp(msg()->recv);
msg()->recv = ts;
return S_OK;
}
STDMETHODIMP CTextMessage::get_references(SAFEARRAY ** pVal)
{
assert(pVal);
CComSafeArray<BSTR> sa;
try {
if (msg()->references) {
sa = string_array(msg()->references);
}
else {
sa.Create(0UL);
}
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
*pVal = sa.Detach();
return S_OK;
}
STDMETHODIMP CTextMessage::put_references(SAFEARRAY * newVal)
{
assert(newVal);
stringlist_t *sl;
try {
sl = new_stringlist(newVal);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
if (msg()->references)
free_stringlist(msg()->references);
msg()->references = sl;
return S_OK;
}
STDMETHODIMP CTextMessage::get_keywords(SAFEARRAY ** pVal)
{
assert(pVal);
CComSafeArray<BSTR> sa;
try {
if (msg()->keywords) {
sa = string_array(msg()->keywords);
}
else {
sa.Create(0UL);
}
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
*pVal = sa.Detach();
return S_OK;
}
STDMETHODIMP CTextMessage::put_keywords(SAFEARRAY * newVal)
{
assert(newVal);
stringlist_t *sl;
try {
sl = new_stringlist(newVal);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
if (msg()->keywords)
free_stringlist(msg()->keywords);
msg()->keywords = sl;
return S_OK;
}
STDMETHODIMP CTextMessage::get_comments(BSTR * pVal)
{
assert(pVal);
_bstr_t val;
if (msg()->comments) {
try {
val = utf16_bstr(msg()->comments);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
*pVal = val.Detach();
}
return S_OK;
}
STDMETHODIMP CTextMessage::put_comments(BSTR newVal)
{
char * _val = NULL;
if (newVal) {
string val;
try {
val = utf8_string(newVal);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception&) {
return E_FAIL;
}
_val = _strdup(val.c_str());
if (_val == NULL)
return E_OUTOFMEMORY;
}
if (msg()->comments)
free(msg()->comments);
msg()->comments = _val;
return S_OK;
}
STDMETHODIMP CTextMessage::get_opt_fields(LPSAFEARRAY * pVal)
{
assert(pVal);
if (msg()->opt_fields == NULL)
return S_OK;
int len = stringpair_list_length(msg()->opt_fields);
LPSAFEARRAY sa = newSafeArray<struct opt_field>(len);
if (sa == NULL)
return E_OUTOFMEMORY;
stringpair_list_t *il;
LONG i;
for (i = 0, il = msg()->opt_fields; il && il->value; il = il->next, i++) {
opt_field fld;
memset(&fld, 0, sizeof(opt_field));
try {
fld.name = utf16_bstr(il->value->key).Detach();
fld.value = utf16_bstr(il->value->value).Detach();
::SafeArrayPutElement(sa, &i, &fld);
IRecordInfo *ir = getRecordInfo<opt_field>();
ir->RecordClear(&fld);
}
catch (bad_alloc&) {
IRecordInfo *ir = getRecordInfo<opt_field>();
ir->RecordClear(&fld);
SafeArrayDestroy(sa);
return E_OUTOFMEMORY;
}
catch (exception&) {
IRecordInfo *ir = getRecordInfo<opt_field>();
ir->RecordClear(&fld);
SafeArrayDestroy(sa);
return E_FAIL;
}
}
*pVal = sa;
return S_OK;
}
STDMETHODIMP CTextMessage::put_opt_fields(SAFEARRAY * newVal)
{
assert(newVal);
if (newVal == NULL)
return E_INVALIDARG;
stringpair_list_t *il = new_stringpair_list(NULL);
if (il == NULL)
return E_OUTOFMEMORY;
stringpair_list_t *_il;
LONG lbound, ubound;
LONG i;
SafeArrayGetLBound(newVal, 1, &lbound);
SafeArrayGetUBound(newVal, 1, &ubound);
for (i = lbound, _il = il; i <= ubound; i++) {
stringpair_t * pair;
try {
struct opt_field cs;
memset(&cs, 0, sizeof(opt_field));
HRESULT hr = ::SafeArrayGetElement(newVal, &i, &cs);
pair = new_stringpair(utf8_string(cs.name).c_str(), utf8_string(cs.value).c_str());
IRecordInfo *ri = getRecordInfo<opt_field>();
ri->RecordClear(&cs);
}
catch (bad_alloc&) {
free_stringpair_list(il);
return E_OUTOFMEMORY;
}
catch (exception&) {
free_stringpair_list(il);
return E_FAIL;
}
_il = stringpair_list_add(_il, pair);
if (_il == NULL) {
free_stringpair_list(il);
return E_OUTOFMEMORY;
}
}
free_stringpair_list(msg()->opt_fields);
msg()->opt_fields = il;
return S_OK;
}

+ 60
- 114
pEpCOMServerAdapter.idl View File

@ -7,101 +7,6 @@
import "oaidl.idl";
import "ocidl.idl";
[
object,
uuid(161538F9-53C8-4D9C-8BA4-0FB43AEC7106),
oleautomation,
nonextensible,
pointer_default(unique)
]
interface ITextMessage : IUnknown {
typedef enum _pEp_text_format {
pEp_text_format_plain = 0,
pEp_text_format_html,
pEp_text_format_other = 0xff
} pEp_text_format;
typedef enum _pEp_msg_direction {
pEp_dir_incoming = 0,
pEp_dir_outgoing
} pEp_msg_direction;
typedef enum _pEp_MIME_format {
pEp_MIME_none = 0, // message is not MIME encoded
pEp_MIME_fields_omitted, // message content but no fields
pEp_MIME // message is fully MIME encoded
} pEp_MIME_format;
typedef enum _pEp_enc_format {
pEp_enc_none = 0, // message is not encrypted
pEp_enc_pieces, // inline PGP + PGP extensions
pEp_enc_S_MIME, // RFC5751
pEp_enc_PGP_MIME, // RFC3156
pEp_enc_pEp // pEp encryption format
} pEp_enc_format;
[uuid(1292C31A-6486-427F-B29F-7F03607836DC)] struct opt_field {
BSTR name;
BSTR value;
};
[propget] HRESULT dir([out, retval] pEp_msg_direction *pVal);
[propput] HRESULT dir([in] pEp_msg_direction newVal);
[propget] HRESULT id([out, retval] BSTR *pVal);
[propput] HRESULT id([in] BSTR newVal);
[propget] HRESULT shortmsg([out, retval] BSTR *pVal);
[propput] HRESULT shortmsg([in] BSTR newVal);
[propget] HRESULT longmsg([out, retval] BSTR *pVal);
[propput] HRESULT longmsg([in] BSTR newVal);
[propget] HRESULT longmsg_formatted([out, retval] BSTR *pVal);
[propput] HRESULT longmsg_formatted([in] BSTR newVal);
HRESULT add_attachment([in] SAFEARRAY(BYTE) data, [in] BSTR mime_type, [in] BSTR filename);
HRESULT has_attachments([out, retval] boolean *result);
HRESULT next_attachment([out] SAFEARRAY(BYTE) * data, [out] BSTR * mime_type, [out] BSTR * filename, [out, retval] boolean *result);
[propget] HRESULT sent([out, retval] hyper * result);
[propput] HRESULT sent([in] hyper val);
[propget] HRESULT recv([out, retval] hyper * result);
[propput] HRESULT recv([in] hyper val);
[propget] HRESULT from([out, retval] struct pEp_identity_s *pVal);
[propput] HRESULT from([in] struct pEp_identity_s *newVal);
[propget] HRESULT to([out, retval] SAFEARRAY(struct pEp_identity_s) *pVal);
[propput] HRESULT to([in] SAFEARRAY(struct pEp_identity_s) newVal);
[propget] HRESULT recv_by([out, retval] struct pEp_identity_s *pVal);
[propput] HRESULT recv_by([in] struct pEp_identity_s *newVal);
[propget] HRESULT cc([out, retval] SAFEARRAY(struct pEp_identity_s) *pVal);
[propput] HRESULT cc([in] SAFEARRAY(struct pEp_identity_s) newVal);
[propget] HRESULT bcc([out, retval] SAFEARRAY(struct pEp_identity_s) *pVal);
[propput] HRESULT bcc([in] SAFEARRAY(struct pEp_identity_s) newVal);
[propget] HRESULT reply_to([out, retval] SAFEARRAY(struct pEp_identity_s) *pVal);
[propput] HRESULT reply_to([in] SAFEARRAY(struct pEp_identity_s) newVal);
[propget] HRESULT references([out, retval] SAFEARRAY(BSTR) *pVal);
[propput] HRESULT references([in] SAFEARRAY(BSTR) newVal);
[propget] HRESULT keywords([out, retval] SAFEARRAY(BSTR) *pVal);
[propput] HRESULT keywords([in] SAFEARRAY(BSTR) newVal);
[propget] HRESULT comments([out, retval] BSTR *pVal);
[propput] HRESULT comments([in] BSTR newVal);
[propget] HRESULT opt_fields([out, retval] SAFEARRAY(struct opt_field) *pVal);
[propput] HRESULT opt_fields([in] SAFEARRAY(struct opt_field) newVal);
};
[
object,
uuid(9A9F4422-CF0A-45D7-90CD-1D1B7B2A4540),
@ -236,9 +141,66 @@ interface IpEpEngine : IUnknown {
pEp_rating_b0rken = -2
} pEp_color;
HRESULT encrypt_message([in,ref] ITextMessage *src, [in,ref] ITextMessage * dst, [in] SAFEARRAY(BSTR) extra);
HRESULT decrypt_message([in,ref] ITextMessage *src, [in,ref] ITextMessage * dst, [out] SAFEARRAY(BSTR) *keylist, [out, retval] pEp_color *rating);
HRESULT outgoing_message_color([in] ITextMessage *msg, [out, retval] pEp_color * pVal);
typedef enum _pEp_text_format {
pEp_text_format_plain = 0,
pEp_text_format_html,
pEp_text_format_other = 0xff
} pEp_text_format;
typedef enum _pEp_msg_direction {
pEp_dir_incoming = 0,
pEp_dir_outgoing
} pEp_msg_direction;
typedef enum _pEp_MIME_format {
pEp_MIME_none = 0, // message is not MIME encoded
pEp_MIME_fields_omitted, // message content but no fields
pEp_MIME // message is fully MIME encoded
} pEp_MIME_format;
typedef enum _pEp_enc_format {
pEp_enc_none = 0, // message is not encrypted
pEp_enc_pieces, // inline PGP + PGP extensions
pEp_enc_S_MIME, // RFC5751
pEp_enc_PGP_MIME, // RFC3156
pEp_enc_pEp // pEp encryption format
} pEp_enc_format;
[uuid(3A8A4F13-3402-4C4C-94AB-598D87869380)] struct opt_field {
BSTR name;
BSTR value;
};
[uuid(61DA7AD4-192E-4616-8678-B19AEFB45B45)] struct blob {
SAFEARRAY(BYTE) value;
BSTR mime_type;
BSTR filename;
};
[uuid(D763A8F3-BA23-4229-A037-1BB7BDC3E0C8)] struct text_message {
pEp_msg_direction dir;
BSTR id;
BSTR shortmsg;
BSTR longmsg;
BSTR longmsg_formatted;
SAFEARRAY(struct blob) attachments;
hyper sent;
hyper recv;
struct pEp_identity_s from;
SAFEARRAY(struct pEp_identity_s) to;
struct pEp_identity_s recv_by;
SAFEARRAY(struct pEp_identity_s) cc;
SAFEARRAY(struct pEp_identity_s) bcc;
SAFEARRAY(struct pEp_identity_s) reply_to;
SAFEARRAY(BSTR) references;
SAFEARRAY(BSTR) keywords;
BSTR comments;
SAFEARRAY(struct opt_field) opt_fields;
};
HRESULT encrypt_message([in] struct text_message *src, [out] struct text_message ** dst, [in] SAFEARRAY(BSTR) extra);
HRESULT decrypt_message([in] struct text_message *src, [out] struct text_message ** dst, [out] SAFEARRAY(BSTR) *keylist, [out, retval] pEp_color *rating);
HRESULT outgoing_message_color([in] struct text_message *msg, [out, retval] pEp_color * pVal);
HRESULT identity_color([in] struct pEp_identity_s * ident, [out, retval] pEp_color * pVal);
};
@ -264,20 +226,4 @@ library pEpCOMServerAdapterLib
[default] interface IpEpEngine;
[default, source] dispinterface _IpEpEngineEvents;
};
[
uuid(844B5363-4EF4-4A39-A030-16452783A6F7)
]
dispinterface _ITextMessageEvents
{
properties:
methods:
};
[
uuid(B6CC444F-FE14-4DFE-8315-81E4EA16C1CC)
]
coclass TextMessage
{
[default] interface ITextMessage;
[default, source] dispinterface _ITextMessageEvents;
};
};

BIN
pEpCOMServerAdapter.rc View File


+ 2
- 6
pEpCOMServerAdapter.vcxproj View File

@ -123,12 +123,11 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="pEp_identity_helper.cpp" />
<ClCompile Include="pEp_utitlity.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="TextMessage.cpp" />
<ClCompile Include="utf8_helper.cpp" />
<ClCompile Include="xdlldata.c">
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
@ -143,15 +142,13 @@
<ClInclude Include="CpEpEngine.h" />
<ClInclude Include="locked_queue.hh" />
<ClInclude Include="pEpCOMServerAdapter_i.h" />
<ClInclude Include="pEp_identity_helper.h" />
<ClInclude Include="pEp_utility.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
<ClInclude Include="TextMessage.h" />
<ClInclude Include="utf8_helper.h" />
<ClInclude Include="xdlldata.h" />
<ClInclude Include="_IpEpEngineEvents_CP.h" />
<ClInclude Include="_ITextMessageEvents_CP.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="pEpCOMServerAdapter.rc" />
@ -162,7 +159,6 @@
<ItemGroup>
<None Include="pEpCOMServerAdapter.rgs" />
<None Include="pEpEngine.rgs" />
<None Include="TextMessage.rgs" />
</ItemGroup>
<ItemGroup>
<Midl Include="pEpCOMServerAdapter.idl" />


+ 2
- 14
pEpCOMServerAdapter.vcxproj.filters View File

@ -37,10 +37,7 @@
<ClCompile Include="utf8_helper.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TextMessage.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pEp_identity_helper.cpp">
<ClCompile Include="pEp_utitlity.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
@ -72,13 +69,7 @@
<ClInclude Include="_IpEpEngineEvents_CP.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="_ITextMessageEvents_CP.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="TextMessage.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pEp_identity_helper.h">
<ClInclude Include="pEp_utility.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
@ -97,9 +88,6 @@
<None Include="pEpEngine.rgs">
<Filter>Resource Files</Filter>
</None>
<None Include="TextMessage.rgs">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Midl Include="pEpCOMServerAdapter.idl">


+ 1
- 10
pEpCOMServerAdapter_i.c View File

@ -6,7 +6,7 @@
/* File created by MIDL compiler version 8.00.0603 */
/* at Sat May 30 18:16:12 2015
/* at Sun May 31 10:51:32 2015
*/
/* Compiler settings for pEpCOMServerAdapter.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0603
@ -67,9 +67,6 @@ typedef IID CLSID;
#endif !_MIDL_USE_GUIDDEF_
MIDL_DEFINE_GUID(IID, IID_ITextMessage,0x161538F9,0x53C8,0x4D9C,0x8B,0xA4,0x0F,0xB4,0x3A,0xEC,0x71,0x06);
MIDL_DEFINE_GUID(IID, IID_IpEpEngine,0x9A9F4422,0xCF0A,0x45D7,0x90,0xCD,0x1D,0x1B,0x7B,0x2A,0x45,0x40);
@ -81,12 +78,6 @@ MIDL_DEFINE_GUID(IID, DIID__IpEpEngineEvents,0xB6BC9B8E,0xD9E2,0x4419,0xA3,0xA4,
MIDL_DEFINE_GUID(CLSID, CLSID_pEpEngine,0xEF1B073D,0x5058,0x4E0E,0x82,0x9E,0xB4,0xD2,0x2C,0xA2,0x1E,0xA2);
MIDL_DEFINE_GUID(IID, DIID__ITextMessageEvents,0x844B5363,0x4EF4,0x4A39,0xA0,0x30,0x16,0x45,0x27,0x83,0xA6,0xF7);
MIDL_DEFINE_GUID(CLSID, CLSID_TextMessage,0xB6CC444F,0xFE14,0x4DFE,0x83,0x15,0x81,0xE4,0xEA,0x16,0xC1,0xCC);
#undef MIDL_DEFINE_GUID
#ifdef __cplusplus


+ 76
- 648
pEpCOMServerAdapter_i.h View File

@ -4,7 +4,7 @@
/* File created by MIDL compiler version 8.00.0603 */
/* at Sat May 30 18:16:12 2015
/* at Sun May 31 10:51:32 2015
*/
/* Compiler settings for pEpCOMServerAdapter.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0603
@ -45,13 +45,6 @@
/* Forward Declarations */
#ifndef __ITextMessage_FWD_DEFINED__
#define __ITextMessage_FWD_DEFINED__
typedef interface ITextMessage ITextMessage;
#endif /* __ITextMessage_FWD_DEFINED__ */
#ifndef __IpEpEngine_FWD_DEFINED__
#define __IpEpEngine_FWD_DEFINED__
typedef interface IpEpEngine IpEpEngine;
@ -78,25 +71,6 @@ typedef struct pEpEngine pEpEngine;
#endif /* __pEpEngine_FWD_DEFINED__ */
#ifndef ___ITextMessageEvents_FWD_DEFINED__
#define ___ITextMessageEvents_FWD_DEFINED__
typedef interface _ITextMessageEvents _ITextMessageEvents;
#endif /* ___ITextMessageEvents_FWD_DEFINED__ */
#ifndef __TextMessage_FWD_DEFINED__
#define __TextMessage_FWD_DEFINED__
#ifdef __cplusplus
typedef class TextMessage TextMessage;
#else
typedef struct TextMessage TextMessage;
#endif /* __cplusplus */
#endif /* __TextMessage_FWD_DEFINED__ */
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
@ -106,494 +80,6 @@ extern "C"{
#endif
#ifndef __ITextMessage_INTERFACE_DEFINED__
#define __ITextMessage_INTERFACE_DEFINED__
/* interface ITextMessage */
/* [unique][nonextensible][oleautomation][uuid][object] */
typedef
enum _pEp_text_format
{
pEp_text_format_plain = 0,
pEp_text_format_html = ( pEp_text_format_plain + 1 ) ,
pEp_text_format_other = 0xff
} pEp_text_format;
typedef
enum _pEp_msg_direction
{
pEp_dir_incoming = 0,
pEp_dir_outgoing = ( pEp_dir_incoming + 1 )
} pEp_msg_direction;
typedef
enum _pEp_MIME_format
{
pEp_MIME_none = 0,
pEp_MIME_fields_omitted = ( pEp_MIME_none + 1 ) ,
pEp_MIME = ( pEp_MIME_fields_omitted + 1 )
} pEp_MIME_format;
typedef
enum _pEp_enc_format
{
pEp_enc_none = 0,
pEp_enc_pieces = ( pEp_enc_none + 1 ) ,
pEp_enc_S_MIME = ( pEp_enc_pieces + 1 ) ,
pEp_enc_PGP_MIME = ( pEp_enc_S_MIME + 1 ) ,
pEp_enc_pEp = ( pEp_enc_PGP_MIME + 1 )
} pEp_enc_format;
/* [uuid] */ struct DECLSPEC_UUID("1292C31A-6486-427F-B29F-7F03607836DC") opt_field
{
BSTR name;
BSTR value;
} ;
EXTERN_C const IID IID_ITextMessage;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("161538F9-53C8-4D9C-8BA4-0FB43AEC7106")
ITextMessage : public IUnknown
{
public:
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_dir(
/* [retval][out] */ pEp_msg_direction *pVal) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_dir(
/* [in] */ pEp_msg_direction newVal) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_id(
/* [retval][out] */ BSTR *pVal) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_id(
/* [in] */ BSTR newVal) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_shortmsg(
/* [retval][out] */ BSTR *pVal) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_shortmsg(
/* [in] */ BSTR newVal) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_longmsg(
/* [retval][out] */ BSTR *pVal) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_longmsg(
/* [in] */ BSTR newVal) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_longmsg_formatted(
/* [retval][out] */ BSTR *pVal) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_longmsg_formatted(
/* [in] */ BSTR newVal) = 0;
virtual HRESULT STDMETHODCALLTYPE add_attachment(
/* [in] */ SAFEARRAY * data,
/* [in] */ BSTR mime_type,
/* [in] */ BSTR filename) = 0;
virtual HRESULT STDMETHODCALLTYPE has_attachments(
/* [retval][out] */ boolean *result) = 0;
virtual HRESULT STDMETHODCALLTYPE next_attachment(
/* [out] */ SAFEARRAY * *data,
/* [out] */ BSTR *mime_type,
/* [out] */ BSTR *filename,
/* [retval][out] */ boolean *result) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_sent(
/* [retval][out] */ hyper *result) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_sent(
/* [in] */ hyper val) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_recv(
/* [retval][out] */ hyper *result) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_recv(
/* [in] */ hyper val) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_from(
/* [retval][out] */ struct pEp_identity_s *pVal) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_from(
/* [in] */ struct pEp_identity_s *newVal) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_to(
/* [retval][out] */ SAFEARRAY * *pVal) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_to(
/* [in] */ SAFEARRAY * newVal) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_recv_by(
/* [retval][out] */ struct pEp_identity_s *pVal) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_recv_by(
/* [in] */ struct pEp_identity_s *newVal) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cc(
/* [retval][out] */ SAFEARRAY * *pVal) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_cc(
/* [in] */ SAFEARRAY * newVal) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_bcc(
/* [retval][out] */ SAFEARRAY * *pVal) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_bcc(
/* [in] */ SAFEARRAY * newVal) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_reply_to(
/* [retval][out] */ SAFEARRAY * *pVal) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_reply_to(
/* [in] */ SAFEARRAY * newVal) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_references(
/* [retval][out] */ SAFEARRAY * *pVal) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_references(
/* [in] */ SAFEARRAY * newVal) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_keywords(
/* [retval][out] */ SAFEARRAY * *pVal) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_keywords(
/* [in] */ SAFEARRAY * newVal) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_comments(
/* [retval][out] */ BSTR *pVal) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_comments(
/* [in] */ BSTR newVal) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_opt_fields(
/* [retval][out] */ SAFEARRAY * *pVal) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_opt_fields(
/* [in] */ SAFEARRAY * newVal) = 0;
};
#else /* C style interface */
typedef struct ITextMessageVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ITextMessage * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ITextMessage * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ITextMessage * This);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_dir )(
ITextMessage * This,
/* [retval][out] */ pEp_msg_direction *pVal);
/* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_dir )(
ITextMessage * This,
/* [in] */ pEp_msg_direction newVal);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_id )(
ITextMessage * This,
/* [retval][out] */ BSTR *pVal);
/* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_id )(
ITextMessage * This,
/* [in] */ BSTR newVal);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_shortmsg )(
ITextMessage * This,
/* [retval][out] */ BSTR *pVal);
/* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_shortmsg )(
ITextMessage * This,
/* [in] */ BSTR newVal);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_longmsg )(
ITextMessage * This,
/* [retval][out] */ BSTR *pVal);
/* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_longmsg )(
ITextMessage * This,
/* [in] */ BSTR newVal);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_longmsg_formatted )(
ITextMessage * This,
/* [retval][out] */ BSTR *pVal);
/* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_longmsg_formatted )(
ITextMessage * This,
/* [in] */ BSTR newVal);
HRESULT ( STDMETHODCALLTYPE *add_attachment )(
ITextMessage * This,
/* [in] */ SAFEARRAY * data,
/* [in] */ BSTR mime_type,
/* [in] */ BSTR filename);
HRESULT ( STDMETHODCALLTYPE *has_attachments )(
ITextMessage * This,
/* [retval][out] */ boolean *result);
HRESULT ( STDMETHODCALLTYPE *next_attachment )(
ITextMessage * This,
/* [out] */ SAFEARRAY * *data,
/* [out] */ BSTR *mime_type,
/* [out] */ BSTR *filename,
/* [retval][out] */ boolean *result);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_sent )(
ITextMessage * This,
/* [retval][out] */ hyper *result);
/* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_sent )(
ITextMessage * This,
/* [in] */ hyper val);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_recv )(
ITextMessage * This,
/* [retval][out] */ hyper *result);
/* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_recv )(
ITextMessage * This,
/* [in] */ hyper val);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_from )(
ITextMessage * This,
/* [retval][out] */ struct pEp_identity_s *pVal);
/* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_from )(
ITextMessage * This,
/* [in] */ struct pEp_identity_s *newVal);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_to )(