1/************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 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. 14 * 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). 20 * 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. 25 * 26 ************************************************************************/ 27#ifndef __com_sun_star_frame_XModel2_idl__ 28#define __com_sun_star_frame_XModel2_idl__ 29 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> 35 36//============================================================================= 37 38 module com { module sun { module star { module frame { 39 40//============================================================================= 41/** extends interface XModel. 42 43 The foloowing functions are added: 44 45 - enumeration of all currently connected controller objects. 46 (not getCurrentController() only, which depends on focus) 47 48 - establish new view controller factory methods, which will make 49 it possible to create new views for this model. 50 */ 51interface XModel2 : com::sun::star::frame::XModel 52{ 53 //------------------------------------------------------------------------- 54 /** provides list of all currently connected controller objects. 55 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> 62 63 @returns 64 list of controller objects. 65 Enumeration can be empty but not NULL. 66 */ 67 com::sun::star::container::XEnumeration getControllers(); 68 69 //------------------------------------------------------------------------- 70 /** provides the available names of the factory to be used to create views. 71 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> 83 84 <p>Implementations of this interface might decide to support additional 85 view names, which then are documented in the respective service descriptions.</p> 86 87 @see createView 88 89 @returns 90 a sequence of names of all supported views for this document. 91 */ 92 sequence< string > getAvailableViewControllerNames(); 93 94 //------------------------------------------------------------------------- 95 /** creates the default view instance for this model. 96 97 <p>Effectively, this method is equivalent to calling <member>createView</member> with 98 the <code>ViewName</code> being <code>"Default"</code>.</p> 99 100 @param Frame 101 used to place the new created view there 102 103 @return the new view controller instance 104 105 @throws ::com::sun::star::lang::IllegalArgumentException 106 if one of the given parameter was wrong 107 108 @throws ::com::sun::star::uno::Exception 109 if creation of a new view failed by other reasons 110 */ 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 ); 114 115 //------------------------------------------------------------------------- 116 /** creates a new view instance classified by the specified name and arguments. 117 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> 123 124 @param ViewName 125 classified name of instance 126 127 @param Arguments 128 arguments used for creation 129 130 @param Frame 131 used to place the new created view there 132 133 @return the new view controller instance 134 135 @throws ::com::sun::star::lang::IllegalArgumentException 136 if one of the given parameter was wrong 137 138 @throws ::com::sun::star::uno::Exception 139 if creation of a new view failed by other reasons 140 */ 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 ); 146}; 147 148//============================================================================= 149 150}; }; }; }; 151 152#endif 153