"Fossies" - the Fresh Open Source Software Archive

Member "dmd2/src/druntime/import/core/sys/windows/mapi.d" (20 Nov 2020, 5562 Bytes) of package /linux/misc/dmd.2.094.2.linux.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) D source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /**
    2  * Windows API header module
    3  *
    4  * Translated from MinGW Windows headers
    5  *
    6  * Authors: Stewart Gordon
    7  * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
    8  * Source: $(DRUNTIMESRC src/core/sys/windows/_mapi.d)
    9  */
   10 module core.sys.windows.mapi;
   11 version (Windows):
   12 @system:
   13 
   14 private import core.sys.windows.windef;
   15 
   16 // FIXME: check types and grouping of constants
   17 
   18 enum {
   19     SUCCESS_SUCCESS,
   20     MAPI_USER_ABORT,
   21     MAPI_E_USER_ABORT        = MAPI_USER_ABORT,
   22     MAPI_E_FAILURE,
   23     MAPI_E_LOGIN_FAILURE,
   24     MAPI_E_LOGON_FAILURE     = MAPI_E_LOGIN_FAILURE,
   25     MAPI_E_DISK_FULL         = 4,
   26     MAPI_E_INSUFFICIENT_MEMORY,
   27     MAPI_E_ACCESS_DENIED,
   28     MAPI_E_BLK_TOO_SMALL     = MAPI_E_ACCESS_DENIED, // = 6
   29     MAPI_E_TOO_MANY_SESSIONS = 8,
   30     MAPI_E_TOO_MANY_FILES,
   31     MAPI_E_TOO_MANY_RECIPIENTS,
   32     MAPI_E_ATTACHMENT_NOT_FOUND,
   33     MAPI_E_ATTACHMENT_OPEN_FAILURE,
   34     MAPI_E_ATTACHMENT_WRITE_FAILURE,
   35     MAPI_E_UNKNOWN_RECIPIENT,
   36     MAPI_E_BAD_RECIPTYPE,
   37     MAPI_E_NO_MESSAGES,
   38     MAPI_E_INVALID_MESSAGE,
   39     MAPI_E_TEXT_TOO_LARGE,
   40     MAPI_E_INVALID_SESSION,
   41     MAPI_E_TYPE_NOT_SUPPORTED,
   42     MAPI_E_AMBIGUOUS_RECIPIENT,
   43     MAPI_E_AMBIGUOUS_RECIP   = MAPI_E_AMBIGUOUS_RECIPIENT,
   44     MAPI_E_MESSAGE_IN_USE,
   45     MAPI_E_NETWORK_FAILURE,
   46     MAPI_E_INVALID_EDITFIELDS,
   47     MAPI_E_INVALID_RECIPS,
   48     MAPI_E_NOT_SUPPORTED  // = 26
   49 }
   50 
   51 enum {
   52     MAPI_ORIG,
   53     MAPI_TO,
   54     MAPI_CC,
   55     MAPI_BCC
   56 }
   57 
   58 enum MAPI_LOGON_UI          = 0x0001;
   59 enum MAPI_NEW_SESSION       = 0x0002;
   60 enum MAPI_FORCE_DOWNLOAD    = 0x1000;
   61 enum MAPI_LOGOFF_SHARED     = 0x0001;
   62 enum MAPI_LOGOFF_UI         = 0x0002;
   63 enum MAPI_DIALOG            = 0x0008;
   64 enum MAPI_UNREAD_ONLY       = 0x0020;
   65 enum MAPI_LONG_MSGID        = 0x4000;
   66 enum MAPI_GUARANTEE_FIFO    = 0x0100;
   67 enum MAPI_ENVELOPE_ONLY     = 0x0040;
   68 enum MAPI_PEEK              = 0x0080;
   69 enum MAPI_BODY_AS_FILE      = 0x0200;
   70 enum MAPI_SUPPRESS_ATTACH   = 0x0800;
   71 enum MAPI_AB_NOMODIFY       = 0x0400;
   72 enum MAPI_OLE               = 0x0001;
   73 enum MAPI_OLE_STATIC        = 0x0002;
   74 enum MAPI_UNREAD            = 0x0001;
   75 enum MAPI_RECEIPT_REQUESTED = 0x0002;
   76 enum MAPI_SENT              = 0x0004;
   77 
   78 alias uint FLAGS;
   79 alias uint* LPULONG;
   80 alias ULONG_PTR LHANDLE;
   81 alias ULONG_PTR* LPLHANDLE;
   82 
   83 struct MapiRecipDesc {
   84     ULONG  ulReserved;
   85     ULONG  ulRecipClass;
   86     LPSTR  lpszName;
   87     LPSTR  lpszAddress;
   88     ULONG  ulEIDSize;
   89     LPVOID lpEntryID;
   90 }
   91 alias MapiRecipDesc* lpMapiRecipDesc;
   92 
   93 struct MapiFileDesc {
   94     ULONG  ulReserved;
   95     ULONG  flFlags;
   96     ULONG  nPosition;
   97     LPSTR  lpszPathName;
   98     LPSTR  lpszFileName;
   99     LPVOID lpFileType;
  100 }
  101 alias MapiFileDesc* lpMapiFileDesc;
  102 
  103 struct MapiFileTagExt {
  104     ULONG  ulReserved;
  105     ULONG  cbTag;
  106     LPBYTE lpTag;
  107     ULONG  cbEncoding;
  108     LPBYTE lpEncoding;
  109 }
  110 alias MapiFileTagExt* lpMapiFileTagExt;
  111 
  112 struct MapiMessage {
  113     ULONG           ulReserved;
  114     LPSTR           lpszSubject;
  115     LPSTR           lpszNoteText;
  116     LPSTR           lpszMessageType;
  117     LPSTR           lpszDateReceived;
  118     LPSTR           lpszConversationID;
  119     FLAGS           flFlags;
  120     lpMapiRecipDesc lpOriginator;
  121     ULONG           nRecipCount;
  122     lpMapiRecipDesc lpRecips;
  123     ULONG           nFileCount;
  124     lpMapiFileDesc  lpFiles;
  125 }
  126 alias MapiMessage* lpMapiMessage;
  127 
  128 extern (Windows) {
  129     ULONG MAPILogon(ULONG_PTR, LPSTR, LPSTR, FLAGS, ULONG, LPLHANDLE);
  130     ULONG MAPISendMail(LHANDLE, ULONG_PTR, lpMapiMessage, FLAGS, ULONG);
  131     ULONG MAPISendDocuments(ULONG_PTR, LPSTR, LPSTR, LPSTR, ULONG);
  132     ULONG MAPIReadMail(LHANDLE, ULONG_PTR, LPSTR, FLAGS, ULONG, lpMapiMessage*);
  133     ULONG MAPIFindNext(LHANDLE, ULONG_PTR, LPSTR, LPSTR, FLAGS, ULONG, LPSTR);
  134     ULONG MAPIResolveName(LHANDLE, ULONG_PTR, LPSTR, FLAGS, ULONG,
  135       lpMapiRecipDesc*);
  136     ULONG MAPIAddress(LHANDLE, ULONG_PTR, LPSTR, ULONG, LPSTR, ULONG,
  137       lpMapiRecipDesc, FLAGS, ULONG, LPULONG, lpMapiRecipDesc*);
  138     ULONG MAPIFreeBuffer(LPVOID);
  139     ULONG MAPIDetails(LHANDLE, ULONG_PTR, lpMapiRecipDesc, FLAGS, ULONG);
  140     ULONG MAPISaveMail(LHANDLE, ULONG_PTR, lpMapiMessage lpszMessage, FLAGS,
  141       ULONG, LPSTR);
  142     ULONG MAPIDeleteMail(LHANDLE, ULONG_PTR, LPSTR, FLAGS, ULONG);
  143     ULONG MAPILogoff(LHANDLE, ULONG_PTR, FLAGS, ULONG);
  144     // Netscape extensions
  145     ULONG MAPIGetNetscapeVersion();
  146     ULONG MAPI_NSCP_SynchronizeClient(LHANDLE, ULONG);
  147 
  148     // Handles for use with GetProcAddress
  149     alias ULONG function(ULONG_PTR, LPSTR, LPSTR, FLAGS, ULONG, LPLHANDLE)
  150       LPMAPILOGON;
  151     alias ULONG function(LHANDLE, ULONG_PTR, lpMapiMessage, FLAGS, ULONG)
  152       LPMAPISENDMAIL;
  153     alias ULONG function(ULONG_PTR, LPSTR, LPSTR, LPSTR, ULONG)
  154       LPMAPISENDDOCUMENTS;
  155     alias ULONG function(LHANDLE, ULONG_PTR, LPSTR, FLAGS, ULONG, lpMapiMessage*)
  156       LPMAPIREADMAIL;
  157     alias ULONG function(LHANDLE, ULONG_PTR, LPSTR, LPSTR, FLAGS, ULONG, LPSTR)
  158       LPMAPIFINDNEXT;
  159     alias ULONG function(LHANDLE, ULONG_PTR, LPSTR, FLAGS, ULONG,
  160       lpMapiRecipDesc*) LPMAPIRESOLVENAME;
  161     alias ULONG function(LHANDLE, ULONG_PTR, LPSTR, ULONG, LPSTR, ULONG,
  162       lpMapiRecipDesc, FLAGS, ULONG, LPULONG, lpMapiRecipDesc*) LPMAPIADDRESS;
  163     alias ULONG function(LPVOID lpv) LPMAPIFREEBUFFER;
  164     alias ULONG function(LHANDLE, ULONG_PTR, lpMapiRecipDesc, FLAGS, ULONG)
  165       LPMAPIDETAILS;
  166     alias ULONG function(LHANDLE, ULONG_PTR, lpMapiMessage, FLAGS, ULONG, LPSTR)
  167       LPMAPISAVEMAIL;
  168     alias ULONG function(LHANDLE, ULONG_PTR, LPSTR, FLAGS, ULONG)
  169       LPMAPIDELETEMAIL;
  170     alias ULONG function(LHANDLE, ULONG_PTR, FLAGS, ULONG) LPMAPILOGOFF;
  171 }