home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / DRAWCL.PAK / DRAWDOC.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  1.9 KB  |  73 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-1995 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. #if !defined(_MAC)
  15. #include "summinfo.h"
  16. #endif
  17.  
  18. class CDrawView;
  19.  
  20. class CDrawDoc : public COleDocument
  21. {
  22. protected: // create from serialization only
  23.     CDrawDoc();
  24.     DECLARE_DYNCREATE(CDrawDoc)
  25.  
  26. // Attributes
  27. public:
  28.     CDrawObjList* GetObjects() { return &m_objects; }
  29.     const CSize& GetSize() const { return m_size; }
  30.     void ComputePageSize();
  31.     int GetMapMode() const { return m_nMapMode; }
  32.     COLORREF GetPaperColor() const { return m_paperColor; }
  33. #if !defined(_MAC)
  34.     CSummInfo *m_pSummInfo;
  35. #endif
  36.  
  37. // Operations
  38. public:
  39.     CDrawObj* ObjectAt(const CPoint& point);
  40.     void Draw(CDC* pDC, CDrawView* pView);
  41.     void Add(CDrawObj* pObj);
  42.     void Remove(CDrawObj* pObj);
  43.  
  44. // Implementation
  45. public:
  46.     virtual ~CDrawDoc();
  47.     virtual void Serialize(CArchive& ar);   // overridden for document i/o
  48. #ifdef _DEBUG
  49.     virtual void AssertValid() const;
  50.     virtual void Dump(CDumpContext& dc) const;
  51. #endif
  52.  
  53. protected:
  54.     virtual BOOL OnNewDocument();
  55.     virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
  56.     virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
  57.  
  58.     CDrawObjList m_objects;
  59.     CSize m_size;
  60.     int m_nMapMode;
  61.     COLORREF m_paperColor;
  62.  
  63. // Generated message map functions
  64. protected:
  65.     //{{AFX_MSG(CDrawDoc)
  66.     afx_msg void OnViewPaperColor();
  67.     afx_msg void OnFileSummaryInfo();
  68.     //}}AFX_MSG
  69.     DECLARE_MESSAGE_MAP()
  70. };
  71.  
  72. /////////////////////////////////////////////////////////////////////////////
  73.