LibreOffice Module shell (master) 1
Macros | Typedefs | Functions | Variables
senddoc.cxx File Reference
#include <osl/diagnose.h>
#include <sal/macros.h>
#include <o3tl/char16_t2wchar_t.hxx>
#include <rtl/bootstrap.hxx>
#include <sfx2/strings.hrc>
#include <unotools/resmgr.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <wchar.h>
#include <windows.h>
#include <mapi.h>
#include <MapiUnicodeHelp.h>
#include <string>
#include <vector>
#include <sstream>
#include <stdexcept>
Include dependency graph for senddoc.cxx:

Go to the source code of this file.

Macros

#define WIN32_LEAN_AND_MEAN
 

Typedefs

typedef std::vector< MapiRecipDescW > MapiRecipientList_t
 
typedef std::vector< MapiFileDescW > MapiAttachmentList_t
 

Functions

static void dumpParameter ()
 
static std::wstring prefixEmailAddress (const std::wstring &aEmailAddress, const std::wstring &aPrefix=L"SMTP:")
 Add a prefix to an email address. More...
 
static void addRecipient (ULONG recipClass, const std::wstring &recipAddress, MapiRecipientList_t *pMapiRecipientList)
 
static void initRecipientList (MapiRecipientList_t *pMapiRecipientList)
 
static void initAttachmentList (MapiAttachmentList_t *pMapiAttachmentList)
 
static void initMapiOriginator (MapiRecipDescW *pMapiOriginator)
 
static void initMapiMessage (MapiRecipDescW *aMapiOriginator, MapiRecipientList_t &aMapiRecipientList, MapiAttachmentList_t &aMapiAttachmentList, MapiMessageW *pMapiMessage)
 
static bool isKnownParameter (const wchar_t *aParameterName)
 
static void initParameter (int argc, wchar_t *argv[])
 
static void ShowError (ULONG nMAPIResult)
 
int wmain (int argc, wchar_t *argv[])
 Main. More...
 

Variables

const int LEN_SMTP_PREFIX = 5
 
const wchar_t *const KnownParameters []
 

Macro Definition Documentation

◆ WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN

Definition at line 30 of file senddoc.cxx.

Typedef Documentation

◆ MapiAttachmentList_t

typedef std::vector<MapiFileDescW> MapiAttachmentList_t

Definition at line 47 of file senddoc.cxx.

◆ MapiRecipientList_t

typedef std::vector<MapiRecipDescW> MapiRecipientList_t

Definition at line 46 of file senddoc.cxx.

Function Documentation

◆ addRecipient()

static void addRecipient ( ULONG  recipClass,
const std::wstring &  recipAddress,
MapiRecipientList_t pMapiRecipientList 
)
static

Definition at line 87 of file senddoc.cxx.

References LEN_SMTP_PREFIX.

Referenced by initRecipientList().

◆ dumpParameter()

void dumpParameter ( )
static

Definition at line 427 of file senddoc.cxx.

Referenced by wmain().

◆ initAttachmentList()

static void initAttachmentList ( MapiAttachmentList_t pMapiAttachmentList)
static

Definition at line 120 of file senddoc.cxx.

Referenced by wmain().

◆ initMapiMessage()

static void initMapiMessage ( MapiRecipDescW *  aMapiOriginator,
MapiRecipientList_t aMapiRecipientList,
MapiAttachmentList_t aMapiAttachmentList,
MapiMessageW *  pMapiMessage 
)
static

Definition at line 155 of file senddoc.cxx.

Referenced by wmain().

◆ initMapiOriginator()

static void initMapiOriginator ( MapiRecipDescW *  pMapiOriginator)
static

Definition at line 145 of file senddoc.cxx.

Referenced by wmain().

◆ initParameter()

static void initParameter ( int  argc,
wchar_t *  argv[] 
)
static

Definition at line 199 of file senddoc.cxx.

References i, isKnownParameter(), prefixEmailAddress(), and sName.

Referenced by wmain().

◆ initRecipientList()

static void initRecipientList ( MapiRecipientList_t pMapiRecipientList)
static

Definition at line 102 of file senddoc.cxx.

References addRecipient().

Referenced by wmain().

◆ isKnownParameter()

static bool isKnownParameter ( const wchar_t *  aParameterName)
static

Definition at line 189 of file senddoc.cxx.

References KnownParameters.

Referenced by initParameter().

◆ prefixEmailAddress()

static std::wstring prefixEmailAddress ( const std::wstring &  aEmailAddress,
const std::wstring &  aPrefix = L"SMTP:" 
)
static

Add a prefix to an email address.

MAPI requires that email addresses have an 'SMTP:' prefix.

Parameters
aEmailAddress[in] the email address.
aPrefix[in] the prefix to be added to the email address.
Returns
the email address prefixed with the specified prefix.

Definition at line 79 of file senddoc.cxx.

Referenced by initParameter().

◆ ShowError()

static void ShowError ( ULONG  nMAPIResult)
static

Definition at line 262 of file senddoc.cxx.

References Translate::Create(), Translate::get(), and sMessage.

Referenced by wmain().

◆ wmain()

int wmain ( int  argc,
wchar_t *  argv[] 
)

Main.

NOTE: Because this is program only serves implementation purposes and should not be used by any end user the parameter checking is very limited. Every unknown parameter will be ignored.

Definition at line 364 of file senddoc.cxx.

References dumpParameter(), ex, initAttachmentList(), initMapiMessage(), initMapiOriginator(), initParameter(), initRecipientList(), and ShowError().

Variable Documentation

◆ KnownParameters

const wchar_t* const KnownParameters[]
Initial value:
=
{
L"--to",
L"--cc",
L"--bcc",
L"--from",
L"--subject",
L"--body",
L"--attach",
L"--mapi-dialog",
L"--mapi-logon-ui",
L"--langtag",
L"--bootstrap",
}

Definition at line 173 of file senddoc.cxx.

Referenced by isKnownParameter().

◆ LEN_SMTP_PREFIX

const int LEN_SMTP_PREFIX = 5

Definition at line 49 of file senddoc.cxx.

Referenced by addRecipient().