#pragma once
#include "commonobject.h"

class CBlock : public CCommonObject
{
public:
	CBlock(CStringList &slIns, CStringList &slOuts, CString strName, CStringA strOrigin, CPoint TopLeftOrigin);
	CBlock(int nIns, int nOuts, CString *strIns, CString *strOuts, CString strName, CStringA strOrigin, CPoint TopLeftOrigin,GraphicsPath *gp, GraphicsPath *gpText, CRect *rectIn, CRect *rectOut, bool *bInvIn, bool*bInvOut);
	~CBlock(void);

	void OutScreen(Graphics &g);
	void OutXml(stringstream &ss) {};
	void OutXmlDrawing(stringstream &ss);
	bool HitTest(CPoint point);
	CCommonObject* Clone(CPoint TopLeftOrigin, CString strNewName, int nRotation);
	CString GetObjectName(){return m_strUniqueName;}
	void SetConnection(bool bIn, int nPos, CCommonObject* pConnectTo);
	void DisconnectCObject(CCommonObject *pObject);
	void Disconnect();

private:
	void ResetGPath();
	void TransformCObject(Matrix* pMat);
	void InitInOutRectangles();
	void CreateTags();

public:
	CString *m_strInTags; // used for creating name tags inside block
	CString *m_strOutTags; // used for creating name tags inside block

private:
	int m_nBlockWidth;
	int m_nBlockHeigth;
	Brush *m_pTextBrush;
	//CStringA m_strOrigin; // filepath
	CStringList m_slContent;
	
};
