OLEDOC.H
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:3k
源码类别:

Windows编程

开发平台:

Visual C++

  1. /**************************************************************************
  2.    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  3.    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  4.    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5.    PARTICULAR PURPOSE.
  6.    Copyright 1997 Microsoft Corporation.  All Rights Reserved.
  7. **************************************************************************/
  8. /******************************************************************************
  9.    File:          OleDoc.h
  10.    
  11.    Description:   COleDocumentView definitions.
  12. ******************************************************************************/
  13. #ifndef OLEDOC_H
  14. #define OLEDOC_H
  15. #include "DOServer.h"
  16. /**************************************************************************
  17.    COleDocument class definition
  18. **************************************************************************/
  19. class COleDocumentView;
  20. class COleObject;
  21. class CDataObject;
  22. class COleInPlaceObject;
  23. class COleInPlaceActiveObject;
  24. class CPersistStorage;
  25. class CPersistFile;
  26. class COleDocument : public IOleDocument
  27. {
  28. friend class COleDocumentView;
  29. friend class COleObject;
  30. friend class CDataObject;
  31. friend class COleInPlaceObject;
  32. friend class COleInPlaceActiveObject;
  33. friend class CPersistStorage;
  34. private:
  35.    COLORREF                m_Color;
  36. DWORD                   m_dwRegister;
  37. LPOLECLIENTSITE         m_pOleClientSite;
  38.    DWORD                   m_ObjRefCount;
  39.    BOOL                    m_fDirty;
  40.    BOOL                    m_fNoScribbleMode;
  41.    LPOLEADVISEHOLDER       m_pOleAdviseHolder;
  42.    BOOL                    m_fCreated;
  43.    COleDocumentView        *m_pOleDocView;
  44.    COleObject              *m_pOleObject;
  45.    CDataObject             *m_pDataObject;
  46.    COleInPlaceObject       *m_pOleInPlaceObject;
  47.    COleInPlaceActiveObject *m_pOleInPlaceActiveObject;
  48.    CPersistStorage         *m_pPersistStorage;
  49.    CPersistFile            *m_pPersistFile;
  50.    
  51. public:
  52.    COleDocument();
  53.    ~COleDocument();
  54.    
  55.    //IUnknown methods
  56.    STDMETHODIMP QueryInterface(REFIID, LPVOID*);
  57.    STDMETHODIMP_(DWORD) AddRef();
  58.    STDMETHODIMP_(DWORD) Release();
  59.    //IOleDocument methods
  60.    STDMETHODIMP CreateView(IOleInPlaceSite*, IStream*, DWORD, IOleDocumentView**);
  61.    STDMETHODIMP GetDocMiscStatus(DWORD*);
  62.    STDMETHODIMP EnumViews(IEnumOleDocumentViews**, IOleDocumentView**);
  63.    //public utility methods
  64.    BOOL RegisterServer(void);
  65.    BOOL CreateFile(HWND);
  66.    BOOL CreateFile(LPTSTR);
  67.    
  68. private:
  69.    STDMETHODIMP GetWindow(HWND*);
  70.    STDMETHODIMP DeactivateUI();
  71.    STDMETHODIMP DeactivateInPlace();
  72. friend BOOL CALLBACK ColorHookProc(HWND, UINT, WPARAM, LPARAM);
  73. };
  74. #endif   //OLEDOC_H