merged tag ooo/OOO330_m14
[LibreOffice.git] / offapi / com / sun / star / mail / XMailServer.idl
blob8d0ad232ed61bb26c30b833654b4878989e0c3e4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef __com_sun_star_mail_XMailServer_idl__
29 #define __com_sun_star_mail_XMailServer_idl__
31 #ifndef __com_sun_star_uno_XInterface_idl__
32 #include <com/sun/star/uno/XInterface.idl>
33 #endif
35 #ifndef __com_sun_star_mail_XAuthenticator_idl__
36 #include <com/sun/star/mail/XAuthenticator.idl>
37 #endif
39 #ifndef __com_sun_star_mail_XMailMessage_idl__
40 #include <com/sun/star/mail/XMailMessage.idl>
41 #endif
43 #ifndef __com_sun_star_auth_AuthenticationFailedException_idl__
44 #include <com/sun/star/auth/AuthenticationFailedException.idl>
45 #endif
47 #ifndef __com_sun_star_io_AlreadyConnectedException_idl__
48 #include <com/sun/star/io/AlreadyConnectedException.idl>
49 #endif
51 #ifndef __com_sun_star_io_NotConnectedException_idl__
52 #include <com/sun/star/io/NotConnectedException.idl>
53 #endif
55 #ifndef __com_sun_star_io_UnknownHostException_idl__
56 #include <com/sun/star/io/UnknownHostException.idl>
57 #endif
59 #ifndef __com_sun_star_io_NoRouteToHostException_idl__
60 #include <com/sun/star/io/NoRouteToHostException.idl>
61 #endif
63 #ifndef __com_sun_star_io_ConnectException_idl__
64 #include <com/sun/star/io/ConnectException.idl>
65 #endif
67 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
68 #include <com/sun/star/lang/IllegalArgumentException.idl>
69 #endif
71 #ifndef __com_sun_star_ucb_InteractiveIOException_idl__
72 #include <com/sun/star/ucb/InteractiveIOException.idl>
73 #endif
75 #ifndef __com_sun_star_mail_MailException_idl__
76 #include <com/sun/star/mail/MailException.idl>
77 #endif
79 #ifndef __com_sun_star_mail_SendMailMessageFailedException_idl__
80 #include <com/sun/star/mail/SendMailMessageFailedException.idl>
81 #endif
83 #ifndef __com_sun_star_mail_XConnectionListener_idl__
84 #include <com/sun/star/mail/XConnectionListener.idl>
85 #endif
87 #ifndef __com_sun_star_datatransfer_UnsupportedFlavorException_idl__
88 #include <com/sun/star/datatransfer/UnsupportedFlavorException.idl>
89 #endif
91 module com { module sun { module star { module mail {
93 /**
94 Represents a mail server abstraction.
96 @see com::sun::star::mail::XMailMessage
98 @since OOo 2.0.0
100 interface XMailServer: ::com::sun::star::uno::XInterface {
103 The complete domain name of the mail server.
105 [attribute, readonly] string Name;
108 The port number that will be used to connect to the mail server.
109 If no port number has been set the default port number 25 will
110 be used.
112 [attribute] long Port;
115 Returns all connection types which are supported by the
116 mail server. Possible connection types are for instance
117 secure connections like 'SSL' or 'TLS'.
119 @returns
120 a sequence of supported connection types.
122 sequence<string> getSupportedConnectionTypes();
125 Set the connection type that will be used to connect to the
126 mail server. The supported connection types may be queried
127 using <code>getSupportedConnectionTypes()</code>.
128 If no connection types has explicitly been set the default
129 connection type will be used.
131 @param sConnectionType
132 [in] identifies the connection that should be used to connect
133 to the mail server.
135 @throws com::sun::star::lang::IllegalArgumentException
136 if the provided connection type is not supported.
138 @see getSupportedConnectionTypes
139 @see isConnectionTypeSupported
141 void setConnectionType([in] string sConnectionType)
142 raises (com::sun::star::lang::IllegalArgumentException);
145 Allow a client to query if a certain connection type is
146 supported.
148 @param sConnectionType
149 [in] query if a certain connection type is supported.
151 @returns
152 <TRUE/> if the specified connection type is supported.
154 boolean isConnectionTypeSupported([in] string sConnectionType);
157 Register a connection listener.
159 @param xListener
160 [in] a listener that will be informed about connection events.
162 @see com::sun::star::mail::XConnectionListener
164 void addConnectionListener([in] XConnectionListener xListener);
167 Unregister a connection listener.
169 @param xListener
170 [in] a listener that no longer need to be informed about connection events.
172 @see com::sun::star::mail::XConnectionListener
174 void removeConnectionListener([in] XConnectionListener xListener);
177 Login a user to the mail server. Only one user may logged in
178 at a time. An attempt to login while another user is logged in
179 causes an exception to be thrown.
181 @param xAuthenticator
182 [in] an interface used to query for the necessary user information
183 needed to login to the mail server.
185 @throws com::sun::star::io::AlreadyConnectedException
186 on a try to connect to an already connect mail server.
188 @throws com::sun::star::io::UnknownHostException
189 usually if the IP address of the mail server could not be
190 determined. Possible causes are a broken network connection,
191 a wrong server name, an unreachable DNS server, etc.
193 @throws com::sun::star::io::NoRouteToHostException
194 if an error occured to connect to the remote mail server.
195 Typically the remote mail server cannot be reach because of an
196 intervening firewall, or if an intermediate router is down,
197 the network connection is broken, etc.
199 @throws com::sun::star::io::ConnectException
200 if an error occured while attempting to connect to the remote
201 mail server. Typically the connection was refused remotely,
202 because the mail server is not listening on the remote address/port.
204 @throws com::sun::star::auth::AuthenticationException
205 if the specified user could not be logged in.
207 @throws com::sun::star::mail::IllegalStateException
208 if a user is currently logged in.
210 @throws com::sun::star::mail::MailException
211 for other errors during login.
213 @see com::sun::star::mail::XAuthenticator
214 @see com::sun::star::io::AlreadyConnectedException
215 @see com::sun::star::io::UnknownHostException
216 @see com::sun::star::io::NoRouteToHostException
217 @see com::sun::star::io::ConnectException
218 @see com::sun::star::auth::AuthenticationException
219 @see com::sun::star::mail::IllegalStateException
220 @see com::sun::star::mail::MailException
222 void connectUser([in] XAuthenticator xAuthenticator)
223 raises(com::sun::star::io::AlreadyConnectedException,
224 com::sun::star::io::UnknownHostException,
225 com::sun::star::io::NoRouteToHostException,
226 com::sun::star::io::ConnectException,
227 com::sun::star::auth::AuthenticationFailedException,
228 com::sun::star::mail::MailException);
231 Logoff the currently logged in user.
233 @throws com::sun::star::mail::MessagingException
234 if errors occur during logoff.
236 void disconnectUser()
237 raises(com::sun::star::mail::MailException);
240 Returns whether a user is currently logged in to the mail server or not.
242 @returns
243 <TRUE/> if a user is currently logged in to the mail server.
245 boolean isUserConnected();
248 Send a mail message to its recipients.
250 @throws com::sun::star::io::NotConnectedException
251 if no user is currently connected to the mail server.
253 @throws com::sun::star::mail::SendMailMessageFailedException
254 if the message could not be sent because of invalid recipient
255 addresses. The e-mail addresses of recipients have to conform to
256 <a href="http://www.ietf.org/rfc/rfc822.txt">RFC&nbsp;822</a>.
258 @throws com::sun::star::mail::MailException
259 is thrown on other errors that may happen during sending.
260 A possible reason may be for instance that a file attachment
261 specified in a mail message could not be found or accessed.
263 @throws com::sun::star::datatransfer::UnsupportedFlavorException
264 is thrown when the body of the mail message is provided in an
265 unsupported mime content type or may be thrown if one of the file
266 attachments specifies an unspupported mime content type.
268 @see com::sun::star::io::NotConnectedExceptionException
269 @see com::sun::star::mail::SendMailMessageFailedException
270 @see com::sun::star::mail::MailException
271 @see com::sun::star::datatransfer::UnsupportedFlavorException
273 void sendMailMessage([in] XMailMessage xMailMessage)
274 raises(com::sun::star::io::NotConnectedException, com::sun::star::mail::SendMailMessageFailedException, com::sun::star::mail::MailException, com::sun::star::datatransfer::UnsupportedFlavorException);
277 }; }; }; };
279 #endif