xref: /aoo4110/main/offapi/com/sun/star/frame/XModel2.idl (revision b1cdbd2c)
1*b1cdbd2cSJim Jagielski/**************************************************************
2*b1cdbd2cSJim Jagielski *
3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski * or more contributor license agreements.  See the NOTICE file
5*b1cdbd2cSJim Jagielski * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski * regarding copyright ownership.  The ASF licenses this file
7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski * with the License.  You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski *
11*b1cdbd2cSJim Jagielski *   http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski *
13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski * KIND, either express or implied.  See the License for the
17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski * under the License.
19*b1cdbd2cSJim Jagielski *
20*b1cdbd2cSJim Jagielski *************************************************************/
21*b1cdbd2cSJim Jagielski
22*b1cdbd2cSJim Jagielski
23*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_frame_XModel2_idl__
24*b1cdbd2cSJim Jagielski#define __com_sun_star_frame_XModel2_idl__
25*b1cdbd2cSJim Jagielski
26*b1cdbd2cSJim Jagielski#include <com/sun/star/frame/XController2.idl>
27*b1cdbd2cSJim Jagielski#include <com/sun/star/frame/XModel.idl>
28*b1cdbd2cSJim Jagielski#include <com/sun/star/container/XEnumeration.idl>
29*b1cdbd2cSJim Jagielski#include <com/sun/star/awt/XWindow.idl>
30*b1cdbd2cSJim Jagielski#include <com/sun/star/lang/IllegalArgumentException.idl>
31*b1cdbd2cSJim Jagielski
32*b1cdbd2cSJim Jagielski//=============================================================================
33*b1cdbd2cSJim Jagielski
34*b1cdbd2cSJim Jagielski module com {  module sun {  module star {  module frame {
35*b1cdbd2cSJim Jagielski
36*b1cdbd2cSJim Jagielski//=============================================================================
37*b1cdbd2cSJim Jagielski/** extends interface XModel.
38*b1cdbd2cSJim Jagielski
39*b1cdbd2cSJim Jagielski    The foloowing functions are added:
40*b1cdbd2cSJim Jagielski
41*b1cdbd2cSJim Jagielski    - enumeration of all currently connected controller objects.
42*b1cdbd2cSJim Jagielski      (not getCurrentController() only, which depends on focus)
43*b1cdbd2cSJim Jagielski
44*b1cdbd2cSJim Jagielski    - establish new view controller factory methods, which will make
45*b1cdbd2cSJim Jagielski      it possible to create new views for this model.
46*b1cdbd2cSJim Jagielski */
47*b1cdbd2cSJim Jagielskiinterface XModel2 : com::sun::star::frame::XModel
48*b1cdbd2cSJim Jagielski{
49*b1cdbd2cSJim Jagielski	//-------------------------------------------------------------------------
50*b1cdbd2cSJim Jagielski    /** provides list of all currently connected controller objects.
51*b1cdbd2cSJim Jagielski
52*b1cdbd2cSJim Jagielski        <p>
53*b1cdbd2cSJim Jagielski        Please note: Because this interface will might be used inside
54*b1cdbd2cSJim Jagielski        multi threaded environments those list can contain still disposed items
55*b1cdbd2cSJim Jagielski        or it new added controller will be missing (if they was added after this
56*b1cdbd2cSJim Jagielski        enumeration was created).
57*b1cdbd2cSJim Jagielski        </P>
58*b1cdbd2cSJim Jagielski
59*b1cdbd2cSJim Jagielski        @returns
60*b1cdbd2cSJim Jagielski            list of controller objects.
61*b1cdbd2cSJim Jagielski            Enumeration can be empty but not NULL.
62*b1cdbd2cSJim Jagielski	 */
63*b1cdbd2cSJim Jagielski	com::sun::star::container::XEnumeration getControllers();
64*b1cdbd2cSJim Jagielski
65*b1cdbd2cSJim Jagielski	//-------------------------------------------------------------------------
66*b1cdbd2cSJim Jagielski    /** provides the available names of the factory to be used to create views.
67*b1cdbd2cSJim Jagielski
68*b1cdbd2cSJim Jagielski        <p>The names are usually logical view names. The following names have
69*b1cdbd2cSJim Jagielski        a defined meaning, i.e. every concrete implementation which returns such
70*b1cdbd2cSJim Jagielski        a name must ensure it has the same meaning, and if a concrete implementation
71*b1cdbd2cSJim Jagielski        has a view with the given meaning, it must give it the name as defined here:
72*b1cdbd2cSJim Jagielski        <ul>
73*b1cdbd2cSJim Jagielski            <li><b>Default</b> specifies the default view of the document.</li>
74*b1cdbd2cSJim Jagielski            <li><b>Preview</b> specifies a preview of the document. A minimal implementation of such a view
75*b1cdbd2cSJim Jagielski                is a <em>Default</em> view which is read-only.</li>
76*b1cdbd2cSJim Jagielski            <li><b>PrintPreview</b> specifies a print preview of the document.</li>
77*b1cdbd2cSJim Jagielski        </ul>
78*b1cdbd2cSJim Jagielski        </p>
79*b1cdbd2cSJim Jagielski
80*b1cdbd2cSJim Jagielski        <p>Implementations of this interface might decide to support additional
81*b1cdbd2cSJim Jagielski        view names, which then are documented in the respective service descriptions.</p>
82*b1cdbd2cSJim Jagielski
83*b1cdbd2cSJim Jagielski        @see createView
84*b1cdbd2cSJim Jagielski
85*b1cdbd2cSJim Jagielski        @returns
86*b1cdbd2cSJim Jagielski            a sequence of names of all supported views for this document.
87*b1cdbd2cSJim Jagielski     */
88*b1cdbd2cSJim Jagielski    sequence< string > getAvailableViewControllerNames();
89*b1cdbd2cSJim Jagielski
90*b1cdbd2cSJim Jagielski	//-------------------------------------------------------------------------
91*b1cdbd2cSJim Jagielski    /** creates the default view instance for this model.
92*b1cdbd2cSJim Jagielski
93*b1cdbd2cSJim Jagielski        <p>Effectively, this method is equivalent to calling <member>createView</member> with
94*b1cdbd2cSJim Jagielski        the <code>ViewName</code> being <code>&quot;Default&quot;</code>.</p>
95*b1cdbd2cSJim Jagielski
96*b1cdbd2cSJim Jagielski        @param Frame
97*b1cdbd2cSJim Jagielski               used to place the new created view there
98*b1cdbd2cSJim Jagielski
99*b1cdbd2cSJim Jagielski        @return the new view controller instance
100*b1cdbd2cSJim Jagielski
101*b1cdbd2cSJim Jagielski        @throws ::com::sun::star::lang::IllegalArgumentException
102*b1cdbd2cSJim Jagielski                if one of the given parameter was wrong
103*b1cdbd2cSJim Jagielski
104*b1cdbd2cSJim Jagielski        @throws ::com::sun::star::uno::Exception
105*b1cdbd2cSJim Jagielski                if creation of a new view failed by other reasons
106*b1cdbd2cSJim Jagielski     */
107*b1cdbd2cSJim Jagielski    com::sun::star::frame::XController2 createDefaultViewController( [in]  com::sun::star::frame::XFrame Frame )
108*b1cdbd2cSJim Jagielski        raises (com::sun::star::lang::IllegalArgumentException,
109*b1cdbd2cSJim Jagielski                com::sun::star::uno::Exception                );
110*b1cdbd2cSJim Jagielski
111*b1cdbd2cSJim Jagielski	//-------------------------------------------------------------------------
112*b1cdbd2cSJim Jagielski    /** creates a new view instance classified by the specified name and arguments.
113*b1cdbd2cSJim Jagielski
114*b1cdbd2cSJim Jagielski        <p>The newly created controller must not be connected with the document and the
115*b1cdbd2cSJim Jagielski        frame. That is, you should neither call <member>XFrame::setComponent</member>, nor
116*b1cdbd2cSJim Jagielski        <member>XController::attachFrame</member>, nor <member>XController::attachModel</member>,
117*b1cdbd2cSJim Jagielski        nor <member>XModel::connectController</member>, not <member>XModel::setCurrentController</member>.
118*b1cdbd2cSJim Jagielski        All of this is the responsibility of the caller, which will do it in the proper order.</p>
119*b1cdbd2cSJim Jagielski
120*b1cdbd2cSJim Jagielski        @param ViewName
121*b1cdbd2cSJim Jagielski               classified name of instance
122*b1cdbd2cSJim Jagielski
123*b1cdbd2cSJim Jagielski        @param Arguments
124*b1cdbd2cSJim Jagielski               arguments used for creation
125*b1cdbd2cSJim Jagielski
126*b1cdbd2cSJim Jagielski        @param Frame
127*b1cdbd2cSJim Jagielski               used to place the new created view there
128*b1cdbd2cSJim Jagielski
129*b1cdbd2cSJim Jagielski        @return the new view controller instance
130*b1cdbd2cSJim Jagielski
131*b1cdbd2cSJim Jagielski        @throws ::com::sun::star::lang::IllegalArgumentException
132*b1cdbd2cSJim Jagielski                if one of the given parameter was wrong
133*b1cdbd2cSJim Jagielski
134*b1cdbd2cSJim Jagielski        @throws ::com::sun::star::uno::Exception
135*b1cdbd2cSJim Jagielski                if creation of a new view failed by other reasons
136*b1cdbd2cSJim Jagielski     */
137*b1cdbd2cSJim Jagielski    com::sun::star::frame::XController2 createViewController( [in]  string                                           ViewName       ,
138*b1cdbd2cSJim Jagielski                                                              [in]  sequence< com::sun::star::beans::PropertyValue > Arguments      ,
139*b1cdbd2cSJim Jagielski                                                              [in]  com::sun::star::frame::XFrame                    Frame          )
140*b1cdbd2cSJim Jagielski        raises (com::sun::star::lang::IllegalArgumentException,
141*b1cdbd2cSJim Jagielski                com::sun::star::uno::Exception                );
142*b1cdbd2cSJim Jagielski};
143*b1cdbd2cSJim Jagielski
144*b1cdbd2cSJim Jagielski//=============================================================================
145*b1cdbd2cSJim Jagielski
146*b1cdbd2cSJim Jagielski}; }; }; };
147*b1cdbd2cSJim Jagielski
148*b1cdbd2cSJim Jagielski#endif
149