// CntrItem.h : interface of the CTestProgCntrItem class
//

#pragma once

class CTestProgDoc;
class CTestProgView;

class CTestProgCntrItem : public COleClientItem
{
	DECLARE_SERIAL(CTestProgCntrItem)

// Constructors
public:
	CTestProgCntrItem(CTestProgDoc* pContainer = NULL);
		// Note: pContainer is allowed to be NULL to enable IMPLEMENT_SERIALIZE
		//  IMPLEMENT_SERIALIZE requires the class have a constructor with
		//  zero arguments.  Normally, OLE items are constructed with a
		//  non-NULL document pointer

// Attributes
public:
	CTestProgDoc* GetDocument()
		{ return reinterpret_cast<CTestProgDoc*>(COleClientItem::GetDocument()); }
	CTestProgView* GetActiveView()
		{ return reinterpret_cast<CTestProgView*>(COleClientItem::GetActiveView()); }

	public:
	virtual void OnChange(OLE_NOTIFICATION wNotification, DWORD dwParam);
	virtual void OnActivate();
	protected:
	virtual void OnGetItemPosition(CRect& rPosition);
	virtual void OnDeactivateUI(BOOL bUndoable);
	virtual BOOL OnChangeItemPosition(const CRect& rectPos);
	virtual BOOL CanActivate();

// Implementation
public:
	~CTestProgCntrItem();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif
	virtual void Serialize(CArchive& ar);
};

