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