xref: /aoo42x/main/sd/inc/shapelist.hxx (revision 67e470da)
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 
24 #ifndef _SHAPELIST_HXX
25 #define _SHAPELIST_HXX
26 
27 #include <svx/sdrobjectuser.hxx>
28 
29 #include <list>
30 
31 namespace sd
32 {
33 	class ShapeList : public sdr::ObjectUser
34 	{
35 	public:
36 		ShapeList();
37 		virtual ~ShapeList();
38 
39 		/** adds the given shape to this list */
40 		void addShape( SdrObject& rObject );
41 
42 		/** removes the shape from this list and returns
43 			a pointer to the next shape in list or 0*/
44 		SdrObject* removeShape( SdrObject& rObject );
45 
46 		/** removes all shapes from this list */
47 		void clear();
48 
49 		/** returns true if this list is empty */
50 		bool isEmpty() const;
51 
52 		/** returns true if given shape is part of this list */
53 		bool hasShape( SdrObject& rObject ) const;
54 
55 		/** returns the shape following the given shape in the list or 0
56 			returns the first shape if pObj is 0 */
57 		SdrObject* getNextShape(SdrObject* pObj) const;
58 
59 		/**
60 		*/
61 		SdrObject* getNextShape();
62 
63 		/**
64 		*/
65 		void seekShape( sal_uInt32 nIndex );
66 
67 		/**
68 		*/
69 		bool hasMore() const;
70 
getList() const71         const std::list< SdrObject* >& getList() const { return maShapeList; }
72 
73 	private:
74 		virtual void ObjectInDestruction(const SdrObject& rObject);
75 
76 		typedef std::list< SdrObject* > ListImpl;
77 		ListImpl maShapeList;
78 		ListImpl::iterator maIter;
79 	};
80 }
81 
82 #endif	   // _SHAPELIST_HXX
83