/*************************************************************************
 *
 *  $RCSfile: ExportFilter.idl,v $
 *
 *  $Revision: 1.4.4.2 $
 *
 *  last change: $Author: mi $ $Date: 2003/01/21 17:41:35 $
 *
 *  The Contents of this file are made available subject to the terms of
 *  either of the following licenses
 *
 *         - GNU Lesser General Public License Version 2.1
 *         - Sun Industry Standards Source License Version 1.1
 *
 *  Sun Microsystems Inc., October, 2000
 *
 *  GNU Lesser General Public License Version 2.1
 *  =============================================
 *  Copyright 2000 by Sun Microsystems, Inc.
 *  901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License version 2.1, as published by the Free Software Foundation.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *  MA  02111-1307  USA
 *
 *
 *  Sun Industry Standards Source License Version 1.1
 *  =================================================
 *  The contents of this file are subject to the Sun Industry Standards
 *  Source License Version 1.1 (the "License"); You may not use this file
 *  except in compliance with the License. You may obtain a copy of the
 *  License at http://www.openoffice.org/license.html.
 *
 *  Software provided under this License is provided on an "AS IS" basis,
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 *  See the License for the specific provisions governing your rights and
 *  obligations concerning the Software.
 *
 *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 *
 *  Copyright: 2000 by Sun Microsystems, Inc.
 *
 *  All Rights Reserved.
 *
 *  Contributor(s): _______________________________________
 *
 *
 ************************************************************************/
#ifndef __com_sun_star_document_ExportFilter_idl__
#define __com_sun_star_document_ExportFilter_idl__

#ifndef __com_sun_star_document_XExporter_idl__
#include <com/sun/star/document/XExporter.idl>
#endif

#ifndef __com_sun_star_document_XFilter_idl__
#include <com/sun/star/document/XFilter.idl>
#endif

#ifndef __com_sun_star_lang_XInitialization_idl__
#include <com/sun/star/lang/XInitialization.idl>
#endif

#ifndef __com_sun_star_container_XNamed_idl__
#include <com/sun/star/container/XNamed.idl>
#endif

//=============================================================================

module com { module sun { module star { module document {

//=============================================================================
/** filter for exports

    <p>
    Such filters can be used for exporting a content.
    Of course it's possible to combine it with the service <type>ImportFilter</type>
    if import functionality should be available at same implementation too.
    </p>

    @see ImportFilter
 */
service ExportFilter
{
	//-------------------------------------------------------------------------
    /** set source(!) document for this filter

		<p>
        The document must be used as the source for following filter operation.
        Any content from there will be exported to another format.
		</p>
	 */
    interface XExporter;

	//-------------------------------------------------------------------------
    /** filter interface

		<p>
        It's used to filter a document at saving time.
        The source document should be already setted by using another interface
        <type>XExporter</type> which is supported by this service too.
        </p>

        <p>
        Tip:<br>
        If same implementation provides the service <type>ImportFilter</type> too,
        code must distinguish between filtering from a source document (for export) or
        filtering to a target document (for import). This can be recognized by saving
        state of used interfaces <type>XExporter</type> or <type>XImporter</type>!
        Otherwise it's not clear which action is required here.
 		</p>
 	*/
    interface XFilter;

	//-------------------------------------------------------------------------
    /** support initialization of filter with its own configuration

		<p>
        A filter object must be created by global service <type>FilterFactory</type>.
        If filter supports this optional interface, he will be initialized by the factory directly
        after creation. The factory will pass follow informations to this new instance:
            <ul>
                <li>first item will be a set of configuration data of the filter</li>
                <li>after that will follow may given optional parameters of call
                    <member scope="com::sun::star::lang">XMultiServiceFactory::createInstanceWithArguments()</member>
                    of service <type>FilterFactory</type>.
                </li>
            </ul>
        See description of service <member>FilterFactory::XNameAccess</member> for a description of
        possible configuration data too.
        </p>

        @example
            <listing>
            <b>void</b> XInitialization::initialize( java.lang.Object[] lData )
            {
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><font COLOR="#949494">// Config part exist every time - it's guaranted by FilterFactory!</font></i>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>int</b> i=0;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;com.sun.star.beans.NamedValue[] lConfig = lData[i];
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>for</b>( p=0; p&lt;lConfig.length; ++p )
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><font COLOR="#949494">// ... work with this config data</font></i>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>if</b> (lConfig[p].Name=="...")
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><font COLOR="#949494">// Arguments of call createInstanceWithArguments() are optional ones.</font></i>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><font COLOR="#949494">// They mustn't exist.</font></i>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><font COLOR="#949494">// Note: i starts with 1. Because first element was already handled.</font></i>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>for</b>( i=1; i&lt;lData.length(); ++i )
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><font COLOR="#949494">// ... work with this optional data</font></i>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
            }
            </listing>
	 */
	[optional] interface com::sun::star::lang::XInitialization;

	//-------------------------------------------------------------------------
    /** provides access to the internal name of this filter

		<p>
        This internal filter name can be used on service <type>FilterFactory</type>
        to get further informations about it (e.g. his registration for mime types or extensions etc.)
        It's important that returned string is the "internal name" of the filter which must be
        unambigous against all other registered filter in current instalation.
        </p>
        <p>
        <strong>Attention!</strong><br>
        Supported method setName() sould be ignored or forwarded to the FilterFactory.
        It's not allowed to set it directly to the configuration. Because it depends
        from real implementation of the FilterFactory if it will be allowed or not!
 		</p>
 	*/
    [optional] interface com::sun::star::container::XNamed;
};

//=============================================================================

}; }; }; };

#endif
