1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_frame_XComponentLoader_idl__
24cdf0e10cSrcweir#define __com_sun_star_frame_XComponentLoader_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
27cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir
30cdf0e10cSrcweir#ifndef __com_sun_star_lang_XComponent_idl__
31cdf0e10cSrcweir#include <com/sun/star/lang/XComponent.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir
34cdf0e10cSrcweir#ifndef __com_sun_star_beans_PropertyValue_idl__
35cdf0e10cSrcweir#include <com/sun/star/beans/PropertyValue.idl>
36cdf0e10cSrcweir#endif
37cdf0e10cSrcweir
38cdf0e10cSrcweir#ifndef __com_sun_star_io_IOException_idl__
39cdf0e10cSrcweir#include <com/sun/star/io/IOException.idl>
40cdf0e10cSrcweir#endif
41cdf0e10cSrcweir
42cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
43cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
44cdf0e10cSrcweir#endif
45cdf0e10cSrcweir
46cdf0e10cSrcweir
47cdf0e10cSrcweir//=============================================================================
48cdf0e10cSrcweir
49cdf0e10cSrcweirmodule com {  module sun {  module star {  module frame {
50cdf0e10cSrcweir
51cdf0e10cSrcweir//=============================================================================
52cdf0e10cSrcweir/** this is a simple interface to load components by an URL into a
53cdf0e10cSrcweir    frame environment
54cdf0e10cSrcweir
55cdf0e10cSrcweir    @see Desktop
56cdf0e10cSrcweir    @see Frame
57cdf0e10cSrcweir    @see XFrame
58cdf0e10cSrcweir */
59cdf0e10cSrcweirpublished interface XComponentLoader: com::sun::star::uno::XInterface
60cdf0e10cSrcweir{
61cdf0e10cSrcweir	//-------------------------------------------------------------------------
62cdf0e10cSrcweir	/** loads a component specified by an URL into the specified
63cdf0e10cSrcweir		new or existing frame.
64cdf0e10cSrcweir
65cdf0e10cSrcweir        @param URL
66cdf0e10cSrcweir            specifies the URL of the document to load
67cdf0e10cSrcweir
68cdf0e10cSrcweir            <p>
69cdf0e10cSrcweir            To create new documents, use "private:factory/scalc", "private:factory/swriter", etc.
70cdf0e10cSrcweir            Other special protocols (e.g. "slot:", ".uno") are not allowed and raise
71cdf0e10cSrcweir            an <type scope="com::sun::star::lang">IllegalArgumentException</type>.
72cdf0e10cSrcweir            </p>
73cdf0e10cSrcweir
74cdf0e10cSrcweir        @param TargetFrameName
75cdf0e10cSrcweir            specifies the name of the frame to view the document in
76cdf0e10cSrcweir
77cdf0e10cSrcweir            <p>
78cdf0e10cSrcweir            If a frame with the specified name already exists, it is used, otherwise it
79cdf0e10cSrcweir            is created. There exist some special targets which never can be used
80cdf0e10cSrcweir            as real frame names:
81cdf0e10cSrcweir            <table border=1>
82cdf0e10cSrcweir                <tr>
83cdf0e10cSrcweir                    <td><strong>"_blank"</strong></td>
84cdf0e10cSrcweir                    <td>always creates a new frame</td>
85cdf0e10cSrcweir                </tr>
86cdf0e10cSrcweir                <tr>
87cdf0e10cSrcweir                    <td><strong>"_default"</strong></td>
88cdf0e10cSrcweir                    <td>special UI functionality<br>(e.g. detecting of already loaded documents, using of empty frames of creating of new top frames as fallback)</td>
89cdf0e10cSrcweir                </tr>
90cdf0e10cSrcweir                <tr>
91cdf0e10cSrcweir                    <td><strong>"_self", ""(!)</strong></td>
92cdf0e10cSrcweir                    <td>means frame himself</td>
93cdf0e10cSrcweir                </tr>
94cdf0e10cSrcweir                <tr>
95cdf0e10cSrcweir                    <td><strong>"_parent"</strong></td>
96cdf0e10cSrcweir                    <td>address direct parent of frame</td>
97cdf0e10cSrcweir                </tr>
98cdf0e10cSrcweir                <tr>
99cdf0e10cSrcweir                    <td><strong>"_top"</strong></td>
100cdf0e10cSrcweir                    <td>indicates top frame of current path in tree</td>
101cdf0e10cSrcweir                </tr>
102cdf0e10cSrcweir                <tr>
103cdf0e10cSrcweir                    <td><strong>"_beamer"</strong></td>
104cdf0e10cSrcweir                    <td>means special sub frame</td>
105cdf0e10cSrcweir                </tr>
106cdf0e10cSrcweir            </table>
107cdf0e10cSrcweir
108cdf0e10cSrcweir        @param SearchFlags
109cdf0e10cSrcweir			use the values of <type>FrameSearchFlag</type> to specify
110cdf0e10cSrcweir            how to find the specified <var>TargetFrameName</var>
111cdf0e10cSrcweir
112cdf0e10cSrcweir            <p>
113cdf0e10cSrcweir            Note: These flags are optional ones and will be used for non special
114cdf0e10cSrcweir            target names only.
115cdf0e10cSrcweir            </p>
116cdf0e10cSrcweir
117cdf0e10cSrcweir        @param Arguments
118cdf0e10cSrcweir            these arguments specify component or filter specific behavior
119cdf0e10cSrcweir
120cdf0e10cSrcweir            <p>
121cdf0e10cSrcweir			For example, "ReadOnly" with a boolean value specifies whether
122cdf0e10cSrcweir			the document is opened read-only. "FilterName" specifies the
123cdf0e10cSrcweir			component type to create and the filter to use, for example:
124cdf0e10cSrcweir            "Text - CSV". For more information see
125cdf0e10cSrcweir			<type scope="com::sun::star::document">MediaDescriptor</type>.
126cdf0e10cSrcweir            </p>
127cdf0e10cSrcweir
128cdf0e10cSrcweir        @return
129cdf0e10cSrcweir            a <type scope="com::sun::star::lang">XComponent</type> for successfully loaded
130cdf0e10cSrcweir            documents or
131cdf0e10cSrcweir            <br>
132cdf0e10cSrcweir            <NULL/>if it failed
133cdf0e10cSrcweir
134cdf0e10cSrcweir            <p>
135cdf0e10cSrcweir            This interface is a generic one and can be used to start further requests on
136cdf0e10cSrcweir            loaded document or control the lifetime of it (means dispose() it after using).
137cdf0e10cSrcweir            The real document service behind this interface can be one of follow three ones:
138cdf0e10cSrcweir            <ul>
139cdf0e10cSrcweir                <li>
140cdf0e10cSrcweir                    <type scope="com::sun::star::awt">XWindow</type> for simple components<br/>
141cdf0e10cSrcweir                    Should be used for viewable components only. It is not allowed to dispose
142cdf0e10cSrcweir                    it after use directly, because the frame containing the component is its owner.
143cdf0e10cSrcweir                    Because the frame object is not accessible through the interface too,
144cdf0e10cSrcweir                    only an interacting user can do this by closing the frames' window.
145cdf0e10cSrcweir                </li>
146cdf0e10cSrcweir                <li>
147cdf0e10cSrcweir                    <type>XController</type> for richer components<br/>
148cdf0e10cSrcweir                    Should be used for real editable components which doesn't need a model.
149cdf0e10cSrcweir                    It is not allowed to dispose it after use directly, because the frame
150cdf0e10cSrcweir                    containing the component is its owner. Here the object can be disposed
151cdf0e10cSrcweir                    by disposing the frame, that the <member>XController::getFrame()</member>
152cdf0e10cSrcweir                    method of the controller returns. But for visible components the controller
153cdf0e10cSrcweir                    should be asked for permission by calling <member>XController::suspend()</member> before.
154cdf0e10cSrcweir                </li>
155cdf0e10cSrcweir                <li>
156cdf0e10cSrcweir                    <type>XModel</type> for full featured components<br/>
157cdf0e10cSrcweir                    A model that in general can be shared between several view/controller pairs,
158cdf0e10cSrcweir                    does not have an explicit owner. Every view and also the component that
159cdf0e10cSrcweir                    loaded the document may consider itself as an owner.
160cdf0e10cSrcweir                    Simply calling <method scope="com::sun::star::lang">XComponent::dispose</method> on this model may
161cdf0e10cSrcweir                    cause problems, if some members of the "owner community" are currently
162cdf0e10cSrcweir                    busy working on the model. These problems are handled by explicit closing
163cdf0e10cSrcweir                    negotiations through the interface <type scope="com::sun::star::util">XCloseable</type>.
164cdf0e10cSrcweir                    Direct dispose of the model is allowed only, if this special interface doesn't exist.
165cdf0e10cSrcweir                </li>
166cdf0e10cSrcweir            </ul>
167cdf0e10cSrcweir            </p>
168cdf0e10cSrcweir
169cdf0e10cSrcweir        @throws com::sun::star::io::IOException
170cdf0e10cSrcweir            when <var>URL</var> couldn't be found or was corrupt
171cdf0e10cSrcweir
172cdf0e10cSrcweir        @throws com::sun::star::lang::IllegalArgumentException
173cdf0e10cSrcweir            when given parameters doesn't perform the specification
174cdf0e10cSrcweir	 */
175cdf0e10cSrcweir    com::sun::star::lang::XComponent loadComponentFromURL(
176cdf0e10cSrcweir        [in] string URL,
177cdf0e10cSrcweir        [in] string TargetFrameName,
178cdf0e10cSrcweir        [in] long SearchFlags,
179cdf0e10cSrcweir        [in] sequence<com::sun::star::beans::PropertyValue> Arguments)
180cdf0e10cSrcweir        raises( com::sun::star::io::IOException,
181cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException );
182cdf0e10cSrcweir};
183cdf0e10cSrcweir
184cdf0e10cSrcweir//=============================================================================
185cdf0e10cSrcweir
186cdf0e10cSrcweir}; }; }; };
187cdf0e10cSrcweir
188cdf0e10cSrcweir#endif
189