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