summaryrefslogtreecommitdiffstats
path: root/src/flowcontainer.h
blob: a26afad52e0031422912cefc19455bfcab6709f2 (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
74
75
76
77
78
79
/***************************************************************************
 *   Copyright (C) 2003-2004 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 FLOWCONTAINER_H
#define FLOWCONTAINER_H

#include "flowpart.h"

class RectangularOverlay;

/**
@author David Saxton
*/
class FlowContainer : public FlowPart
{
TQ_OBJECT
  
public:
	FlowContainer( ICNDocument *_icnView, bool newItem, const TQString &id );
	virtual ~FlowContainer();
	
	virtual bool canResize() const { return true; }
	/**
	 * Sets the bound to a simple rectangle if true, so that ICNDocument
	 * can tell whether an item is being dropped into it
	 */
	void setFullBounds( bool full );
	
	virtual void updateConnectorPoints( bool add = true );
	/**
	 * Returns whether the container is currently expanded or not
	 */
	bool isExpanded() const { return b_expanded; }
	/**
	 * Returns true if one of this parents is collapsed.
	 */
	bool parentIsCollapsed() const;
	void setExpanded( bool expanded );

	virtual void setSelected( bool yes );
	virtual void setVisible( bool yes );
	
	virtual TQSize minimumSize() const;
	/**
	 * Update the visibility of items, connectors, nodes in the flowcontainer
	 */
	void updateContainedVisibility();
	
protected:
	virtual void itemPointsChanged() {};
	virtual void updateNodeLevels();
	virtual void childAdded( Item *child );
	virtual void childRemoved( Item *child );
	virtual void updateAttachedPositioning();
	virtual void postResize();
	virtual void filterEndPartIDs( TQStringList *ids );
	virtual void drawShape( TQPainter &p );
	void createTopContainerNode();
	void createBotContainerNode();
	
	virtual void buttonStateChanged(const TQString &id, bool state);

	FPNode *m_ext_in;
	FPNode *m_int_in;
	FPNode *m_int_out;
	FPNode *m_ext_out;
	RectangularOverlay *m_rectangularOverlay;

	bool b_expanded;
};

#endif