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