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_view_XMultiSelectionSupplier_idl__ 24#define __com_sun_star_view_XMultiSelectionSupplier_idl__ 25 26#ifndef __com_sun_star_view_XSelectionSupplier_idl__ 27#include <com/sun/star/view/XSelectionSupplier.idl> 28#endif 29#ifndef __com_sun_star_container_XEnumeration_idl__ 30#include <com/sun/star/container/XEnumeration.idl> 31#endif 32 33//============================================================================= 34 35module com { module sun { module star { module view { 36 37//============================================================================= 38 39/** makes it possible to append and remove objects from a selection. 40 41 <p>The method <method>XSelectionSupplier::setSelection</method> for an 42 instance that also supports <type>XMultiSelectionSupplier</method> should 43 be implemented that it also takes either a selectable object or a sequence 44 of selectable objects.</p> 45 46 <p>Adding an object more than once to a selection should not toggle the 47 selection for that object but only select it once</p> 48 */ 49published interface XMultiSelectionSupplier: XSelectionSupplier 50{ 51 //------------------------------------------------------------------------- 52 53 /** adds the object or the objects represented by <var>Selection</var> to the selection 54 of this <type>XMultiSelectionSupplier</type>. 55 56 @param Selection 57 either an Object that is selectable or a sequence of objects that are selectable. 58 59 @returns 60 <TRUE/>/, if <var>Selection</var> was added to the current selection. 61 <FALSE/>, if <var>Selection</var> or parts of <var>Selection</var> could not be 62 added to the current selection. For example, if the selection already contains 63 objects that are forbidden to be selected together with <var>Selection</var> 64 65 @throws com::sun::star::lang::IllegalArgumentException 66 If <var>Selection</var> is not a selectable object for this <type>XMultiSelectionSupplier</type>. 67 <p>Adding an object to the selection that is already part of the selection should not raise this exception</p> 68 */ 69 boolean addSelection( [in] any Selection ) 70 raises( com::sun::star::lang::IllegalArgumentException ); 71 72 //------------------------------------------------------------------------- 73 74 /** remove the object or objects represented by <var>Selection</var> from the 75 selection of this <type>XMultiSelectionSupplier</type>. 76 77 @param Selection 78 either an Object that is selectable or a sequence of objects that are selectable. 79 80 @returns 81 <TRUE/>/, if <var>Selection</var> was added to the current selection. 82 <FALSE/>, if <var>Selection</var> or parts of <var>Selection</var> could not be 83 added to the current selection. For example, if the selection already contains 84 objects that are forbidden to be selected together with <var>Selection</var>. 85 86 @throws com::sun::star::lang::IllegalArgumentException 87 If <var>Selection</var> is not a selectable object for this <type>XMultiSelectionSupplier</type>. 88 <p>Removing an object from the selection that is not part of the selection should not raise this exception</p> 89 */ 90 void removeSelection( [in] any Selection ) 91 raises( com::sun::star::lang::IllegalArgumentException ); 92 93 //------------------------------------------------------------------------- 94 95 /** clears the selection of this <type>XMultiSelectionSupplier</type>. 96 */ 97 void clearSelection(); 98 99 //------------------------------------------------------------------------- 100 101 /** returns the number of selected objects of this <type>XMultiSelectionSupplier</type>. 102 */ 103 long getSelectionCount(); 104 105 //------------------------------------------------------------------------- 106 107 /** @returns 108 a new object to enumerate the selection of this <type>XMultiSelectionSupplier</type>. 109 It returns NULL if there are no objects in the selection. 110 */ 111 com::sun::star::container::XEnumeration createSelectionEnumeration(); 112 113 114 /** @returns 115 a new object to enumerate the selection of this <type>XMultiSelectionSupplier</type> 116 in reverse order. If the order of the selected objects 117 It returns NULL if there are no objects in the selection. 118 */ 119 com::sun::star::container::XEnumeration createReverseSelectionEnumeration(); 120 121}; 122 123//============================================================================= 124 125}; }; }; }; 126 127#endif 128