1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22#ifndef __com_sun_star_system_XMailClient_idl__
23#define __com_sun_star_system_XMailClient_idl__
24
25#include <com/sun/star/uno/XInterface.idl>
26#include <com/sun/star/lang/IllegalArgumentException.idl>
27#include <com/sun/star/system/XMailMessage.idl>
28#include <com/sun/star/system/MailClientFlags.idl>
29
30module com { module sun { module star { module system {
31
32/** Specifies an interface for creating and sending email messages
33    through a mail client.
34 */
35interface XMailClient
36{
37    /** Create a mail message object that implements the interface
38        <type>XMailMessage</type>.
39
40        @returns
41            An object that implements the <type>XMailMessage</type> interface.
42    */
43    XMailMessage createMailMessage();
44
45    /** Sends a given mail message object that implements the interface
46        <type>XMailMessage</type>.
47
48        @param xMailMessage
49            Specifies a configured mail object to be sent.
50
51        @param aFlag
52            Specifies different flags that control the send process.
53            <p>Possible flags are specified in <type>MailClientFlags</type>.</p>
54            <p>If the flag <const scope="com::sun::star::system">MailClientFlags::NO_USER_INTERFACE</const>
55            is specified, a recipient address must have been specified for the
56            given <type>XMailMessage</type>.</p>
57
58        @throws com::sun::star::lang::IllegalArgumentException
59            <ul>
60                <li>If invalid or excluding flags have been specified.</li>
61                <li>The flag <const scope="com::sun::star::system">MailClientFlags::NO_USER_INTERFACE</const>
62                is specified and no recipient address has been specified for the
63                given <type>XMailMessage</type> object.</li>
64                <li>The parameter <type>XMailMessage</type> is <NULL/>.</li>
65            </ul>
66
67        @throws com::sun::star::uno::Exception
68            if an error occurs while sending the mail.
69            <p>The <member scope="com::sun::star::uno">Execption::Message</member>
70            may contain an error description.</p>
71    */
72    void sendMailMessage( [in] XMailMessage xMailMessage,
73                          [in] long aFlag )
74        raises( ::com::sun::star::lang::IllegalArgumentException,
75                ::com::sun::star::uno::Exception );
76};
77
78}; }; }; };
79
80#endif
81