home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / MSINC.PAK / MAPIFORM.H < prev    next >
C/C++ Source or Header  |  1995-08-29  |  28KB  |  633 lines

  1. /*
  2.  *  M A P I F O R M . H
  3.  *
  4.  *  Declarations of interfaces for clients and providers of MAPI
  5.  *  forms and form registries.
  6.  *
  7.  *  Copyright 1993-1995 Microsoft Corporation. All Rights Reserved.
  8.  */
  9.  
  10. #ifndef MAPIFORM_H
  11. #define MAPIFORM_H
  12.  
  13. /* Include common MAPI header files if they haven't been already. */
  14.  
  15. #ifndef MAPIDEFS_H
  16. #include <mapidefs.h>
  17. #include <mapicode.h>
  18. #include <mapiguid.h>
  19. #include <mapitags.h>
  20. #endif
  21.  
  22. #ifdef __BORLANDC__
  23.   #include <pshpack8.h>
  24. #endif
  25.  
  26. #ifndef BEGIN_INTERFACE
  27. #define BEGIN_INTERFACE
  28. #endif
  29.  
  30. #ifndef _MAC
  31. typedef const RECT FAR *LPCRECT;
  32. #endif
  33.  
  34. /* HFRMREG is an enumeration which represents a registry container.
  35.  * Microsoft reserves the values from 0 to 0x3FFF for its own use.
  36.  */
  37.  
  38. typedef ULONG HFRMREG;
  39.  
  40. #define HFRMREG_DEFAULT  0
  41. #define HFRMREG_LOCAL    1
  42. #define HFRMREG_PERSONAL 2
  43. #define HFRMREG_FOLDER   3
  44.  
  45. DECLARE_MAPI_INTERFACE_PTR(IPersistMessage, LPPERSISTMESSAGE);
  46. DECLARE_MAPI_INTERFACE_PTR(IMAPIMessageSite, LPMAPIMESSAGESITE);
  47. DECLARE_MAPI_INTERFACE_PTR(IMAPISession, LPMAPISESSION);
  48. DECLARE_MAPI_INTERFACE_PTR(IMAPIViewContext, LPMAPIVIEWCONTEXT);
  49. DECLARE_MAPI_INTERFACE_PTR(IMAPIViewAdviseSink, LPMAPIVIEWADVISESINK);
  50. DECLARE_MAPI_INTERFACE_PTR(IMAPIFormAdviseSink, LPMAPIFORMADVISESINK);
  51. DECLARE_MAPI_INTERFACE_PTR(IMAPIFormInfo, LPMAPIFORMINFO);
  52. DECLARE_MAPI_INTERFACE_PTR(IMAPIFormMgr, LPMAPIFORMMGR);
  53. DECLARE_MAPI_INTERFACE_PTR(IMAPIFormContainer, LPMAPIFORMCONTAINER);
  54. DECLARE_MAPI_INTERFACE_PTR(IMAPIForm, LPMAPIFORM);
  55. DECLARE_MAPI_INTERFACE_PTR(IMAPIFormFactory, LPMAPIFORMFACTORY);
  56.  
  57. typedef const char FAR *FAR * LPPCSTR;
  58. typedef LPMAPIFORMINFO FAR *LPPMAPIFORMINFO;
  59.  
  60. STDAPI MAPIOpenFormMgr(LPMAPISESSION pSession, LPMAPIFORMMGR FAR * ppmgr);
  61. STDAPI MAPIOpenLocalFormContainer(LPMAPIFORMCONTAINER FAR * ppfcnt);
  62.  
  63.  
  64. /*-- GetLastError ----------------------------------------------------------*/
  65. /* This defines the GetLastError method held in common by most mapiform
  66.  * interfaces.  It is defined separately so that an implementor may include
  67.  * more than one mapiform interface in a class.
  68.  */
  69.  
  70. #define MAPI_GETLASTERROR_METHOD(IPURE)                                 \
  71.     MAPIMETHOD(GetLastError) (THIS_                                     \
  72.         /*in*/  HRESULT hResult,                                        \
  73.     /*in*/  ULONG ulFlags,                                          \
  74.         /*out*/ LPMAPIERROR FAR * lppMAPIError) IPURE;                  \
  75.  
  76.  
  77. /*-- IPersistMessage -------------------------------------------------------*/
  78. /* This interface is implemented by forms and is used to save,
  79.  * initialize and load forms to and from messages.
  80.  */
  81.  
  82. #define MAPI_IPERSISTMESSAGE_METHODS(IPURE)                             \
  83.     MAPIMETHOD(GetClassID) (THIS_ LPCLSID lpClassID) IPURE;             \
  84.     MAPIMETHOD(IsDirty)(THIS) IPURE;                                    \
  85.     MAPIMETHOD(InitNew)(THIS_                                           \
  86.         /*in*/ LPMAPIMESSAGESITE pMessageSite,                          \
  87.         /*in*/ LPMESSAGE pMessage) IPURE;                               \
  88.     MAPIMETHOD(Load)(THIS_                                              \
  89.         /*in*/ LPMAPIMESSAGESITE pMessageSite,                          \
  90.         /*in*/ LPMESSAGE pMessage,                                      \
  91.         /*in*/ ULONG ulMessageStatus,                                   \
  92.         /*in*/ ULONG ulMessageFlags) IPURE;                             \
  93.     MAPIMETHOD(Save)(THIS_                                              \
  94.         /*in*/ LPMESSAGE pMessage,                                      \
  95.         /*in*/ ULONG fSameAsLoad) IPURE;                                \
  96.     MAPIMETHOD(SaveCompleted)(THIS_                                     \
  97.         /*in*/ LPMESSAGE pMessage) IPURE;                               \
  98.     MAPIMETHOD(HandsOffMessage)(THIS) IPURE;                            \
  99.  
  100. #undef INTERFACE
  101. #define INTERFACE IPersistMessage
  102. DECLARE_MAPI_INTERFACE_(IPersistMessage, IUnknown)
  103. {
  104.     BEGIN_INTERFACE
  105.     MAPI_IUNKNOWN_METHODS(PURE)
  106.     MAPI_GETLASTERROR_METHOD(PURE)
  107.     MAPI_IPERSISTMESSAGE_METHODS(PURE)
  108. };
  109.  
  110.  
  111. /*-- IMAPIMessageSite ------------------------------------------------------*/
  112.  
  113. #define MAPI_IMAPIMESSAGESITE_METHODS(IPURE)                            \
  114.     MAPIMETHOD(GetSession) (THIS_                                       \
  115.         /*out*/ LPMAPISESSION FAR * ppSession) IPURE;                   \
  116.     MAPIMETHOD(GetStore) (THIS_                                         \
  117.         /*out*/ LPMDB FAR * ppStore) IPURE;                             \
  118.     MAPIMETHOD(GetFolder) (THIS_                                        \
  119.         /*out*/ LPMAPIFOLDER FAR * ppFolder) IPURE;                     \
  120.     MAPIMETHOD(GetMessage) (THIS_                                       \
  121.         /*out*/ LPMESSAGE FAR * ppmsg) IPURE;                           \
  122.     MAPIMETHOD(GetFormManager) (THIS_                                   \
  123.         /*out*/ LPMAPIFORMMGR FAR * ppFormMgr) IPURE;                   \
  124.     MAPIMETHOD(NewMessage) (THIS_                                       \
  125.         /*in*/  ULONG fComposeInFolder,                                 \
  126.         /*in*/  LPMAPIFOLDER pFolderFocus,                              \
  127.         /*in*/  LPPERSISTMESSAGE pPersistMessage,                       \
  128.         /*out*/ LPMESSAGE FAR * ppMessage,                              \
  129.         /*out*/ LPMAPIMESSAGESITE FAR * ppMessageSite,                  \
  130.         /*out*/ LPMAPIVIEWCONTEXT FAR * ppViewContext) IPURE;           \
  131.     MAPIMETHOD(CopyMessage) (THIS_                                      \
  132.         /*in*/  LPMAPIFOLDER pFolderDestination) IPURE;                 \
  133.     MAPIMETHOD(MoveMessage) (THIS_                                      \
  134.         /*in*/  LPMAPIFOLDER pFolderDestination,                        \
  135.         /*in*/  LPMAPIVIEWCONTEXT pViewContext,                         \
  136.         /*in*/  LPCRECT prcPosRect) IPURE;                              \
  137.     MAPIMETHOD(DeleteMessage) (THIS_                                    \
  138.         /*in*/  LPMAPIVIEWCONTEXT pViewContext,                         \
  139.         /*in*/  LPCRECT prcPosRect) IPURE;                              \
  140.     MAPIMETHOD(SaveMessage) (THIS) IPURE;                               \
  141.     MAPIMETHOD(SubmitMessage) (THIS_                                    \
  142.         /*in*/ ULONG ulFlags) IPURE;                                    \
  143.     MAPIMETHOD(GetSiteStatus) (THIS_                                    \
  144.         /*out*/ LPULONG lpulStatus) IPURE;                              \
  145.  
  146. #undef INTERFACE
  147. #define INTERFACE IMAPIMessageSite
  148. DECLARE_MAPI_INTERFACE_(IMAPIMessageSite, IUnknown)
  149. {
  150.     BEGIN_INTERFACE
  151.     MAPI_IUNKNOWN_METHODS(PURE)
  152.     MAPI_GETLASTERROR_METHOD(PURE)
  153.     MAPI_IMAPIMESSAGESITE_METHODS(PURE)
  154. };
  155.  
  156.  
  157. /*-- IMAPIForm -------------------------------------------------------------*/
  158. /* This interface is implemented by forms for the benefit of viewers.
  159.  * One method (ShutdownForm) is provided such that simple forms implementing
  160.  * only IMAPIForm and IPersistMessage have reasonable embedding behavior.
  161.  */
  162.  
  163. #define MAPI_IMAPIFORM_METHODS(IPURE)                                   \
  164.     MAPIMETHOD(SetViewContext) (THIS_                                   \
  165.         /*in*/  LPMAPIVIEWCONTEXT pViewContext) IPURE;                  \
  166.     MAPIMETHOD(GetViewContext) (THIS_                                   \
  167.         /*out*/ LPMAPIVIEWCONTEXT FAR * ppViewContext) IPURE;           \
  168.     MAPIMETHOD(ShutdownForm)(THIS_                                             \
  169.         /*in*/  ULONG ulSaveOptions) IPURE;                             \
  170.     MAPIMETHOD(DoVerb) (THIS_                                           \
  171.         /*in*/  LONG iVerb,                                             \
  172.         /*in*/  LPMAPIVIEWCONTEXT lpViewContext, /* can be null */      \
  173.         /*in*/  ULONG hwndParent,                                       \
  174.         /*in*/  LPCRECT lprcPosRect) IPURE;                             \
  175.     MAPIMETHOD(Advise)(THIS_                                            \
  176.         /*in*/  LPMAPIVIEWADVISESINK pAdvise,                           \
  177.         /*out*/ ULONG FAR * pdwStatus) IPURE;                           \
  178.     MAPIMETHOD(Unadvise) (THIS_                                         \
  179.         /*in*/  ULONG ulConnection) IPURE;                              \
  180.  
  181. #undef INTERFACE
  182. #define INTERFACE IMAPIForm
  183. DECLARE_MAPI_INTERFACE_(IMAPIForm, IUnknown)
  184. {
  185.     BEGIN_INTERFACE
  186.     MAPI_IUNKNOWN_METHODS(PURE)
  187.     MAPI_GETLASTERROR_METHOD(PURE)
  188.     MAPI_IMAPIFORM_METHODS(PURE)
  189. };
  190.  
  191. typedef enum tagSAVEOPTS
  192. {
  193.     SAVEOPTS_SAVEIFDIRTY = 0,
  194.     SAVEOPTS_NOSAVE = 1,
  195.     SAVEOPTS_PROMPTSAVE = 2
  196. } SAVEOPTS;
  197.  
  198.  
  199. /*-- IMAPIViewContext ------------------------------------------------------*/
  200. /* Implemented by viewers to support next/previous in forms.
  201.  */
  202.  
  203. /* Structure passed in GetPrintSetup  */
  204.  
  205. typedef struct {
  206.     ULONG ulFlags;  /* MAPI_UNICODE */
  207.     HGLOBAL hDevMode;
  208.     HGLOBAL hDevNames;
  209.     ULONG ulFirstPageNumber;
  210.     ULONG fPrintAttachments;
  211. } FORMPRINTSETUP, FAR * LPFORMPRINTSETUP;
  212.  
  213. /* Values for pulFormat in GetSaveStream */
  214.  
  215. #define SAVE_FORMAT_TEXT                1
  216. #define SAVE_FORMAT_RICHTEXT            2
  217.  
  218. /* Values from 0 to 0x3fff are reserved for future definition by Microsoft */
  219.  
  220. #define MAPI_IMAPIVIEWCONTEXT_METHODS(IPURE)                            \
  221.     MAPIMETHOD(SetAdviseSink)(THIS_                                     \
  222.         /*in*/  LPMAPIFORMADVISESINK pmvns) IPURE;                      \
  223.     MAPIMETHOD(ActivateNext)(THIS_                                      \
  224.         /*in*/  ULONG ulDir,                                            \
  225.         /*in*/  LPCRECT prcPosRect) IPURE;                              \
  226.     MAPIMETHOD(GetPrintSetup)(THIS_                                     \
  227.         /*in*/  ULONG ulFlags,                                          \
  228.         /*out*/ LPFORMPRINTSETUP FAR * lppFormPrintSetup) IPURE;        \
  229.     MAPIMETHOD(GetSaveStream)(THIS_                                     \
  230.         /*out*/ ULONG FAR * pulFlags,                                   \
  231.         /*out*/ ULONG FAR * pulFormat,                                  \
  232.         /*out*/ LPSTREAM FAR * ppstm) IPURE;                            \
  233.     MAPIMETHOD(GetViewStatus) (THIS_                                    \
  234.         /*out*/ LPULONG lpulStatus) IPURE;                              \
  235.  
  236. #undef INTERFACE
  237. #define INTERFACE IMAPIViewContext
  238. DECLARE_MAPI_INTERFACE_(IMAPIViewContext, IUnknown)
  239. {
  240.     BEGIN_INTERFACE
  241.     MAPI_IUNKNOWN_METHODS(PURE)
  242.     MAPI_GETLASTERROR_METHOD(PURE)
  243.     MAPI_IMAPIVIEWCONTEXT_METHODS(PURE)
  244. };
  245.  
  246. #define VCSTATUS_NEXT                           0x00000001
  247. #define VCSTATUS_PREV                           0x00000002
  248. #define VCSTATUS_MODAL                          0x00000004
  249. #define VCSTATUS_INTERACTIVE                    0x00000008
  250. #define VCSTATUS_READONLY                       0x00000010
  251. #define VCSTATUS_DELETE                         0x00010000
  252. #define VCSTATUS_COPY                           0x00020000
  253. #define VCSTATUS_MOVE                           0x00040000
  254. #define VCSTATUS_SUBMIT                         0x00080000
  255. #define VCSTATUS_DELETE_IS_MOVE                 0x00100000
  256. #define VCSTATUS_SAVE                           0x00200000
  257. #define VCSTATUS_NEW_MESSAGE                    0x00400000
  258.  
  259. #define VCDIR_NEXT                              VCSTATUS_NEXT
  260. #define VCDIR_PREV                              VCSTATUS_PREV
  261. #define VCDIR_DELETE                            VCSTATUS_DELETE
  262. #define VCDIR_MOVE                              VCSTATUS_MOVE
  263.  
  264.  
  265. /*-- IMAPIFormAdviseSink ---------------------------------------------------*/
  266. /* Part of form server, held by view; receives notifications from the view.
  267.  *
  268.  * This part of the form server, but is not an interface on the form
  269.  * object.  This means that clients should not expect to QueryInterface
  270.  * from an IMAPIForm* or IOleObject* to this interface, or vice versa.
  271.  */
  272.  
  273. #define MAPI_IMAPIFORMADVISESINK_METHODS(IPURE)                         \
  274.     STDMETHOD(OnChange)(THIS_ ULONG ulDir) IPURE;                       \
  275.     STDMETHOD(OnActivateNext)(THIS_                                     \
  276.         /*in*/  LPCSTR lpszMessageClass,                                \
  277.         /*in*/  ULONG ulMessageStatus,                                  \
  278.         /*in*/  ULONG ulMessageFlags,                                   \
  279.         /*out*/ LPPERSISTMESSAGE FAR * ppPersistMessage) IPURE;         \
  280.  
  281. #undef INTERFACE
  282. #define INTERFACE IMAPIFormAdviseSink
  283. DECLARE_MAPI_INTERFACE_(IMAPIFormAdviseSink, IUnknown)
  284. {
  285.     BEGIN_INTERFACE
  286.     MAPI_IUNKNOWN_METHODS(PURE)
  287.     MAPI_IMAPIFORMADVISESINK_METHODS(PURE)
  288. };
  289.  
  290.  
  291. /*-- IMAPIViewAdviseSink ---------------------------------------------------*/
  292. /* Part of view context, held by form; receives notifications from the form.
  293.  */
  294.  
  295. #define MAPI_IMAPIVIEWADVISESINK_METHODS(IPURE)                         \
  296.     MAPIMETHOD(OnShutdown)(THIS) IPURE;                                    \
  297.     MAPIMETHOD(OnNewMessage)(THIS) IPURE;                               \
  298.     MAPIMETHOD(OnPrint)(THIS_                                           \
  299.         /*in*/ ULONG dwPageNumber,                                      \
  300.         /*in*/ HRESULT hrStatus) IPURE;                                 \
  301.     MAPIMETHOD(OnSubmitted) (THIS) IPURE;                               \
  302.     MAPIMETHOD(OnSaved) (THIS) IPURE;                                   \
  303.  
  304. #undef INTERFACE
  305. #define INTERFACE IMAPIViewAdviseSink
  306. DECLARE_MAPI_INTERFACE_(IMAPIViewAdviseSink, IUnknown)
  307. {
  308.     BEGIN_INTERFACE
  309.     MAPI_IUNKNOWN_METHODS(PURE)
  310.     MAPI_IMAPIVIEWADVISESINK_METHODS(PURE)
  311. };
  312.  
  313.  
  314. /*-- IMAPIFormInfo ---------------------------------------------------------*/
  315. /* Is implemented by registries.  Describes the form.
  316.  */
  317.  
  318. /* Single enum value */
  319.  
  320. typedef struct
  321. {                               /* fpev */
  322.     LPTSTR pszDisplayName;      /* carries the display string */
  323.     ULONG nVal;                 /* the value for the above enumeration */
  324. } SMAPIFormPropEnumVal, FAR * LPMAPIFORMPROPENUMVAL;
  325.  
  326. /* MAPI Form property descriptor */
  327.  
  328. /*
  329.  * Values for the tag in the SMAPIFormProp structure
  330.  *
  331.  * Microsoft reserves the range from 0 to 0x3FFF for future use in its other
  332.  * forms registry implementations.
  333.  */
  334.  
  335. typedef ULONG FORMPROPSPECIALTYPE;
  336.  
  337. #define FPST_VANILLA                    0
  338. #define FPST_ENUM_PROP                  1
  339.  
  340. typedef struct
  341. {
  342.     ULONG ulFlags;              /* Contains MAPI_UNICODE if strings are UNICODE */
  343.     ULONG nPropType;            /* type of the property, hiword is 0 */
  344.     MAPINAMEID nmid;            /* id of the property */
  345.     LPTSTR pszDisplayName;
  346.     FORMPROPSPECIALTYPE nSpecialType;   /* tag for the following union */
  347.     union
  348.     {
  349.         struct
  350.         {
  351.             MAPINAMEID nmidIdx;
  352.             ULONG cfpevAvailable;   /* # of enums */
  353.             LPMAPIFORMPROPENUMVAL pfpevAvailable;
  354.         } s1;                   /* Property String/Number association Enumeration */
  355.     } u;
  356. } SMAPIFormProp, FAR * LPMAPIFORMPROP;
  357.  
  358. /* Array of form properties */
  359.  
  360. typedef struct
  361. {
  362.     ULONG cProps;
  363.     ULONG ulPad;                /* Pad to 8-byte alignment for insurance */
  364.     SMAPIFormProp aFormProp[MAPI_DIM];
  365. } SMAPIFormPropArray, FAR * LPMAPIFORMPROPARRAY;
  366.  
  367. #define CbMAPIFormPropArray(_c) \
  368.          (offsetof(SMAPIFormPropArray, aFormProp) + \
  369.          (_c)*sizeof(SMAPIFormProp))
  370.  
  371. /* Structure defining the layout of an mapi verb description */
  372.  
  373. typedef struct
  374. {
  375.     LONG lVerb;
  376.     LPTSTR szVerbname;
  377.     DWORD fuFlags;
  378.     DWORD grfAttribs;
  379.     ULONG ulFlags;              /* Either 0 or MAPI_UNICODE */
  380. } SMAPIVerb, FAR * LPMAPIVERB;
  381.  
  382. /* Structure used for returning arrays of mapi verbs */
  383.  
  384. typedef struct
  385. {
  386.     ULONG cMAPIVerb;            /* Number of verbs in the structure */
  387.     SMAPIVerb aMAPIVerb[MAPI_DIM];
  388. } SMAPIVerbArray, FAR * LPMAPIVERBARRAY;
  389.  
  390. #define CbMAPIVerbArray(_c) \
  391.          (offsetof(SMAPIVerbArray, aMAPIVerb) + \
  392.          (_c)*sizeof(SMAPIVerb))
  393.  
  394. #define MAPI_IMAPIFORMINFO_METHODS(IPURE)                               \
  395.     MAPIMETHOD(CalcFormPropSet)(THIS_                                   \
  396.         /*in*/  ULONG ulFlags,                                          \
  397.         /*out*/ LPMAPIFORMPROPARRAY FAR * ppFormPropArray) IPURE;       \
  398.     MAPIMETHOD(CalcVerbSet)(THIS_                                       \
  399.         /*in*/  ULONG ulFlags,                                          \
  400.         /*out*/ LPMAPIVERBARRAY FAR * ppMAPIVerbArray) IPURE;           \
  401.     MAPIMETHOD(MakeIconFromBinary)(THIS_                                \
  402.         /*in*/ ULONG nPropID,                                           \
  403.         /*out*/ HICON FAR* phicon) IPURE;                               \
  404.     MAPIMETHOD(SaveForm)(THIS_                                          \
  405.         /*in*/ LPCTSTR szFileName) IPURE;                               \
  406.     MAPIMETHOD(OpenFormContainer)(THIS_                                 \
  407.         /*out*/ LPMAPIFORMCONTAINER FAR * ppformcontainer) IPURE;       \
  408.  
  409. #undef INTERFACE
  410. #define INTERFACE IMAPIFormInfo
  411. DECLARE_MAPI_INTERFACE_(IMAPIFormInfo, IMAPIProp)
  412. {
  413.     BEGIN_INTERFACE
  414.     MAPI_IUNKNOWN_METHODS(PURE)
  415.     MAPI_IMAPIPROP_METHODS(PURE)    /* note: subsumes getlasterror */
  416.     MAPI_IMAPIFORMINFO_METHODS(PURE)
  417. };
  418.  
  419.  
  420. /* Enumeration of permissible values for PR_FORM_MESSAGE_BEHAVIOR */
  421.  
  422. #define MAPI_MESSAGE_BEHAVIOR_IPM 0
  423. #define MAPI_MESSAGE_BEHAVIOR_FOLDER 1
  424.  
  425.  
  426. /*-- IMAPIFormMgr ----------------------------------------------------------*/
  427. /* The client-visible interface for form resolution and dispatch.
  428.  */
  429.  
  430. /* Structure containing an array of message class strings */
  431.  
  432. typedef struct
  433. {
  434.     ULONG cValues;
  435.     LPCSTR aMessageClass[MAPI_DIM];
  436. } SMessageClassArray, FAR * LPSMESSAGECLASSARRAY;
  437.  
  438. #define CbMessageClassArray(_c) \
  439.         (offsetof(SMessageClassArray, aMessageClass) + (_c)*sizeof(LPCSTR))
  440.  
  441. /* Structure containing an array of IMAPIFormInfo interfaces */
  442.  
  443. typedef struct
  444. {
  445.     ULONG cForms;
  446.     LPMAPIFORMINFO aFormInfo[MAPI_DIM];
  447. } SMAPIFormInfoArray, FAR * LPSMAPIFORMINFOARRAY;
  448.  
  449. #define CbMAPIFormInfoArray(_c) \
  450.          (offsetof(SMAPIFormInfoArray, aFormInfo) + \
  451.          (_c)*sizeof(LPMAPIFORMINFO))
  452.  
  453. /* Flags for IMAPIFormMgr::SelectFormContainer */
  454.  
  455. #define MAPIFORM_SELECT_ALL_REGISTRIES           0
  456. #define MAPIFORM_SELECT_FOLDER_REGISTRY_ONLY     1
  457. #define MAPIFORM_SELECT_NON_FOLDER_REGISTRY_ONLY 2
  458.  
  459. /* Flags for IMAPIFormMgr::CalcFormPropSet */
  460.  
  461. #define FORMPROPSET_UNION                 0
  462. #define FORMPROPSET_INTERSECTION          1
  463.  
  464. /* Flags for IMAPIFormMgr::ResolveMessageClass and
  465.    IMAPIFormMgr::ResolveMultipleMessageClasses */
  466.  
  467. #define MAPIFORM_EXACTMATCH             0x0020
  468.  
  469. #define MAPI_IMAPIFORMMGR_METHODS(IPURE)                                \
  470.     MAPIMETHOD(LoadForm)(THIS_                                          \
  471.         /*in*/  ULONG ulUIParam,                                        \
  472.         /*in*/  ULONG ulFlags,                                          \
  473.         /*in*/  LPCSTR lpszMessageClass,                                \
  474.         /*in*/  ULONG ulMessageStatus,                                  \
  475.         /*in*/  ULONG ulMessageFlags,                                   \
  476.         /*in*/  LPMAPIFOLDER pFolderFocus,                              \
  477.         /*in*/  LPMAPIMESSAGESITE pMessageSite,                         \
  478.         /*in*/  LPMESSAGE pmsg,                                         \
  479.         /*in*/  LPMAPIVIEWCONTEXT pViewContext,                         \
  480.         /*in*/  REFIID riid,                                            \
  481.         /*out*/ LPVOID FAR *ppvObj) IPURE;                              \
  482.     MAPIMETHOD(ResolveMessageClass)(THIS_                               \
  483.         /*in*/  LPCSTR szMsgClass,                                      \
  484.         /*in*/  ULONG ulFlags,                                          \
  485.         /*in*/  LPMAPIFOLDER pFolderFocus, /* can be null */            \
  486.         /*out*/ LPMAPIFORMINFO FAR* ppResult) IPURE;                    \
  487.     MAPIMETHOD(ResolveMultipleMessageClasses)(THIS_                     \
  488.         /*in*/  LPSMESSAGECLASSARRAY pMsgClasses,                       \
  489.         /*in*/  ULONG ulFlags,                                          \
  490.         /*in*/  LPMAPIFOLDER pFolderFocus, /* can be null */            \
  491.         /*out*/ LPSMAPIFORMINFOARRAY FAR * pfrminfoarray) IPURE;        \
  492.     MAPIMETHOD(CalcFormPropSet)(THIS_                                   \
  493.         /*in*/  LPSMAPIFORMINFOARRAY pfrminfoarray,                     \
  494.         /*in*/  ULONG ulFlags,                                          \
  495.         /*out*/ LPMAPIFORMPROPARRAY FAR* ppResults) IPURE;              \
  496.     MAPIMETHOD(CreateForm)(THIS_                                        \
  497.         /*in*/  ULONG ulUIParam,                                        \
  498.         /*in*/  ULONG ulFlags,                                          \
  499.         /*in*/  LPMAPIFORMINFO pfrminfoToActivate,                      \
  500.         /*in*/  REFIID refiidToAsk,                                     \
  501.         /*out*/ LPVOID FAR* ppvObj) IPURE;                              \
  502.     MAPIMETHOD(SelectForm)(THIS_                                        \
  503.         /*in*/  ULONG ulUIParam,                                        \
  504.         /*in*/  ULONG ulFlags,                                          \
  505.         /*in*/  LPCTSTR pszTitle,                                       \
  506.         /*in*/  LPMAPIFOLDER pfld,                                      \
  507.         /*out*/ LPMAPIFORMINFO FAR * ppfrminfoReturned) IPURE;          \
  508.     MAPIMETHOD(SelectMultipleForms)(THIS_                               \
  509.         /*in*/  ULONG ulUIParam,                                        \
  510.         /*in*/  ULONG ulFlags,                                          \
  511.         /*in*/  LPCTSTR pszTitle,                                       \
  512.         /*in*/  LPMAPIFOLDER pfld,                                      \
  513.         /*in*/  LPSMAPIFORMINFOARRAY pfrminfoarray,                     \
  514.         /*out*/ LPSMAPIFORMINFOARRAY FAR * ppfrminfoarray) IPURE;       \
  515.     MAPIMETHOD(SelectFormContainer)(THIS_                               \
  516.         /*in*/  ULONG ulUIParam,                                        \
  517.         /*in*/  ULONG ulFlags,                                          \
  518.         /*out*/ LPMAPIFORMCONTAINER FAR * lppfcnt) IPURE;               \
  519.     MAPIMETHOD(OpenFormContainer)(THIS_                                 \
  520.         /*in*/  HFRMREG hfrmreg,                                        \
  521.         /*in*/  LPUNKNOWN lpunk,                                        \
  522.         /*out*/ LPMAPIFORMCONTAINER FAR * lppfcnt) IPURE;               \
  523.     MAPIMETHOD(PrepareForm)(THIS_                                       \
  524.         /*in*/  ULONG ulUIParam,                                        \
  525.         /*in*/  ULONG ulFlags,                                          \
  526.         /*in*/  LPMAPIFORMINFO pfrminfo) IPURE;                         \
  527.     MAPIMETHOD(IsInConflict)(THIS_                                      \
  528.         /*in*/  ULONG ulMessageFlags,                                   \
  529.         /*in*/  ULONG ulMessageStatus,                                  \
  530.         /*in*/  LPCSTR szMessageClass,                                  \
  531.         /*in*/  LPMAPIFOLDER pFolderFocus) IPURE;                       \
  532.  
  533. #undef         INTERFACE
  534. #define         INTERFACE    IMAPIFormMgr
  535. DECLARE_MAPI_INTERFACE_(IMAPIFormMgr, IUnknown)
  536. {
  537.     BEGIN_INTERFACE
  538.     MAPI_IUNKNOWN_METHODS(PURE)
  539.     MAPI_GETLASTERROR_METHOD(PURE)
  540.     MAPI_IMAPIFORMMGR_METHODS(PURE)
  541. };
  542.  
  543. /* Platform numbers (used in .CFG files for forms) */
  544.  
  545. #define MAPIFORM_CPU_X86                1
  546. #define MAPIFORM_CPU_MIP                2
  547. #define MAPIFORM_CPU_AXP                3
  548. #define MAPIFORM_CPU_PPC                4
  549. #define MAPIFORM_CPU_M68                5
  550.  
  551. #define MAPIFORM_OS_WIN_31              1
  552. #define MAPIFORM_OS_WINNT_35            2
  553. #define MAPIFORM_OS_WIN_95              3
  554. #define MAPIFORM_OS_MAC_7x              4
  555.  
  556. #define MAPIFORM_PLATFORM(CPU, OS) ((ULONG) ((((ULONG) CPU) << 16) | OS))
  557.  
  558.  
  559. /*-- IMAPIFormContainer -------------------------------------------------*/
  560.  
  561. /*  Flags for IMAPIFormMgr::CalcFormPropSet */
  562.  
  563. /* #define FORMPROPSET_UNION            0   */
  564. /* #define FORMPROPSET_INTERSECTION     1   */
  565.  
  566. /*  Flags for IMAPIFormMgr::InstallForm     */
  567.  
  568. #define MAPIFORM_INSTALL_DIALOG                 MAPI_DIALOG
  569. #define MAPIFORM_INSTALL_OVERWRITEONCONFLICT    0x0010
  570.  
  571. /*  Flags for IMAPIFormContainer::ResolveMessageClass and
  572.     IMAPIFormContainer::ResolveMultipleMessageClasses */
  573. /* #define MAPIFORM_EXACTIMATCH    0x0020   */
  574.  
  575. #define MAPI_IMAPIFORMCONTAINER_METHODS(IPURE)                       \
  576.     MAPIMETHOD(InstallForm)(THIS_                                   \
  577.         /*in*/  ULONG ulUIParam,                                        \
  578.         /*in*/  ULONG ulFlags,                                          \
  579.         /*in*/  LPCTSTR szCfgPathName) IPURE;                           \
  580.     MAPIMETHOD(RemoveForm)(THIS_                                        \
  581.         /*in*/  LPCSTR szMessageClass) IPURE;                           \
  582.     MAPIMETHOD(ResolveMessageClass) (THIS_                              \
  583.         /*in*/  LPCSTR szMessageClass,                                  \
  584.         /*in*/  ULONG ulFlags,                                          \
  585.         /*out*/ LPMAPIFORMINFO FAR * pforminfo) IPURE;                  \
  586.     MAPIMETHOD(ResolveMultipleMessageClasses) (THIS_                    \
  587.         /*in*/  LPSMESSAGECLASSARRAY pMsgClassArray,                    \
  588.         /*in*/  ULONG ulFlags,                                          \
  589.         /*out*/ LPSMAPIFORMINFOARRAY FAR * ppfrminfoarray) IPURE;       \
  590.     MAPIMETHOD(CalcFormPropSet)(THIS_                                   \
  591.         /*in*/  ULONG ulFlags,                                          \
  592.         /*out*/ LPMAPIFORMPROPARRAY FAR * ppResults) IPURE;             \
  593.     MAPIMETHOD(GetDisplay)(THIS_                                        \
  594.         /*in*/  ULONG ulFlags,                                          \
  595.         /*out*/ LPTSTR FAR * pszDisplayName) IPURE;                     \
  596.  
  597. #undef INTERFACE
  598. #define INTERFACE IMAPIFormContainer
  599. DECLARE_MAPI_INTERFACE_(IMAPIFormContainer, IUnknown)
  600. {
  601.     BEGIN_INTERFACE
  602.     MAPI_IUNKNOWN_METHODS(PURE)
  603.     MAPI_GETLASTERROR_METHOD(PURE)
  604.     MAPI_IMAPIFORMCONTAINER_METHODS(PURE)
  605. };
  606.  
  607. /*-- IMAPIFormFactory ------------------------------------------------------*/
  608.  
  609. #define MAPI_IMAPIFORMFACTORY_METHODS(IPURE)                            \
  610.     MAPIMETHOD(CreateClassFactory) (THIS_                               \
  611.         /*in*/  REFCLSID clsidForm,                                     \
  612.         /*in*/  ULONG ulFlags,                                          \
  613.         /*out*/ LPCLASSFACTORY FAR * lppClassFactory) IPURE;            \
  614.     MAPIMETHOD(LockServer) (THIS_                                       \
  615.         /*in*/  ULONG ulFlags,                                          \
  616.         /*in*/  ULONG fLockServer) IPURE;                               \
  617.  
  618. #undef INTERFACE
  619. #define INTERFACE IMAPIFormFactory
  620. DECLARE_MAPI_INTERFACE_(IMAPIFormFactory, IUnknown)
  621. {
  622.     BEGIN_INTERFACE
  623.     MAPI_IUNKNOWN_METHODS(PURE)
  624.     MAPI_GETLASTERROR_METHOD(PURE)
  625.     MAPI_IMAPIFORMFACTORY_METHODS(PURE)
  626. };
  627. #ifdef __BORLANDC__
  628.   #include <poppack.h>
  629. #endif
  630.  
  631.  
  632. #endif                          /* MAPIFORM_H */
  633.