xref: /aoo42x/main/offapi/com/sun/star/frame/XModel2.idl (revision cdf0e10c)
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_XModel2_idl__
28*cdf0e10cSrcweir#define __com_sun_star_frame_XModel2_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#include <com/sun/star/frame/XController2.idl>
31*cdf0e10cSrcweir#include <com/sun/star/frame/XModel.idl>
32*cdf0e10cSrcweir#include <com/sun/star/container/XEnumeration.idl>
33*cdf0e10cSrcweir#include <com/sun/star/awt/XWindow.idl>
34*cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
35*cdf0e10cSrcweir
36*cdf0e10cSrcweir//=============================================================================
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir module com {  module sun {  module star {  module frame {
39*cdf0e10cSrcweir
40*cdf0e10cSrcweir//=============================================================================
41*cdf0e10cSrcweir/** extends interface XModel.
42*cdf0e10cSrcweir
43*cdf0e10cSrcweir    The foloowing functions are added:
44*cdf0e10cSrcweir
45*cdf0e10cSrcweir    - enumeration of all currently connected controller objects.
46*cdf0e10cSrcweir      (not getCurrentController() only, which depends on focus)
47*cdf0e10cSrcweir
48*cdf0e10cSrcweir    - establish new view controller factory methods, which will make
49*cdf0e10cSrcweir      it possible to create new views for this model.
50*cdf0e10cSrcweir */
51*cdf0e10cSrcweirinterface XModel2 : com::sun::star::frame::XModel
52*cdf0e10cSrcweir{
53*cdf0e10cSrcweir	//-------------------------------------------------------------------------
54*cdf0e10cSrcweir    /** provides list of all currently connected controller objects.
55*cdf0e10cSrcweir
56*cdf0e10cSrcweir        <p>
57*cdf0e10cSrcweir        Please note: Because this interface will might be used inside
58*cdf0e10cSrcweir        multi threaded environments those list can contain still disposed items
59*cdf0e10cSrcweir        or it new added controller will be missing (if they was added after this
60*cdf0e10cSrcweir        enumeration was created).
61*cdf0e10cSrcweir        </P>
62*cdf0e10cSrcweir
63*cdf0e10cSrcweir        @returns
64*cdf0e10cSrcweir            list of controller objects.
65*cdf0e10cSrcweir            Enumeration can be empty but not NULL.
66*cdf0e10cSrcweir	 */
67*cdf0e10cSrcweir	com::sun::star::container::XEnumeration getControllers();
68*cdf0e10cSrcweir
69*cdf0e10cSrcweir	//-------------------------------------------------------------------------
70*cdf0e10cSrcweir    /** provides the available names of the factory to be used to create views.
71*cdf0e10cSrcweir
72*cdf0e10cSrcweir        <p>The names are usually logical view names. The following names have
73*cdf0e10cSrcweir        a defined meaning, i.e. every concrete implementation which returns such
74*cdf0e10cSrcweir        a name must ensure it has the same meaning, and if a concrete implementation
75*cdf0e10cSrcweir        has a view with the given meaning, it must give it the name as defined here:
76*cdf0e10cSrcweir        <ul>
77*cdf0e10cSrcweir            <li><b>Default</b> specifies the default view of the document.</li>
78*cdf0e10cSrcweir            <li><b>Preview</b> specifies a preview of the document. A minimal implementation of such a view
79*cdf0e10cSrcweir                is a <em>Default</em> view which is read-only.</li>
80*cdf0e10cSrcweir            <li><b>PrintPreview</b> specifies a print preview of the document.</li>
81*cdf0e10cSrcweir        </ul>
82*cdf0e10cSrcweir        </p>
83*cdf0e10cSrcweir
84*cdf0e10cSrcweir        <p>Implementations of this interface might decide to support additional
85*cdf0e10cSrcweir        view names, which then are documented in the respective service descriptions.</p>
86*cdf0e10cSrcweir
87*cdf0e10cSrcweir        @see createView
88*cdf0e10cSrcweir
89*cdf0e10cSrcweir        @returns
90*cdf0e10cSrcweir            a sequence of names of all supported views for this document.
91*cdf0e10cSrcweir     */
92*cdf0e10cSrcweir    sequence< string > getAvailableViewControllerNames();
93*cdf0e10cSrcweir
94*cdf0e10cSrcweir	//-------------------------------------------------------------------------
95*cdf0e10cSrcweir    /** creates the default view instance for this model.
96*cdf0e10cSrcweir
97*cdf0e10cSrcweir        <p>Effectively, this method is equivalent to calling <member>createView</member> with
98*cdf0e10cSrcweir        the <code>ViewName</code> being <code>&quot;Default&quot;</code>.</p>
99*cdf0e10cSrcweir
100*cdf0e10cSrcweir        @param Frame
101*cdf0e10cSrcweir               used to place the new created view there
102*cdf0e10cSrcweir
103*cdf0e10cSrcweir        @return the new view controller instance
104*cdf0e10cSrcweir
105*cdf0e10cSrcweir        @throws ::com::sun::star::lang::IllegalArgumentException
106*cdf0e10cSrcweir                if one of the given parameter was wrong
107*cdf0e10cSrcweir
108*cdf0e10cSrcweir        @throws ::com::sun::star::uno::Exception
109*cdf0e10cSrcweir                if creation of a new view failed by other reasons
110*cdf0e10cSrcweir     */
111*cdf0e10cSrcweir    com::sun::star::frame::XController2 createDefaultViewController( [in]  com::sun::star::frame::XFrame Frame )
112*cdf0e10cSrcweir        raises (com::sun::star::lang::IllegalArgumentException,
113*cdf0e10cSrcweir                com::sun::star::uno::Exception                );
114*cdf0e10cSrcweir
115*cdf0e10cSrcweir	//-------------------------------------------------------------------------
116*cdf0e10cSrcweir    /** creates a new view instance classified by the specified name and arguments.
117*cdf0e10cSrcweir
118*cdf0e10cSrcweir        <p>The newly created controller must not be connected with the document and the
119*cdf0e10cSrcweir        frame. That is, you should neither call <member>XFrame::setComponent</member>, nor
120*cdf0e10cSrcweir        <member>XController::attachFrame</member>, nor <member>XController::attachModel</member>,
121*cdf0e10cSrcweir        nor <member>XModel::connectController</member>, not <member>XModel::setCurrentController</member>.
122*cdf0e10cSrcweir        All of this is the responsibility of the caller, which will do it in the proper order.</p>
123*cdf0e10cSrcweir
124*cdf0e10cSrcweir        @param ViewName
125*cdf0e10cSrcweir               classified name of instance
126*cdf0e10cSrcweir
127*cdf0e10cSrcweir        @param Arguments
128*cdf0e10cSrcweir               arguments used for creation
129*cdf0e10cSrcweir
130*cdf0e10cSrcweir        @param Frame
131*cdf0e10cSrcweir               used to place the new created view there
132*cdf0e10cSrcweir
133*cdf0e10cSrcweir        @return the new view controller instance
134*cdf0e10cSrcweir
135*cdf0e10cSrcweir        @throws ::com::sun::star::lang::IllegalArgumentException
136*cdf0e10cSrcweir                if one of the given parameter was wrong
137*cdf0e10cSrcweir
138*cdf0e10cSrcweir        @throws ::com::sun::star::uno::Exception
139*cdf0e10cSrcweir                if creation of a new view failed by other reasons
140*cdf0e10cSrcweir     */
141*cdf0e10cSrcweir    com::sun::star::frame::XController2 createViewController( [in]  string                                           ViewName       ,
142*cdf0e10cSrcweir                                                              [in]  sequence< com::sun::star::beans::PropertyValue > Arguments      ,
143*cdf0e10cSrcweir                                                              [in]  com::sun::star::frame::XFrame                    Frame          )
144*cdf0e10cSrcweir        raises (com::sun::star::lang::IllegalArgumentException,
145*cdf0e10cSrcweir                com::sun::star::uno::Exception                );
146*cdf0e10cSrcweir};
147*cdf0e10cSrcweir
148*cdf0e10cSrcweir//=============================================================================
149*cdf0e10cSrcweir
150*cdf0e10cSrcweir}; }; }; };
151*cdf0e10cSrcweir
152*cdf0e10cSrcweir#endif
153