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.

184 lines
7.2 KiB

  1. // Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1993 Microsoft Corporation,
  3. // All rights reserved.
  4. // This source code is only intended as a supplement to the
  5. // Microsoft Foundation Classes Reference and Microsoft
  6. // QuickHelp and/or WinHelp documentation provided with the library.
  7. // See these sources for detailed information regarding the
  8. // Microsoft Foundation Classes product.
  9. // Inlines for AFXOLE.H
  10. /////////////////////////////////////////////////////////////////////////////
  11. // General OLE inlines (CDocItem, COleDocument)
  12. #ifdef _AFXOLE_INLINE
  13. // CDocItem
  14. _AFXOLE_INLINE CDocument* CDocItem::GetDocument() const
  15. { return m_pDocument; }
  16. // COleDocument
  17. _AFXOLE_INLINE void COleDocument::EnableCompoundFile(BOOL bEnable)
  18. { m_bCompoundFile = bEnable; }
  19. // COleMessageFilter
  20. _AFXOLE_INLINE void COleMessageFilter::SetBusyReply(SERVERCALL nBusyReply)
  21. { ASSERT_VALID(this); m_nBusyReply = nBusyReply; }
  22. _AFXOLE_INLINE void COleMessageFilter::SetRetryReply(DWORD nRetryReply)
  23. { ASSERT_VALID(this); m_nRetryReply = nRetryReply; }
  24. _AFXOLE_INLINE void COleMessageFilter::SetMessagePendingDelay(DWORD nTimeout)
  25. { ASSERT_VALID(this); m_nTimeout = nTimeout; }
  26. _AFXOLE_INLINE void COleMessageFilter::EnableBusyDialog(BOOL bEnable)
  27. { ASSERT_VALID(this); m_bEnableBusy = bEnable; }
  28. _AFXOLE_INLINE void COleMessageFilter::EnableNotRespondingDialog(BOOL bEnable)
  29. { ASSERT_VALID(this); m_bEnableNotResponding = bEnable; }
  30. #endif //_AFXOLE_INLINE
  31. /////////////////////////////////////////////////////////////////////////////
  32. // OLE automation inlines
  33. #ifdef _AFXDISP_INLINE
  34. // COleException
  35. _AFXDISP_INLINE COleException::COleException()
  36. { m_sc = S_OK; }
  37. // CCmdTarget
  38. _AFXDISP_INLINE DWORD CCmdTarget::InternalAddRef()
  39. { ASSERT(GetInterfaceMap() != NULL); return ++m_dwRef; }
  40. // CObjectFactory
  41. _AFXDISP_INLINE BOOL COleObjectFactory::IsRegistered() const
  42. { ASSERT_VALID(this); return m_dwRegister != 0; }
  43. _AFXDISP_INLINE REFCLSID COleObjectFactory::GetClassID() const
  44. { ASSERT_VALID(this); return m_clsid; }
  45. // COleDispatchDriver
  46. _AFXDISP_INLINE COleDispatchDriver::~COleDispatchDriver()
  47. { ReleaseDispatch(); }
  48. #endif //_AFXDISP_INLINE
  49. /////////////////////////////////////////////////////////////////////////////
  50. // OLE Container inlines
  51. #ifdef _AFXOLECLI_INLINE
  52. // COleClientItem
  53. _AFXOLECLI_INLINE SCODE COleClientItem::GetLastStatus() const
  54. { ASSERT_VALID(this); return m_scLast; }
  55. _AFXOLECLI_INLINE COleDocument* COleClientItem::GetDocument() const
  56. { ASSERT_VALID(this); return (COleDocument*)m_pDocument; }
  57. _AFXOLECLI_INLINE OLE_OBJTYPE COleClientItem::GetType() const
  58. { ASSERT_VALID(this); return m_nItemType; }
  59. _AFXOLECLI_INLINE DVASPECT COleClientItem::GetDrawAspect() const
  60. { ASSERT_VALID(this); return m_nDrawAspect; }
  61. _AFXOLECLI_INLINE BOOL COleClientItem::IsRunning() const
  62. { ASSERT_VALID(this);
  63. ASSERT(m_lpObject != NULL);
  64. return ::OleIsRunning(m_lpObject); }
  65. _AFXOLECLI_INLINE UINT COleClientItem::GetItemState() const
  66. { ASSERT_VALID(this); return m_nItemState; }
  67. _AFXOLECLI_INLINE BOOL COleClientItem::IsInPlaceActive() const
  68. { ASSERT_VALID(this);
  69. return m_nItemState == activeState || m_nItemState == activeUIState; }
  70. _AFXOLECLI_INLINE BOOL COleClientItem::IsOpen() const
  71. { ASSERT_VALID(this); return m_nItemState == openState; }
  72. _AFXOLECLI_INLINE BOOL COleClientItem::IsLinkUpToDate() const
  73. { ASSERT_VALID(this);
  74. ASSERT(m_lpObject != NULL);
  75. // TRUE if result is S_OK (aka S_TRUE)
  76. return m_lpObject->IsUpToDate() == NOERROR; }
  77. _AFXOLECLI_INLINE CView* COleClientItem::GetActiveView() const
  78. { return m_pView; }
  79. #endif //_AFXOLECLI_INLINE
  80. #ifdef _AFXOLEDOBJ_INLINE
  81. // COleDataObject
  82. _AFXOLEDOBJ_INLINE COleDataObject::~COleDataObject()
  83. { Release(); }
  84. #endif //_AFXOLECTL_INLINE
  85. /////////////////////////////////////////////////////////////////////////////
  86. // OLE dialog inlines
  87. #ifdef _AFXODLGS_INLINE
  88. _AFXODLGS_INLINE UINT COleDialog::GetLastError() const
  89. { return m_nLastError; }
  90. _AFXODLGS_INLINE CString COleInsertDialog::GetPathName() const
  91. { ASSERT_VALID(this);
  92. ASSERT(GetSelectionType() != createNewItem); return m_szFileName; }
  93. _AFXODLGS_INLINE REFCLSID COleInsertDialog::GetClassID() const
  94. { ASSERT_VALID(this); return m_io.clsid; }
  95. _AFXODLGS_INLINE HGLOBAL COleInsertDialog::GetIconicMetafile() const
  96. { ASSERT_VALID(this); return m_io.hMetaPict; }
  97. _AFXODLGS_INLINE DVASPECT COleInsertDialog::GetDrawAspect() const
  98. { ASSERT_VALID(this); return m_io.dwFlags & IOF_CHECKDISPLAYASICON ?
  99. DVASPECT_ICON : DVASPECT_CONTENT; }
  100. _AFXODLGS_INLINE HGLOBAL COleConvertDialog::GetIconicMetafile() const
  101. { ASSERT_VALID(this); return m_cv.hMetaPict; }
  102. _AFXODLGS_INLINE DVASPECT COleConvertDialog::GetDrawAspect() const
  103. { ASSERT_VALID(this); return (DVASPECT)m_cv.dvAspect; }
  104. _AFXODLGS_INLINE REFCLSID COleConvertDialog::GetClassID() const
  105. { ASSERT_VALID(this); return m_cv.clsidNew; }
  106. _AFXODLGS_INLINE HGLOBAL COleChangeIconDialog::GetIconicMetafile() const
  107. { ASSERT_VALID(this); return m_ci.hMetaPict; }
  108. _AFXODLGS_INLINE int COlePasteSpecialDialog::GetPasteIndex() const
  109. { ASSERT_VALID(this); return m_ps.nSelectedIndex; }
  110. _AFXODLGS_INLINE DVASPECT COlePasteSpecialDialog::GetDrawAspect() const
  111. { ASSERT_VALID(this); return m_ps.dwFlags & PSF_CHECKDISPLAYASICON ?
  112. DVASPECT_ICON : DVASPECT_CONTENT; }
  113. _AFXODLGS_INLINE HGLOBAL COlePasteSpecialDialog::GetIconicMetafile() const
  114. { ASSERT_VALID(this); return m_ps.hMetaPict; }
  115. _AFXODLGS_INLINE UINT COleBusyDialog::GetSelectionType() const
  116. { ASSERT_VALID(this); return m_selection; }
  117. #endif //_AFXODLGS_INLINE
  118. /////////////////////////////////////////////////////////////////////////////
  119. // OLE Server inlines
  120. #ifdef _AFXOLESVR_INLINE
  121. // COleServerItem
  122. _AFXOLESVR_INLINE COleServerDoc* COleServerItem::GetDocument() const
  123. { ASSERT_VALID(this); return (COleServerDoc*)m_pDocument; }
  124. _AFXOLESVR_INLINE void COleServerItem::NotifyChanged(DVASPECT nDrawAspect)
  125. { ASSERT_VALID(this); NotifyClient(OLE_CHANGED, nDrawAspect); }
  126. _AFXOLESVR_INLINE const CString& COleServerItem::GetItemName() const
  127. { ASSERT_VALID(this); return m_strItemName; }
  128. _AFXOLESVR_INLINE void COleServerItem::SetItemName(const char* pszItemName)
  129. {
  130. ASSERT_VALID(this);
  131. ASSERT(pszItemName != NULL);
  132. ASSERT(AfxIsValidString(pszItemName));
  133. m_strItemName = pszItemName;
  134. }
  135. _AFXOLESVR_INLINE BOOL COleServerItem::IsLinkedItem() const
  136. { ASSERT_VALID(this); return GetDocument()->m_pEmbeddedItem != this; }
  137. _AFXOLESVR_INLINE COleDataSource* COleServerItem::GetDataSource()
  138. { ASSERT_VALID(this); return &m_dataSource; }
  139. // COleServerDoc
  140. _AFXOLESVR_INLINE void COleServerDoc::NotifyChanged()
  141. { ASSERT_VALID(this); NotifyAllItems(OLE_CHANGED, DVASPECT_CONTENT); }
  142. _AFXOLESVR_INLINE void COleServerDoc::NotifyClosed()
  143. { ASSERT_VALID(this); NotifyAllItems(OLE_CLOSED, 0); }
  144. _AFXOLESVR_INLINE void COleServerDoc::NotifySaved()
  145. { ASSERT_VALID(this); NotifyAllItems(OLE_SAVED, 0); }
  146. _AFXOLESVR_INLINE BOOL COleServerDoc::IsEmbedded() const
  147. { ASSERT_VALID(this); return m_strPathName.IsEmpty(); }
  148. _AFXOLESVR_INLINE BOOL COleServerDoc::IsInPlaceActive() const
  149. { ASSERT_VALID(this); return m_pInPlaceFrame != NULL; }
  150. #endif //_AFXOLESVR_INLINE
  151. /////////////////////////////////////////////////////////////////////////////