Leaked source code of windows server 2003
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.

102 lines
3.3 KiB

  1. // pbrusdoc.h : interface of the CPBDoc class
  2. //
  3. /***************************************************************************/
  4. class CPBSrvrItem;
  5. class CBitmapObj;
  6. class CPBDoc : public COleServerDoc
  7. {
  8. protected: // create from serialization only
  9. CPBDoc();
  10. DECLARE_DYNCREATE( CPBDoc )
  11. // Attributes
  12. public:
  13. CBitmapObj* m_pBitmapObj;
  14. CBitmapObj* m_pBitmapObjNew;
  15. CString m_sName;
  16. BOOL m_bNewDoc;
  17. BOOL m_bObjectLoaded;
  18. BOOL m_bPaintFormat;
  19. BOOL m_bNonBitmapFile; // TRUE if we loaded a non .BMP file.
  20. BOOL m_bSaveViaFilter; // TRUE if using an installed filter
  21. BOOL m_bManualTruncate;
  22. BOOL m_bHasSeenAFileError;
  23. LONG m_wChangeNotifyEventId;
  24. // Operations
  25. public:
  26. CPBSrvrItem* GetEmbeddedItem()
  27. { return (CPBSrvrItem*)COleServerDoc::GetEmbeddedItem(); }
  28. BOOL CreateNewDocument();
  29. BOOL SaveTheDocument();
  30. BOOL Finish();
  31. void OLESerialize(CArchive& ar); // overridden for document i/o
  32. BOOL SerializeBitmap(CArchive& ar, CBitmapObj* pBitmapCur,
  33. CBitmapObj* pBitmapNew, BOOL bOLEObject);
  34. void SetDibHandle (HGLOBAL hDib);
  35. // Implementation
  36. public:
  37. virtual ~CPBDoc();
  38. virtual void Serialize(CArchive& ar); // overridden for document i/o
  39. virtual void SaveToStorage(CObject* pObject);
  40. virtual void LoadFromStorage();
  41. virtual BOOL OnOpenDocument( const TCHAR* pszPathName );
  42. virtual BOOL OnSaveDocument( const TCHAR* pszPathName );
  43. virtual CFile* GetFile(LPCTSTR lpszFileName, UINT nOpenFlags, CFileException* pError);
  44. virtual void ReleaseFile(CFile* pFile, BOOL bAbort);
  45. virtual BOOL CanCloseFrame( CFrameWnd* pFrame );
  46. virtual BOOL SaveModified(); // return TRUE if ok to continue
  47. virtual BOOL DoSave(LPCTSTR lpszPathName, BOOL bReplace=TRUE);
  48. virtual BOOL OnUpdateDocument ();
  49. virtual COleServerItem* OnGetEmbeddedItem();
  50. virtual COleServerItem* OnGetLinkedItem( LPCTSTR lpszItemName );
  51. #ifdef _DEBUG
  52. virtual void AssertValid() const;
  53. virtual void Dump(CDumpContext& dc) const;
  54. #endif
  55. // Must be public so it can be called from Escape handler
  56. virtual void OnDeactivateUI(BOOL bUndoable);
  57. protected:
  58. DECLARE_INTERFACE_MAP()
  59. BEGIN_INTERFACE_PART(PBPersistStg, IPersistStorage)
  60. INIT_INTERFACE_PART(CPBDoc, PBPersistStg)
  61. STDMETHOD(GetClassID)(LPCLSID);
  62. STDMETHOD(IsDirty)();
  63. STDMETHOD(InitNew)(LPSTORAGE);
  64. STDMETHOD(Load)(LPSTORAGE);
  65. STDMETHOD(Save)(LPSTORAGE, BOOL);
  66. STDMETHOD(SaveCompleted)(LPSTORAGE);
  67. STDMETHOD(HandsOffStorage)();
  68. END_INTERFACE_PART(PBPersistStg)
  69. protected:
  70. virtual BOOL OnNewDocument();
  71. virtual void OnShowControlBars(CFrameWnd *pFrame, BOOL bShow);
  72. // Generated message map functions
  73. protected:
  74. //{{AFX_MSG(CPBDoc)
  75. afx_msg void MyOnFileUpdate();
  76. //}}AFX_MSG
  77. virtual void ReportSaveLoadException(LPCTSTR, CException*, BOOL, UINT);
  78. DECLARE_MESSAGE_MAP()
  79. };
  80. /***************************************************************************/