Скачиваний:
11
Добавлен:
01.05.2014
Размер:
3.9 Кб
Скачать
// SketcherDoc.h : interface of the CSketcherDoc class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_SKETCHERDOC_H__7645EBAE_C2DE_4989_9BCD_03B688FC673F__INCLUDED_)
#define AFX_SKETCHERDOC_H__7645EBAE_C2DE_4989_9BCD_03B688FC673F__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//////////////////////////////////////////////////////////////////////////
#include "ShapeContainer.h"
//////////////////////////////////////////////////////////////////////////
#define HINT_UPDATE_WINDOW  0
#define HINT_UPDATE_ITEM    1
//////////////////////////////////////////////////////////////////////////
class CSketcherSrvrItem;
//////////////////////////////////////////////////////////////////////////

class CSketcherDoc : public COleServerDoc
{
protected: // create from serialization only
	
	CSketcherDoc();
	DECLARE_DYNCREATE(CSketcherDoc)

// Attributes
public:
	
	CSketcherSrvrItem* GetEmbeddedItem()
		{ return (CSketcherSrvrItem*)COleServerDoc::GetEmbeddedItem(); }

protected:
	
    ShapeContainer* _shapeContainer;
    // Document size
	
	CSize m_DocSize;
// Operations
public:
    // Retrieve the document size
    
    CSize GetDocSize(){ return m_DocSize; }
	
    ShapeContainer* getShapeContainer() const { return _shapeContainer; }
	
    CRect GetDocExtent();                     // Get the bounding rectangle for the whole document

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSketcherDoc)
	public:
	
	virtual BOOL OnNewDocument();
	
	virtual void Serialize(CArchive& ar);
	
	virtual BOOL OnUpdateDocument();
	
	virtual void OnSetItemRects(LPCRECT lpPosRect, LPCRECT lpClipRect);
	protected:
	
	virtual COleServerItem* OnGetEmbeddedItem();
	//}}AFX_VIRTUAL

// Implementation
public:
	
	virtual ~CSketcherDoc();
#ifdef _DEBUG
	
	virtual void AssertValid() const;
	
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	
	virtual CDocObjectServer* GetDocObjectServer(LPOLEDOCUMENTSITE pDocSite);

// Generated message map functions
protected:
	//{{AFX_MSG(CSketcherDoc)
	
	afx_msg void OnColorBlack();
	
	afx_msg void OnColorRed();
	
	afx_msg void OnElementLine();
	
	afx_msg void OnElementRectangle();
	
	afx_msg void OnUpdateColorBlack(CCmdUI* pCmdUI);
	
	afx_msg void OnUpdateColorRed(CCmdUI* pCmdUI);
	
	afx_msg void OnUpdateElementLine(CCmdUI* pCmdUI);
	
	afx_msg void OnUpdateElementRectangle(CCmdUI* pCmdUI);
	
	afx_msg void OnElementOval();
	
	afx_msg void OnUpdateElementOval(CCmdUI* pCmdUI);
	
	afx_msg void OnUpdateElementText(CCmdUI* pCmdUI);
	
	afx_msg void OnElementText();
	
	afx_msg void OnElementTextInOval();
	
	afx_msg void OnUpdateElementTextInOval(CCmdUI* pCmdUI);
	
	afx_msg void OnElementRibble();
	
	afx_msg void OnUpdateElementRibble(CCmdUI* pCmdUI);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

	// Generated OLE dispatch map functions
	//{{AFX_DISPATCH(CSketcherDoc)
	
	afx_msg BOOL deleteElement(LPCTSTR key);
	
	afx_msg void showWindow();
	
	afx_msg void drawTextInOval(float x, float y, LPCTSTR content, float r1, float r2);
	
	afx_msg void drawText(float x, float y, LPCTSTR content);
	
	afx_msg void drawRectangle(float x, float y, float height, float width);
	
	afx_msg void drawOval(float x, float y, float r1, float r2);
	
	afx_msg void addRibble(LPCTSTR id1, LPCTSTR id2);
	
	afx_msg void removeRibble(LPCTSTR id1, LPCTSTR id2);
	//}}AFX_DISPATCH
	DECLARE_DISPATCH_MAP()
	DECLARE_INTERFACE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SKETCHERDOC_H__7645EBAE_C2DE_4989_9BCD_03B688FC673F__INCLUDED_)
Соседние файлы в папке Sketcher