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_frame_ProtocolHandler_idl__
24#define __com_sun_star_frame_ProtocolHandler_idl__
25
26#ifndef __com_sun_star_frame_XDispatchProvider_idl__
27#include <com/sun/star/frame/XDispatchProvider.idl>
28#endif
29
30#ifndef __com_sun_star_lang_XInitialization_idl__
31#include <com/sun/star/lang/XInitialization.idl>
32#endif
33
34//=============================================================================
35
36 module com {  module sun {  module star {  module frame {
37
38//=============================================================================
39/** special dispatch provider registered for URL protocols
40
41    <p>
42    The generic dispatch mechanism on a <type>Frame</type>
43    search for such registered protocol handler and use it if it agrees with
44    the dispatched URL.
45    </p>
46
47    <p>
48    Supported URLs must match follow format: <protocol scheme>:<protocol specific part>
49    If a handler provides optional arguments ("?") or jump marks ("#") depends from his
50    definition and implementation. The generic dispatch provider will use registered
51    URL pattern to detect right handler.
52    </p>
53 */
54published service ProtocolHandler
55{
56        //-------------------------------------------------------------------------
57        /** used from the generic dispatch mechanism of the frame, to ask ProtocolHandler
58            for his agreement for the dispatched URL
59
60        <p>
61        Such asked handler can agree by returning itself or a special sub dispatch object, which
62        can handle the given URL. Of course he can disagree with it by returning an empty reference.
63        </p>
64        */
65        interface XDispatchProvider;
66
67        //-------------------------------------------------------------------------
68        /** initialize the new handler instance with some context informations
69
70        <p>
71        Sometimes it can be useful for a handler object, to know something about the
72        environment, in which it runs - especily the frame. For this case the generic
73        code (which uses the handler) will ask for this optional interface and use it, if it exist.
74        Following parameters are passed to the service:
75        <ul>
76        <li>sequence< any >[0] => the frame for which this ProtocolHandler was created [com.sun.star.frame.XFrame]</li>
77        </ul>
78        </p>
79
80        <p>
81        Please note: if this mechanism is used it does not seem useful (nor possible) to implement a ProtocolHandler
82        as a singleton. Otherwise the implementation can't distinguish between different environments
83        and her corresponding dispatch requests.
84        </p>
85        */
86        [optional] interface ::com::sun::star::lang::XInitialization;
87};
88
89//=============================================================================
90
91}; }; }; };
92
93#endif
94