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
23#ifndef __com_sun_star_document_ImportFilter_idl__
24#define __com_sun_star_document_ImportFilter_idl__
25
26#ifndef __com_sun_star_document_XImporter_idl__
27#include <com/sun/star/document/XImporter.idl>
28#endif
29
30#ifndef __com_sun_star_document_XFilter_idl__
31#include <com/sun/star/document/XFilter.idl>
32#endif
33
34#ifndef __com_sun_star_lang_XInitialization_idl__
35#include <com/sun/star/lang/XInitialization.idl>
36#endif
37
38#ifndef __com_sun_star_container_XNamed_idl__
39#include <com/sun/star/container/XNamed.idl>
40#endif
41
42//=============================================================================
43
44module com { module sun { module star { module document {
45
46//=============================================================================
47/** filter for imports
48
49    <p>
50    Such filters can be used for importing a content.
51    Of course it's possible to combine it with the service <type>ExportFilter</type>
52    if export functionality should be available at same implementation too.
53    </p>
54
55    @see ExportFilter
56 */
57published service ImportFilter
58{
59	//-------------------------------------------------------------------------
60    /** set target(!) document for this filter
61
62		<p>
63        The document must be used as the target of the filter.
64        Any external content will be written there.
65		</p>
66	 */
67    interface XImporter;
68
69	//-------------------------------------------------------------------------
70    /** filter interface
71
72		<p>
73        It's used to filter a document at loading time.
74        The target document should be already setted by using another interface
75        <member>ImportFilter::XImporter</member> which is supported by this service too.
76        </p>
77
78        <p>
79        Tip:<br>
80        If same implementation provides the service <type>ExportFilter</type> too,
81        code must distinguish between filtering into a target document (for import) or
82        filtering from a source document (for export). This can be recognized by saving
83        state of used interfaces <type>XExporter</type> or <type>XImporter</type>!
84        Otherwise it's not clear which action is required here.
85 		</p>
86 	*/
87    interface XFilter;
88
89	//-------------------------------------------------------------------------
90    /** support initialization of filter with its own configuration
91
92		<p>
93        A filter object must be created by global service <type>FilterFactory</type>.
94        If filter supports this optional interface, he will be initialized by the factory directly
95        after creation. The factory will pass follow informations to this new instance:
96            <ul>
97                <li>first item will be a set of configuration data of the filter</li>
98                <li>after that will follow may given optional parameters of call
99                    <member scope="com::sun::star::lang">XMultiServiceFactory::createInstanceWithArguments()</member>
100                    of service <type>FilterFactory</type>.
101                </li>
102            </ul>
103        See description of service <member>FilterFactory::XNameContainer</member> for a description of
104        possible configuration data.
105        </p>
106	 */
107	[optional] interface com::sun::star::lang::XInitialization;
108
109	//-------------------------------------------------------------------------
110    /** provides access to the internal name of this filter
111
112		<p>
113        This internal filter name can be used on service <type>FilterFactory</type>
114        to get further informations about it (e.g. his registration for mime types or extensions etc.)
115        It's important that returned string is the "internal name" of the filter which must be
116        unambigous against all other registered filter in current instalation.
117        </p>
118        <p>
119        <strong>Attention!</strong><br>
120        Supported method setName() sould be ignored or forwarded to the FilterFactory.
121        It's not allowed to set it directly to the configuration. Because it depends
122        from real implementation of the FilterFactory if it will be allowed or not!
123 		</p>
124 	*/
125    [optional] interface com::sun::star::container::XNamed;
126};
127
128//=============================================================================
129
130}; }; }; };
131
132#endif
133