home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / ole / drawcli / drawdoc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  1.8 KB  |  69 lines

  1. // drawdoc.h : interface of the CDrawDoc class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "drawobj.h"
  14. #include "summinfo.h"
  15.  
  16. class CDrawView;
  17.  
  18. class CDrawDoc : public COleDocument
  19. {
  20. protected: // create from serialization only
  21.     CDrawDoc();
  22.     DECLARE_DYNCREATE(CDrawDoc)
  23.  
  24. // Attributes
  25. public:
  26.     CDrawObjList* GetObjects() { return &m_objects; }
  27.     const CSize& GetSize() const { return m_size; }
  28.     void ComputePageSize();
  29.     int GetMapMode() const { return m_nMapMode; }
  30.     COLORREF GetPaperColor() const { return m_paperColor; }
  31.     CSummInfo *m_pSummInfo;
  32.  
  33. // Operations
  34. public:
  35.     CDrawObj* ObjectAt(const CPoint& point);
  36.     void Draw(CDC* pDC, CDrawView* pView);
  37.     void Add(CDrawObj* pObj);
  38.     void Remove(CDrawObj* pObj);
  39.  
  40. // Implementation
  41. public:
  42.     virtual ~CDrawDoc();
  43.     virtual void Serialize(CArchive& ar);   // overridden for document i/o
  44. #ifdef _DEBUG
  45.     virtual void AssertValid() const;
  46.     virtual void Dump(CDumpContext& dc) const;
  47. #endif
  48.  
  49. protected:
  50.     virtual BOOL OnNewDocument();
  51.     virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
  52.     virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
  53.  
  54.     CDrawObjList m_objects;
  55.     CSize m_size;
  56.     int m_nMapMode;
  57.     COLORREF m_paperColor;
  58.  
  59. // Generated message map functions
  60. protected:
  61.     //{{AFX_MSG(CDrawDoc)
  62.     afx_msg void OnViewPaperColor();
  63.     afx_msg void OnFileSummaryInfo();
  64.     //}}AFX_MSG
  65.     DECLARE_MESSAGE_MAP()
  66. };
  67.  
  68. /////////////////////////////////////////////////////////////////////////////
  69.