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