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_TypeDetection_idl__
24#define __com_sun_star_document_TypeDetection_idl__
25
26#ifndef __com_sun_star_document_XTypeDetection_idl__
27#include <com/sun/star/document/XTypeDetection.idl>
28#endif
29
30#ifndef __com_sun_star_container_XNameContainer_idl__
31#include <com/sun/star/container/XNameContainer.idl>
32#endif
33
34#ifndef __com_sun_star_container_XContainerQuery_idl__
35#include <com/sun/star/container/XContainerQuery.idl>
36#endif
37
38#ifndef __com_sun_star_util_XFlushable_idl__
39#include <com/sun/star/util/XFlushable.idl>
40#endif
41
42//=============================================================================
43
44module com { module sun { module star { module document {
45
46//=============================================================================
47/** capsulate a type detection service and provide read/write access on it's configuration data.
48
49    <p>
50    It's possible to make a "flat" detection wich may use internal configuration
51    data only - or a "deep" detection which use special <type>ExtendedTypeDetection</type>
52    services to look into the document stream. Last mode can be supressed to perform the operation.
53    Of course the results can't be guaranteed then. (e.g. in case the extension was changed)
54    </p>
55 */
56published service TypeDetection
57{
58	//-------------------------------------------------------------------------
59    /** can be used to make a flat or deep type detection.
60
61        <p>
62        Use this interface to get information about the type of the given resource.
63        Return value will be always an internal name of a registered document type.
64        It can be used may on other services (e.g. <type scope="com::sun::star::frame">FrameLoaderFactory</type>)
65        to do further things, which base on it (e.g. to load it into a frame).
66        </p>
67     */
68    interface XTypeDetection;
69
70    //-------------------------------------------------------------------------
71    /** provides read access to the complete set of type configuration data.
72
73        <p>
74        Every container item is specified as a set of properties and will be
75        represented by a sequence< <type scope="com::sun::star::beans">PropertyValue</type> > structure.
76        Follow properties are supported:
77        (But note: not all of them must be present everytimes!)
78
79        <table border=1>
80            <tr>
81                <td><strong>Property Name</strong></td>
82                <td><strong>Value Type</strong></td>
83                <td><strong>Description</strong></td>
84            </tr>
85            <tr>
86                <td><em>Name</em></td>
87                <td>[string]</td>
88                <td>The internal name is the only value, which makes a container item unique.</td>
89            </tr>
90            <tr>
91                <td><em>UIName</em></td>
92                <td>[string]</td>
93                <td>It contains the localized name for this type for the current locale.</td>
94            </tr>
95            <tr>
96                <td><em>UINames</em></td>
97                <td>[sequence< string >]</td>
98                <td>It contains all available localized names for this type. The are organized
99                    in pairs and represented as a structure of sequence< <type scope="com::sun::star::beans">PropertyValue</type> >.
100                    The name of such property must be interpreted as locale; it's value as the localized
101                    type name corresponding to this locale.</td>
102            </tr>
103            <tr>
104                <td><em>MediaType</em></td>
105                <td>[string]</td>
106                <td>It contains the MIME or content type descriptor. The differences between a MIME type and
107                    an internal type name was made, to resolve existing ambigities.</td>
108            </tr>
109            <tr>
110                <td><em>ClipboardFormat</em><strong>deprecated!</strong></td>
111                <td>[string]</td>
112                <td>It was interepreted as an identifier inside clipboard.
113                    Please use new property ContentFormat instead of this now.</td>
114            </tr>
115            <tr>
116                <td><em>ContentFormat</em></td>
117                <td>[string]</td>
118                <td>It's and identifier, which is used for a deep format detection.
119                    An <type>ExtendedTypeDetection</type> use this value to match
120                    a given content to this type. e.g. It's interpreted as the doc type
121                    of an XML stream or as an identifier inside a file header.
122                </td>
123            </tr>
124            <tr>
125                <td><em>URLPattern</em></td>
126                <td>[sequence< string >]</td>
127                <td>This list contains different URL patterns, which identify this type.
128                    E.g. data base contents can be described by an new defined protocol like "sql://select*".
129                    In combination with a sutable <type scope="com::sun::star::frame">FrameLoader</type> or
130                    <type>ImportFilter</type>/<type>ExportFilter</type> it woul be possible then, to
131                    layout a sql query output into an office frame.</td>
132            </tr>
133            <tr>
134                <td><em>Extensions</em></td>
135                <td>[sequence< string >]</td>
136                <td>It contains a list of file extensions, which match this type.
137                    They must be specified as pure extension, without any special signs.
138                    E.g.: "doc", "html" ... but not ".doc".
139                    Using of wildcards is allowed but not very usefull. The may resulting
140                    ambigities with other type registrations can't be resolved anytimes.</td>
141            </tr>
142            <tr>
143                <td><em>DocumentIconID</em></td>
144                <td>[integer]</td>
145                <td>It's an ID, which present the number of a corresponding icon.</td>
146            </tr>
147        </table>
148        </p>
149
150        <p>
151        Note:<br>
152        All elements of this container will be adressed by his internal name,
153        and it must be an unambigous value.
154        </p>
155     */
156    interface com::sun::star::container::XNameAccess;
157
158    //-------------------------------------------------------------------------
159    /** provides a write access to the configuration data.
160     */
161    [optional] interface com::sun::star::container::XNameContainer;
162
163    //-------------------------------------------------------------------------
164    /** provides search on the configuration data set.
165
166        <p>
167        Against simple property search it provides some complex algorithms too.
168        For further informations please read the SDK documentation.
169        </p>
170     */
171    [optional] interface com::sun::star::container::XContainerQuery;
172
173    //-------------------------------------------------------------------------
174    /** can be used to perform container changes.
175
176        <p>
177        Because the complexness of such configuration set can be very high,
178        it seams not very usefull to update the undelying configuration layer
179        on every container change request immediatly. Another strategy can be to
180        make all changes (adding/changing/removing of items) and call flush at the end.
181        That will validate the whole container and reject inconsistent data sets.
182        Only in case all made changes was correct, they will be written back to the
183        configuration. Further this interface provides the possibelity, that interested
184        changes listener can be registered too.
185        </p>
186     */
187    [optional] interface com::sun::star::util::XFlushable;
188};
189
190//=============================================================================
191
192}; }; }; };
193
194#endif
195