1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XMailServer.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __com_sun_star_mail_XMailServer_idl__
32 #define __com_sun_star_mail_XMailServer_idl__
34 #ifndef __com_sun_star_uno_XInterface_idl__
35 #include
<com
/sun
/star
/uno
/XInterface.idl
>
38 #ifndef __com_sun_star_mail_XAuthenticator_idl__
39 #include
<com
/sun
/star
/mail
/XAuthenticator.idl
>
42 #ifndef __com_sun_star_mail_XMailMessage_idl__
43 #include
<com
/sun
/star
/mail
/XMailMessage.idl
>
46 #ifndef __com_sun_star_auth_AuthenticationFailedException_idl__
47 #include
<com
/sun
/star
/auth
/AuthenticationFailedException.idl
>
50 #ifndef __com_sun_star_io_AlreadyConnectedException_idl__
51 #include
<com
/sun
/star
/io
/AlreadyConnectedException.idl
>
54 #ifndef __com_sun_star_io_NotConnectedException_idl__
55 #include
<com
/sun
/star
/io
/NotConnectedException.idl
>
58 #ifndef __com_sun_star_io_UnknownHostException_idl__
59 #include
<com
/sun
/star
/io
/UnknownHostException.idl
>
62 #ifndef __com_sun_star_io_NoRouteToHostException_idl__
63 #include
<com
/sun
/star
/io
/NoRouteToHostException.idl
>
66 #ifndef __com_sun_star_io_ConnectException_idl__
67 #include
<com
/sun
/star
/io
/ConnectException.idl
>
70 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
71 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
74 #ifndef __com_sun_star_ucb_InteractiveIOException_idl__
75 #include
<com
/sun
/star
/ucb
/InteractiveIOException.idl
>
78 #ifndef __com_sun_star_mail_MailException_idl__
79 #include
<com
/sun
/star
/mail
/MailException.idl
>
82 #ifndef __com_sun_star_mail_SendMailMessageFailedException_idl__
83 #include
<com
/sun
/star
/mail
/SendMailMessageFailedException.idl
>
86 #ifndef __com_sun_star_mail_XConnectionListener_idl__
87 #include
<com
/sun
/star
/mail
/XConnectionListener.idl
>
90 #ifndef __com_sun_star_datatransfer_UnsupportedFlavorException_idl__
91 #include
<com
/sun
/star
/datatransfer
/UnsupportedFlavorException.idl
>
94 module com
{ module sun
{ module star
{ module mail
{
97 Represents a mail server abstraction.
99 @see com::sun::star::mail::XMailMessage
103 interface XMailServer
: ::com
::sun
::star
::uno
::XInterface
{
106 The complete domain name of the mail server.
108 [attribute
, readonly] string Name
;
111 The port number that will be used to connect to the mail server.
112 If no port number has been set the default port number 25 will
115 [attribute
] long Port
;
118 Returns all connection types which are supported by the
119 mail server. Possible connection types are for instance
120 secure connections like 'SSL' or 'TLS'.
123 a sequence of supported connection types.
125 sequence
<string> getSupportedConnectionTypes
();
128 Set the connection type that will be used to connect to the
129 mail server. The supported connection types may be queried
130 using <code>getSupportedConnectionTypes()</code>.
131 If no connection types has explicitly been set the default
132 connection type will be used.
134 @param sConnectionType
135 [in] identifies the connection that should be used to connect
138 @throws com::sun::star::lang::IllegalArgumentException
139 if the provided connection type is not supported.
141 @see getSupportedConnectionTypes
142 @see isConnectionTypeSupported
144 void setConnectionType
([in] string sConnectionType
)
145 raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
148 Allow a client to query if a certain connection type is
151 @param sConnectionType
152 [in] query if a certain connection type is supported.
155 <TRUE/> if the specified connection type is supported.
157 boolean isConnectionTypeSupported
([in] string sConnectionType
);
160 Register a connection listener.
163 [in] a listener that will be informed about connection events.
165 @see com::sun::star::mail::XConnectionListener
167 void addConnectionListener
([in] XConnectionListener xListener
);
170 Unregister a connection listener.
173 [in] a listener that no longer need to be informed about connection events.
175 @see com::sun::star::mail::XConnectionListener
177 void removeConnectionListener
([in] XConnectionListener xListener
);
180 Login a user to the mail server. Only one user may logged in
181 at a time. An attempt to login while another user is logged in
182 causes an exception to be thrown.
184 @param xAuthenticator
185 [in] an interface used to query for the necessary user information
186 needed to login to the mail server.
188 @throws com::sun::star::io::AlreadyConnectedException
189 on a try to connect to an already connect mail server.
191 @throws com::sun::star::io::UnknownHostException
192 usually if the IP address of the mail server could not be
193 determined. Possible causes are a broken network connection,
194 a wrong server name, an unreachable DNS server, etc.
196 @throws com::sun::star::io::NoRouteToHostException
197 if an error occured to connect to the remote mail server.
198 Typically the remote mail server cannot be reach because of an
199 intervening firewall, or if an intermediate router is down,
200 the network connection is broken, etc.
202 @throws com::sun::star::io::ConnectException
203 if an error occured while attempting to connect to the remote
204 mail server. Typically the connection was refused remotely,
205 because the mail server is not listening on the remote address/port.
207 @throws com::sun::star::auth::AuthenticationException
208 if the specified user could not be logged in.
210 @throws com::sun::star::mail::IllegalStateException
211 if a user is currently logged in.
213 @throws com::sun::star::mail::MailException
214 for other errors during login.
216 @see com::sun::star::mail::XAuthenticator
217 @see com::sun::star::io::AlreadyConnectedException
218 @see com::sun::star::io::UnknownHostException
219 @see com::sun::star::io::NoRouteToHostException
220 @see com::sun::star::io::ConnectException
221 @see com::sun::star::auth::AuthenticationException
222 @see com::sun::star::mail::IllegalStateException
223 @see com::sun::star::mail::MailException
225 void connectUser
([in] XAuthenticator xAuthenticator
)
226 raises
(com
::sun
::star
::io
::AlreadyConnectedException
,
227 com
::sun
::star
::io
::UnknownHostException
,
228 com
::sun
::star
::io
::NoRouteToHostException
,
229 com
::sun
::star
::io
::ConnectException
,
230 com
::sun
::star
::auth
::AuthenticationFailedException
,
231 com
::sun
::star
::mail
::MailException
);
234 Logoff the currently logged in user.
236 @throws com::sun::star::mail::MessagingException
237 if errors occur during logoff.
239 void disconnectUser
()
240 raises
(com
::sun
::star
::mail
::MailException
);
243 Returns whether a user is currently logged in to the mail server or not.
246 <TRUE/> if a user is currently logged in to the mail server.
248 boolean isUserConnected
();
251 Send a mail message to its recipients.
253 @throws com::sun::star::io::NotConnectedException
254 if no user is currently connected to the mail server.
256 @throws com::sun::star::mail::SendMailMessageFailedException
257 if the message could not be sent because of invalid recipient
258 addresses. The e-mail addresses of recipients have to conform to
259 <a href="http://www.ietf.org/rfc/rfc822.txt">RFC 822</a>.
261 @throws com::sun::star::mail::MailException
262 is thrown on other errors that may happen during sending.
263 A possible reason may be for instance that a file attachment
264 specified in a mail message could not be found or accessed.
266 @throws com::sun::star::datatransfer::UnsupportedFlavorException
267 is thrown when the body of the mail message is provided in an
268 unsupported mime content type or may be thrown if one of the file
269 attachments specifies an unspupported mime content type.
271 @see com::sun::star::io::NotConnectedExceptionException
272 @see com::sun::star::mail::SendMailMessageFailedException
273 @see com::sun::star::mail::MailException
274 @see com::sun::star::datatransfer::UnsupportedFlavorException
276 void sendMailMessage
([in] XMailMessage xMailMessage
)
277 raises
(com
::sun
::star
::io
::NotConnectedException
, com
::sun
::star
::mail
::SendMailMessageFailedException
, com
::sun
::star
::mail
::MailException
, com
::sun
::star
::datatransfer
::UnsupportedFlavorException
);