1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sortedobjs.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SORTEDOBJS_HXX
31 #define _SORTEDOBJS_HXX
32 class SwSortedObjsImpl
;
33 class SwAnchoredObject
;
35 #include <sal/types.h>
37 /** class for collecting anchored objects
40 Anchored objects can be inserted and deleted. The entries can be directly
42 An anchored object is inserted sorted. The sort criteria are:
44 - order 1: to-page, 2: to-fly, 3: to-paragraph|to-character|as-character
46 - wrapping style (inclusive layer)
47 - order 1: wrapping style != SURROUND_THROUGHT and not in hell layer,
48 2: wrapping style = SURROUND_THROUGHT or in hell layer
49 - wrapping style influence
50 - order 1: NONE_SUCCESSIVE_POSITIONED, 2: NONE_CONCURRENT_POSITIONED
52 - order 1: to-paragraph, 2: to-character, 3: as-character
53 - anchor node position
54 - internal anchor order number
55 If one of the sort criteria attributes of an anchored object changes,
56 the sorting has to be updated - use method <Update(..)>
63 SwSortedObjsImpl
* mpImpl
;
69 sal_uInt32
Count() const;
71 /** direct access to the entries
74 input parameter - index of entry, valid value range [0..Count()-1]
78 SwAnchoredObject
* operator[]( sal_uInt32 _nIndex
) const;
80 bool Insert( SwAnchoredObject
& _rAnchoredObj
);
82 bool Remove( SwAnchoredObject
& _rAnchoredObj
);
84 bool Contains( const SwAnchoredObject
& _rAnchoredObj
) const;
86 /** method to update the position of the given anchored object in the
93 @return boolean, indicating success of the update.
95 bool Update( SwAnchoredObject
& _rAnchoredObj
);
97 /** Position of object <_rAnchoredObj> in sorted list
100 Returns the number of the list position of object <_rAnchoredObj>.
101 Returns <Count()>, if object isn't contained in list.
106 Number of the list position of object <_rAnchoredObj>
108 sal_uInt32
ListPosOf( const SwAnchoredObject
& _rAnchoredObj
) const;