summaryrefslogtreecommitdiffstats
path: root/src/mechanics/mechanicsgroup.h
blob: 0908d6653de70ab73ce923bd6178de8a5207421b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/***************************************************************************
 *   Copyright (C) 2005 by David Saxton                                    *
 *   david@bluehaze.org                                                    *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 ***************************************************************************/

#ifndef MECHANICSGROUP_H
#define MECHANICSGROUP_H

#include <itemgroup.h>


class MechanicsItem;
class MechanicsDocument;
typedef TQValueList<MechanicsItem*> MechanicsItemList;

/**
@author David Saxton
*/
class MechanicsGroup : public ItemGroup
{
Q_OBJECT
  TQ_OBJECT
public:
	MechanicsGroup( MechanicsDocument *mechanicsDocument, const char *name = 0);
	~MechanicsGroup();
	
	/**
	 * Returns a list of top-level mechanics items only
	 */
	MechanicsItemList toplevelMechItemList() const;
	/**
	 * Sets the selection mode of all MechanicsItems in the group
	 */
	void setSelectionMode( uint sm );
	/**
	 * "Raises" (increases the z value of) the selected group of items
	 */
	void setRaised( bool isRaised );
	/**
	 * Removes all the tqchildren of the given item from the group
	 */
	void removeChildren( Item *item );
	bool addItem( Item *item );
	bool removeItem( Item *item );
	virtual bool addTQCanvasItem(TQCanvasItem* item);
	virtual bool contains(TQCanvasItem* item) const;
	virtual uint count() const { return itemCount(); }
	virtual void deleteAllItems();
	virtual void mergeGroup(ItemGroup* group);
	virtual void removeAllItems();
	virtual void removeTQCanvasItem(TQCanvasItem* item);
	virtual void setItems(TQCanvasItemList list);
	/**
	 * Sets the selected state of all items in the group
	 */
	virtual void setSelected( bool sel );
	/**
	 * Extracts the mechanics items from the item list
	 */
	MechanicsItemList extractMechanicsItems() const;
	
protected:
	void updateInfo();
	
	bool b_isRaised;
};

#endif