mail.h
上传用户:hzhsqp
上传日期:2007-01-06
资源大小:1600k
文件大小:7k
源码类别:

IP电话/视频会议

开发平台:

Visual C++

  1. /*
  2.  * mail.h
  3.  *
  4.  * Electronic mail class.
  5.  *
  6.  * Portable Windows Library
  7.  *
  8.  * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
  9.  *
  10.  * The contents of this file are subject to the Mozilla Public License
  11.  * Version 1.0 (the "License"); you may not use this file except in
  12.  * compliance with the License. You may obtain a copy of the License at
  13.  * http://www.mozilla.org/MPL/
  14.  *
  15.  * Software distributed under the License is distributed on an "AS IS"
  16.  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
  17.  * the License for the specific language governing rights and limitations
  18.  * under the License.
  19.  *
  20.  * The Original Code is Portable Windows Library.
  21.  *
  22.  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
  23.  *
  24.  * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
  25.  * All Rights Reserved.
  26.  *
  27.  * Contributor(s): ______________________________________.
  28.  *
  29.  * $Log: mail.h,v $
  30.  * Revision 1.10  1999/02/16 08:10:33  robertj
  31.  * MSVC 6.0 compatibility changes.
  32.  *
  33.  * Revision 1.9  1998/11/30 02:55:18  robertj
  34.  * New directory structure
  35.  *
  36.  * Revision 1.8  1998/09/24 03:30:11  robertj
  37.  * Added open software license.
  38.  *
  39.  * Revision 1.7  1997/02/05 11:48:25  robertj
  40.  * Fixed compatibility with MSVC debug memory allocation macros.
  41.  *
  42.  * Revision 1.6  1996/08/08 10:09:05  robertj
  43.  * Directory structure changes for common files.
  44.  *
  45.  * Revision 1.5  1995/08/12 22:54:26  robertj
  46.  * GUI interface additions for mail.
  47.  *
  48.  * Revision 1.4  1995/07/02 01:22:47  robertj
  49.  * Changed mail to use CMC then MAPI if available.
  50.  *
  51.  * Revision 1.3  1995/06/17 00:49:16  robertj
  52.  * Changed name to simply PMail.
  53.  * Fixed types of MAPI calls.
  54.  *
  55.  * Revision 1.2  1995/04/01 08:04:40  robertj
  56.  * Added GUI support.
  57.  *
  58.  * Revision 1.1  1995/03/14 12:44:51  robertj
  59.  * Initial revision
  60.  *
  61.  */
  62. #ifndef _PMAIL
  63. #ifndef P_HAS_MAPI
  64. #define P_HAS_MAPI 1
  65. #endif
  66. #ifndef P_HAS_CMC
  67. #define P_HAS_CMC 1
  68. #endif
  69. #if P_HAS_MAPI
  70. #include <mapi.h>
  71. #endif
  72. #if P_HAS_CMC
  73. #include <xcmc.h>
  74. #endif
  75. #include "../../mail.h"
  76.   protected:
  77.     DWORD    sessionId;
  78.     DWORD    lastError;
  79.     unsigned hUserInterface;
  80.     BOOL LogOnCommonInterface(const char * username,
  81.                                   const char * password, const char * service);
  82. #if P_HAS_CMC
  83.     class CMCDLL : public PDynaLink
  84.     {
  85.       PCLASSINFO(CMCDLL, PDynaLink)
  86.       public:
  87.         CMCDLL();
  88.         CMC_return_code (FAR PASCAL *logon)(
  89.             CMC_string              service,
  90.             CMC_string              user,
  91.             CMC_string              password,
  92.             CMC_enum                character_set,
  93.             CMC_ui_id               ui_id,
  94.             CMC_uint16              caller_cmc_version,
  95.             CMC_flags               logon_flags,
  96.             CMC_session_id FAR      *session,
  97.             CMC_extension FAR       *logon_extensions
  98.         );
  99.         CMC_return_code (FAR PASCAL *logoff)(
  100.             CMC_session_id          session,
  101.             CMC_ui_id               ui_id,
  102.             CMC_flags               logoff_flags,
  103.             CMC_extension FAR       *logoff_extensions
  104.         );
  105.         CMC_return_code (FAR PASCAL *free_buf)(
  106.             CMC_buffer              memory
  107.         );
  108.         CMC_return_code (FAR PASCAL *query_configuration)(
  109.             CMC_session_id session,
  110.             CMC_enum item,
  111.             CMC_buffer                    reference,
  112.             CMC_extension FAR *config_extensions
  113.         );
  114.         CMC_return_code (FAR PASCAL *look_up)(
  115.             CMC_session_id          session,
  116.             CMC_recipient FAR       *recipient_in,
  117.             CMC_flags               look_up_flags,
  118.             CMC_ui_id               ui_id,
  119.             CMC_uint32 FAR          *count,
  120.             CMC_recipient FAR * FAR *recipient_out,
  121.             CMC_extension FAR       *look_up_extensions
  122.         );
  123.         CMC_return_code (FAR PASCAL *list)(
  124.             CMC_session_id          session,
  125.             CMC_string              message_type,
  126.             CMC_flags               list_flags,
  127.             CMC_message_reference   *seed,
  128.             CMC_uint32 FAR          *count,
  129.             CMC_ui_id               ui_id,
  130.             CMC_message_summary FAR * FAR *result,
  131.             CMC_extension FAR       *list_extensions
  132.         );
  133.         CMC_return_code (FAR PASCAL *send)(
  134.             CMC_session_id          session,
  135.             CMC_message FAR         *message,
  136.             CMC_flags               send_flags,
  137.             CMC_ui_id               ui_id,
  138.             CMC_extension FAR       *send_extensions
  139.         );
  140.         CMC_return_code (FAR PASCAL *read)(
  141.             CMC_session_id          session,
  142.             CMC_message_reference   *message_reference,
  143.             CMC_flags               read_flags,
  144.             CMC_message FAR * FAR   *message,
  145.             CMC_ui_id               ui_id,
  146.             CMC_extension FAR       *read_extensions
  147.         );
  148.         CMC_return_code (FAR PASCAL *act_on)(
  149.             CMC_session_id          session,
  150.             CMC_message_reference   *message_reference,
  151.             CMC_enum                operation,
  152.             CMC_flags               act_on_flags,
  153.             CMC_ui_id               ui_id,
  154.             CMC_extension FAR       *act_on_extensions
  155.         );
  156.     };
  157.     CMCDLL cmc;
  158. #endif
  159. #if P_HAS_MAPI
  160.     class MAPIDLL : public PDynaLink
  161.     {
  162.       PCLASSINFO(MAPIDLL, PDynaLink)
  163.       public:
  164.         MAPIDLL();
  165.         ULONG (FAR PASCAL *Logon)(HWND, LPCSTR, LPCSTR, FLAGS, ULONG, LPLHANDLE);
  166.         ULONG (FAR PASCAL *Logoff)(LHANDLE, HWND, FLAGS, ULONG);
  167.         ULONG (FAR PASCAL *SendMail)(LHANDLE, HWND, lpMapiMessage, FLAGS, ULONG);
  168.         ULONG (FAR PASCAL *SendDocuments)(HWND, LPSTR, LPSTR, LPSTR, ULONG);
  169.         ULONG (FAR PASCAL *FindNext)(LHANDLE, HWND, LPCSTR, LPCSTR, FLAGS, ULONG, LPSTR);
  170.         ULONG (FAR PASCAL *ReadMail)(LHANDLE, HWND, LPCSTR, FLAGS, ULONG, lpMapiMessage FAR *);
  171.         ULONG (FAR PASCAL *SaveMail)(LHANDLE, HWND, lpMapiMessage, FLAGS, ULONG, LPSTR);
  172.         ULONG (FAR PASCAL *DeleteMail)(LHANDLE, HWND, LPCSTR, FLAGS, ULONG);
  173.         ULONG (FAR PASCAL *FreeBuffer)(LPVOID);
  174.         ULONG (FAR PASCAL *Address)(LHANDLE, HWND, LPSTR, ULONG, LPSTR, ULONG, lpMapiRecipDesc, FLAGS, ULONG, LPULONG, lpMapiRecipDesc FAR *);
  175.         ULONG (FAR PASCAL *Details)(LHANDLE, HWND,lpMapiRecipDesc, FLAGS, ULONG);
  176.         ULONG (FAR PASCAL *ResolveName)(LHANDLE, HWND, LPCSTR, FLAGS, ULONG, lpMapiRecipDesc FAR *);
  177.     };
  178.     MAPIDLL mapi;
  179. #endif
  180. };
  181. #endif
  182. // End Of File ///////////////////////////////////////////////////////////////