xref: /trunk/main/sd/inc/shapelist.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1*c45d927aSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*c45d927aSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*c45d927aSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*c45d927aSAndrew Rist  * distributed with this work for additional information
6*c45d927aSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*c45d927aSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*c45d927aSAndrew Rist  * "License"); you may not use this file except in compliance
9*c45d927aSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*c45d927aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*c45d927aSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*c45d927aSAndrew Rist  * software distributed under the License is distributed on an
15*c45d927aSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*c45d927aSAndrew Rist  * KIND, either express or implied.  See the License for the
17*c45d927aSAndrew Rist  * specific language governing permissions and limitations
18*c45d927aSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*c45d927aSAndrew Rist  *************************************************************/
21*c45d927aSAndrew Rist 
22*c45d927aSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SHAPELIST_HXX
25cdf0e10cSrcweir #define _SHAPELIST_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <svx/sdrobjectuser.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include <list>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir namespace sd
32cdf0e10cSrcweir {
33cdf0e10cSrcweir     class ShapeList : public sdr::ObjectUser
34cdf0e10cSrcweir     {
35cdf0e10cSrcweir     public:
36cdf0e10cSrcweir         ShapeList();
37cdf0e10cSrcweir         virtual ~ShapeList();
38cdf0e10cSrcweir 
39cdf0e10cSrcweir         /** adds the given shape to this list */
40cdf0e10cSrcweir         void addShape( SdrObject& rObject );
41cdf0e10cSrcweir 
42cdf0e10cSrcweir         /** removes the shape from this list and returns
43cdf0e10cSrcweir             a pointer to the next shape in list or 0*/
44cdf0e10cSrcweir         SdrObject* removeShape( SdrObject& rObject );
45cdf0e10cSrcweir 
46cdf0e10cSrcweir         /** removes all shapes from this list */
47cdf0e10cSrcweir         void clear();
48cdf0e10cSrcweir 
49cdf0e10cSrcweir         /** returns true if this list is empty */
50cdf0e10cSrcweir         bool isEmpty() const;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir         /** returns true if given shape is part of this list */
53cdf0e10cSrcweir         bool hasShape( SdrObject& rObject ) const;
54cdf0e10cSrcweir 
55cdf0e10cSrcweir         /** returns the shape following the given shape in the list or 0
56cdf0e10cSrcweir             returns the first shape if pObj is 0 */
57cdf0e10cSrcweir         SdrObject* getNextShape(SdrObject* pObj) const;
58cdf0e10cSrcweir 
59cdf0e10cSrcweir         /**
60cdf0e10cSrcweir         */
61cdf0e10cSrcweir         SdrObject* getNextShape();
62cdf0e10cSrcweir 
63cdf0e10cSrcweir         /**
64cdf0e10cSrcweir         */
65cdf0e10cSrcweir         void seekShape( sal_uInt32 nIndex );
66cdf0e10cSrcweir 
67cdf0e10cSrcweir         /**
68cdf0e10cSrcweir         */
69cdf0e10cSrcweir         bool hasMore() const;
70cdf0e10cSrcweir 
getList() const71cdf0e10cSrcweir         const std::list< SdrObject* >& getList() const { return maShapeList; }
72cdf0e10cSrcweir 
73cdf0e10cSrcweir     private:
74cdf0e10cSrcweir         virtual void ObjectInDestruction(const SdrObject& rObject);
75cdf0e10cSrcweir 
76cdf0e10cSrcweir         typedef std::list< SdrObject* > ListImpl;
77cdf0e10cSrcweir         ListImpl maShapeList;
78cdf0e10cSrcweir         ListImpl::iterator maIter;
79cdf0e10cSrcweir     };
80cdf0e10cSrcweir }
81cdf0e10cSrcweir 
82cdf0e10cSrcweir #endif     // _SHAPELIST_HXX
83