merged tag ooo/OOO330_m14
[LibreOffice.git] / offapi / com / sun / star / frame / XModel2.idl
blob0b18ff02be1f69424be6bb6a8726e2f4ab31583b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef __com_sun_star_frame_XModel2_idl__
28 #define __com_sun_star_frame_XModel2_idl__
30 #include <com/sun/star/frame/XController2.idl>
31 #include <com/sun/star/frame/XModel.idl>
32 #include <com/sun/star/container/XEnumeration.idl>
33 #include <com/sun/star/awt/XWindow.idl>
34 #include <com/sun/star/lang/IllegalArgumentException.idl>
36 //=============================================================================
38 module com { module sun { module star { module frame {
40 //=============================================================================
41 /** extends interface XModel.
43 The foloowing functions are added:
45 - enumeration of all currently connected controller objects.
46 (not getCurrentController() only, which depends on focus)
48 - establish new view controller factory methods, which will make
49 it possible to create new views for this model.
51 interface XModel2 : com::sun::star::frame::XModel
53 //-------------------------------------------------------------------------
54 /** provides list of all currently connected controller objects.
56 <p>
57 Please note: Because this interface will might be used inside
58 multi threaded environments those list can contain still disposed items
59 or it new added controller will be missing (if they was added after this
60 enumeration was created).
61 </P>
63 @returns
64 list of controller objects.
65 Enumeration can be empty but not NULL.
67 com::sun::star::container::XEnumeration getControllers();
69 //-------------------------------------------------------------------------
70 /** provides the available names of the factory to be used to create views.
72 <p>The names are usually logical view names. The following names have
73 a defined meaning, i.e. every concrete implementation which returns such
74 a name must ensure it has the same meaning, and if a concrete implementation
75 has a view with the given meaning, it must give it the name as defined here:
76 <ul>
77 <li><b>Default</b> specifies the default view of the document.</li>
78 <li><b>Preview</b> specifies a preview of the document. A minimal implementation of such a view
79 is a <em>Default</em> view which is read-only.</li>
80 <li><b>PrintPreview</b> specifies a print preview of the document.</li>
81 </ul>
82 </p>
84 <p>Implementations of this interface might decide to support additional
85 view names, which then are documented in the respective service descriptions.</p>
87 @see createView
89 @returns
90 a sequence of names of all supported views for this document.
92 sequence< string > getAvailableViewControllerNames();
94 //-------------------------------------------------------------------------
95 /** creates the default view instance for this model.
97 <p>Effectively, this method is equivalent to calling <member>createView</member> with
98 the <code>ViewName</code> being <code>&quot;Default&quot;</code>.</p>
100 @param Frame
101 used to place the new created view there
103 @return the new view controller instance
105 @throws ::com::sun::star::lang::IllegalArgumentException
106 if one of the given parameter was wrong
108 @throws ::com::sun::star::uno::Exception
109 if creation of a new view failed by other reasons
111 com::sun::star::frame::XController2 createDefaultViewController( [in] com::sun::star::frame::XFrame Frame )
112 raises (com::sun::star::lang::IllegalArgumentException,
113 com::sun::star::uno::Exception );
115 //-------------------------------------------------------------------------
116 /** creates a new view instance classified by the specified name and arguments.
118 <p>The newly created controller must not be connected with the document and the
119 frame. That is, you should neither call <member>XFrame::setComponent</member>, nor
120 <member>XController::attachFrame</member>, nor <member>XController::attachModel</member>,
121 nor <member>XModel::connectController</member>, not <member>XModel::setCurrentController</member>.
122 All of this is the responsibility of the caller, which will do it in the proper order.</p>
124 @param ViewName
125 classified name of instance
127 @param Arguments
128 arguments used for creation
130 @param Frame
131 used to place the new created view there
133 @return the new view controller instance
135 @throws ::com::sun::star::lang::IllegalArgumentException
136 if one of the given parameter was wrong
138 @throws ::com::sun::star::uno::Exception
139 if creation of a new view failed by other reasons
141 com::sun::star::frame::XController2 createViewController( [in] string ViewName ,
142 [in] sequence< com::sun::star::beans::PropertyValue > Arguments ,
143 [in] com::sun::star::frame::XFrame Frame )
144 raises (com::sun::star::lang::IllegalArgumentException,
145 com::sun::star::uno::Exception );
148 //=============================================================================
150 }; }; }; };
152 #endif