xref: /AOO41X/main/shell/source/win32/sysmail/sysmapi.hxx (revision ae77b8ca51259f12d779952d8788b8452d558527)
1*ae77b8caSAriel Constenla-Haile /**************************************************************
2*ae77b8caSAriel Constenla-Haile  *
3*ae77b8caSAriel Constenla-Haile  * Licensed to the Apache Software Foundation (ASF) under one
4*ae77b8caSAriel Constenla-Haile  * or more contributor license agreements.  See the NOTICE file
5*ae77b8caSAriel Constenla-Haile  * distributed with this work for additional information
6*ae77b8caSAriel Constenla-Haile  * regarding copyright ownership.  The ASF licenses this file
7*ae77b8caSAriel Constenla-Haile  * to you under the Apache License, Version 2.0 (the
8*ae77b8caSAriel Constenla-Haile  * "License"); you may not use this file except in compliance
9*ae77b8caSAriel Constenla-Haile  * with the License.  You may obtain a copy of the License at
10*ae77b8caSAriel Constenla-Haile  *
11*ae77b8caSAriel Constenla-Haile  *   http://www.apache.org/licenses/LICENSE-2.0
12*ae77b8caSAriel Constenla-Haile  *
13*ae77b8caSAriel Constenla-Haile  * Unless required by applicable law or agreed to in writing,
14*ae77b8caSAriel Constenla-Haile  * software distributed under the License is distributed on an
15*ae77b8caSAriel Constenla-Haile  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ae77b8caSAriel Constenla-Haile  * KIND, either express or implied.  See the License for the
17*ae77b8caSAriel Constenla-Haile  * specific language governing permissions and limitations
18*ae77b8caSAriel Constenla-Haile  * under the License.
19*ae77b8caSAriel Constenla-Haile  *
20*ae77b8caSAriel Constenla-Haile  *************************************************************/
21*ae77b8caSAriel Constenla-Haile 
22*ae77b8caSAriel Constenla-Haile #ifndef INCLUDED_SIMPLEMAPI_HXX
23*ae77b8caSAriel Constenla-Haile #define INCLUDED_SIMPLEMAPI_HXX
24*ae77b8caSAriel Constenla-Haile 
25*ae77b8caSAriel Constenla-Haile #define WIN32_LEAN_AND_MEAN
26*ae77b8caSAriel Constenla-Haile #if defined _MSC_VER
27*ae77b8caSAriel Constenla-Haile #pragma warning(push, 1)
28*ae77b8caSAriel Constenla-Haile #endif
29*ae77b8caSAriel Constenla-Haile #include <windows.h>
30*ae77b8caSAriel Constenla-Haile #include <mapi.h>
31*ae77b8caSAriel Constenla-Haile #ifndef __MINGW32__
32*ae77b8caSAriel Constenla-Haile #include <mapix.h>
33*ae77b8caSAriel Constenla-Haile #endif
34*ae77b8caSAriel Constenla-Haile #if defined _MSC_VER
35*ae77b8caSAriel Constenla-Haile #pragma warning(pop)
36*ae77b8caSAriel Constenla-Haile #endif
37*ae77b8caSAriel Constenla-Haile 
38*ae77b8caSAriel Constenla-Haile namespace shell
39*ae77b8caSAriel Constenla-Haile {
40*ae77b8caSAriel Constenla-Haile     class WinSysMapi
41*ae77b8caSAriel Constenla-Haile     {
42*ae77b8caSAriel Constenla-Haile     public:
43*ae77b8caSAriel Constenla-Haile         /**
44*ae77b8caSAriel Constenla-Haile             @throws std::runtime_error
45*ae77b8caSAriel Constenla-Haile             if either the mapi32.dll could not be loaded at all
46*ae77b8caSAriel Constenla-Haile             or necessary function exports are missing
47*ae77b8caSAriel Constenla-Haile         */
48*ae77b8caSAriel Constenla-Haile         WinSysMapi(); // throws std::runtime_error;
49*ae77b8caSAriel Constenla-Haile 
50*ae77b8caSAriel Constenla-Haile         ~WinSysMapi();
51*ae77b8caSAriel Constenla-Haile 
52*ae77b8caSAriel Constenla-Haile         ULONG MAPILogon(
53*ae77b8caSAriel Constenla-Haile             ULONG ulUIParam,
54*ae77b8caSAriel Constenla-Haile             LPTSTR lpszProfileName,
55*ae77b8caSAriel Constenla-Haile             LPTSTR lpszPassword,
56*ae77b8caSAriel Constenla-Haile             FLAGS flFlags,
57*ae77b8caSAriel Constenla-Haile             ULONG ulReserved,
58*ae77b8caSAriel Constenla-Haile             LPLHANDLE lplhSession );
59*ae77b8caSAriel Constenla-Haile 
60*ae77b8caSAriel Constenla-Haile         ULONG MAPILogoff(
61*ae77b8caSAriel Constenla-Haile             LHANDLE lhSession,
62*ae77b8caSAriel Constenla-Haile             ULONG ulUIParam,
63*ae77b8caSAriel Constenla-Haile             FLAGS flFlags,
64*ae77b8caSAriel Constenla-Haile             ULONG ulReserved );
65*ae77b8caSAriel Constenla-Haile 
66*ae77b8caSAriel Constenla-Haile         ULONG MAPISendMail(
67*ae77b8caSAriel Constenla-Haile             LHANDLE lhSession,
68*ae77b8caSAriel Constenla-Haile             ULONG ulUIParam,
69*ae77b8caSAriel Constenla-Haile             lpMapiMessage lpMessage,
70*ae77b8caSAriel Constenla-Haile             FLAGS flFlags,
71*ae77b8caSAriel Constenla-Haile             ULONG ulReserved );
72*ae77b8caSAriel Constenla-Haile 
73*ae77b8caSAriel Constenla-Haile     private:
74*ae77b8caSAriel Constenla-Haile         HMODULE         m_hMapiDll;
75*ae77b8caSAriel Constenla-Haile         LPMAPILOGON     m_lpfnMapiLogon;
76*ae77b8caSAriel Constenla-Haile         LPMAPILOGOFF    m_lpfnMapiLogoff;
77*ae77b8caSAriel Constenla-Haile         LPMAPISENDMAIL  m_lpfnMapiSendMail;
78*ae77b8caSAriel Constenla-Haile     };
79*ae77b8caSAriel Constenla-Haile }
80*ae77b8caSAriel Constenla-Haile #endif
81