Update ooo320-m1
[ooovba.git] / sw / source / core / inc / sortedobjs.hxx
blob86c4ceb84ff6f0a4c6b4f45e2c64b4798b44db51
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sortedobjs.hxx,v $
10 * $Revision: 1.5 $
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
39 for #i28701#
40 Anchored objects can be inserted and deleted. The entries can be directly
41 accessed via index.
42 An anchored object is inserted sorted. The sort criteria are:
43 - anchor type
44 - order 1: to-page, 2: to-fly, 3: to-paragraph|to-character|as-character
45 - anchor node
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
51 - again anchor type
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(..)>
58 @author OD
60 class SwSortedObjs
62 private:
63 SwSortedObjsImpl* mpImpl;
65 public:
66 SwSortedObjs();
67 ~SwSortedObjs();
69 sal_uInt32 Count() const;
71 /** direct access to the entries
73 @param _nIndex
74 input parameter - index of entry, valid value range [0..Count()-1]
76 @author OD
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
87 sorted list
89 OD 2004-07-01
91 @author OD
93 @return boolean, indicating success of the update.
95 bool Update( SwAnchoredObject& _rAnchoredObj );
97 /** Position of object <_rAnchoredObj> in sorted list
99 OD 2004-05-07
100 Returns the number of the list position of object <_rAnchoredObj>.
101 Returns <Count()>, if object isn't contained in list.
103 @author OD
105 @return sal_uInt32
106 Number of the list position of object <_rAnchoredObj>
108 sal_uInt32 ListPosOf( const SwAnchoredObject& _rAnchoredObj ) const;
111 #endif