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