home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / postal.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  6.0 KB  |  157 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. /******************************************************************************
  20.                                     POSTAL
  21.  ******************************************************************************
  22.  Here is the defintion of Netscape's Postal Services API.  This interface 
  23.  provides a service abstraction that allows a client to send and receive mail
  24.  messages.  The fact that Extended MAPI (ie., Exchange) is being used is
  25.  entirely encapsulated and transparent to the caller.  The implementation
  26.  could be extended to support other messaging technologies without a change 
  27.  to this API.  Thus, Netscape's native (Internet) messaging code could be
  28.  integrated into this implementation to establish a single mail-enabling API.
  29.  
  30.  The following functions comprise the API:
  31.     
  32.      RegisterMailClient     - This function establishes the caller as a client 
  33.                               of the POSTAL services.
  34.  
  35.      UnRegisterMailClient   - This function discontinues the caller's use of
  36.                               the postal services.  Any active session is
  37.                               closed automatically, prior to termination.
  38.  
  39.      OpenMailSession        - Creates a POSTAL session.
  40.  
  41.      CloseMailSession       - Destroys a POSTAL session.
  42.  
  43.      ComposeMailMessage     - Composes and sends a mail message.
  44.  
  45.      ShowMailBox            - Shows the applications mailbox i.e. InBox
  46.      
  47.      ShowMessageCenter        - Shows the applications message center(if any)
  48.  
  49.      GetMenuItemString        - Called to retrieve the menu item string to be
  50.                               in Netscape Navigator's menu.
  51.  
  52.  The rules of engagement are simple.  You must register yourself as a client
  53.  before you can establish a session.  You must establish a session before you
  54.  can send a message.  Disengagement is just the reverse.  
  55.  
  56.  ******************************************************************************/
  57.  
  58. #ifndef _POSTAL_H
  59. #define _POSTAL_H
  60.  
  61. #ifdef WIN32
  62. #  define EXPORT16 PASCAL
  63. #  ifdef __cplusplus
  64. #    define EXPORT32 extern "C" __declspec(dllexport)
  65. #  else
  66. #    define EXPORT32 extern __declspec(dllexport)
  67. #  endif
  68. #else
  69. #  define EXPORT16 FAR PASCAL _export
  70. #  ifdef __cplusplus
  71. #    define EXPORT32 extern "C"
  72. #  else
  73. #    define EXPORT32 extern
  74. #  endif
  75. #endif
  76.  
  77.  
  78. //----------------------------------------------------------
  79. //                    Menu String Types
  80. //----------------------------------------------------------
  81. typedef enum {
  82.     ALTMAIL_MenuMailBox,
  83.     ALTMAIL_MenuMessageCenter
  84. } ALTMAIL_MENU_ID;
  85.  
  86. //----------------------------------------------------------
  87. //                    Return codes                           
  88. //----------------------------------------------------------
  89. typedef LONG POSTCODE;
  90.  
  91. #define POST_W_ALREADY_OPEN         1
  92. #define POST_OK                     0
  93. #define POST_E_FAILED              -1
  94. #define POST_E_BAD_HWND            -2
  95. #define POST_E_UNREGISTERED        -3
  96. #define POST_E_MAPI_INIT           -4
  97. #define POST_E_OLE_INIT            -5
  98. #define POST_E_USER_CANCEL         -6
  99. #define POST_E_NO_MSG_STORE        -7
  100. #define POST_E_CREATE_MSG_FAILED   -8
  101. #define POST_E_FORM_FAILED         -9
  102. #define POST_E_NO_MEMORY           -10
  103. #define POST_E_BAD_SZMSG           -11
  104. #define POST_E_BAD_MSGID           -12
  105. #define POST_E_NO_SESSION          -13
  106. #define    POST_E_CANT_LAUNCH_UI       -14
  107. #define    POST_E_BAD_BUFFER           -15
  108. #define    POST_E_BAD_LEN               -16
  109.  
  110. #define POST_SUCCEEDED(pc) (pc >= 0)
  111. #define POST_FALIED(pc) (pc < 0)
  112.  
  113. //---------------------------------------------------------------------
  114. //An external mail client can notify Netscape Navigator of its inbox
  115. //status by sending a message to it by using the following values in the
  116. //wParam
  117. //
  118. //Netscape Navigator updates its status line to indicate the mail status
  119. //
  120. //Ex: SendMessage(hWnd, uMessageID, INBOX_STATE_NEWMAIL, 0L);
  121. //    Where
  122. //         hWnd = Window handle passed via RegisterMailClient
  123. //         uMessageID = RegisterWindowMessage(szMessage);
  124. //                      (szMessage is passed via RegisterMailClient)
  125. //----------------------------------------------------------------------
  126. #define    INBOX_STATE_NOMAIL    0
  127. #define    INBOX_STATE_UNKNOWN    1
  128. #define    INBOX_STATE_NEWMAIL    2
  129.  
  130. //---------------------------------------------------------------------
  131. // Interface definition.
  132. //---------------------------------------------------------------------
  133.  
  134. EXPORT32 POSTCODE EXPORT16 RegisterMailClient (HWND hwnd, LPSTR szMessage);
  135.  
  136. EXPORT32 POSTCODE EXPORT16 UnRegisterMailClient ();
  137.  
  138. EXPORT32 POSTCODE EXPORT16 OpenMailSession (LPSTR pszProfile, LPSTR pszPassword);
  139.  
  140. EXPORT32 POSTCODE EXPORT16 CloseMailSession ();
  141.  
  142. EXPORT32 POSTCODE EXPORT16 ComposeMailMessage (LPCSTR pszTo,
  143.                                      LPCSTR pszReference,
  144.                                      LPCSTR pszOrganization,
  145.                                      LPCSTR pszXURL,
  146.                                      LPCSTR pszSubject,
  147.                                      LPCSTR pszPage,
  148.                                      LPCSTR pszCc, 
  149.                                      LPCSTR pszBcc);
  150.  
  151. EXPORT32 POSTCODE EXPORT16 ShowMailBox();
  152.  
  153. EXPORT32 POSTCODE EXPORT16 ShowMessageCenter();
  154.                                                                                      
  155. EXPORT32 POSTCODE EXPORT16 GetMenuItemString(ALTMAIL_MENU_ID menuID, LPSTR lpszReturnBuffer, int cbBufLen); 
  156. #endif //_POSTAL_H
  157.