Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.0 KiB

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10. // class CRectItem - main COleClientItem bounded by a rectangle
  11. class CMainDoc;
  12. class CMainView;
  13. class CRectItem : public COleClientItem
  14. {
  15. DECLARE_SERIAL(CRectItem)
  16. CRectItem();
  17. public:
  18. CRectItem(COleDocument* pContainer);
  19. ~CRectItem();
  20. // Attributes
  21. CPoint m_ptPos; //position in document
  22. CSize GetSize(); //current size
  23. void SetSize(CSize size);
  24. CSize GetBaseSize(); //base size
  25. void SetBaseSize(CSize size);
  26. CRect GetRect() //current rect
  27. { return CRect(m_ptPos, GetSize()); }
  28. void SetRect(CRect& rect);
  29. CMainDoc* GetDocument()
  30. { return (CMainDoc*)COleClientItem::GetDocument(); }
  31. CMainView* GetActiveView()
  32. { return (CMainView*)COleClientItem::GetActiveView(); }
  33. // Operations
  34. void Dirty()
  35. { GetDocument()->SetModifiedFlag(); }
  36. void Invalidate(CView* pNotThisView = NULL);
  37. BOOL UpdateExtent();
  38. void Move(CRect &rc);
  39. void ResetSize();
  40. void GetNativeClipboardData(COleDataSource *pDataSource);
  41. virtual void Serialize(CArchive& ar); // from CObject - public to call directly
  42. // Overridables
  43. protected:
  44. virtual void OnChange(OLE_NOTIFICATION wNotification, DWORD dwParam);
  45. virtual BOOL OnChangeItemPosition(const CRect& rectPos);
  46. virtual void OnActivate();
  47. virtual COleDataSource* OnGetClipboardData(BOOL bIncludeLink,
  48. LPPOINT lpOffset, LPSIZE lpSize);
  49. virtual void OnDeactivateUI(BOOL bUndoable);
  50. public:
  51. virtual void OnGetItemPosition(CRect& rPosition);
  52. protected:
  53. CSize m_sizeIcon; //current size
  54. CSize m_sizeContent; //current size
  55. CSize m_sizeIconExtent; //default size
  56. CSize m_sizeContentExtent; //default size
  57. };