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.

173 lines
4.7 KiB

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1995 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. #ifndef __AFXCMN2_H__
  11. #define __AFXCMN2_H__
  12. #ifndef __AFXWIN_H__
  13. #include <afxwin.h>
  14. #endif
  15. #ifdef _AFX_MINREBUILD
  16. #pragma component(minrebuild, off)
  17. #endif
  18. #ifndef _AFX_FULLTYPEINFO
  19. #pragma component(mintypeinfo, on)
  20. #endif
  21. #ifndef IMAGE_BITMAP
  22. #define IMAGE_BITMAP 0
  23. #endif
  24. /////////////////////////////////////////////////////////////////////////////
  25. #ifdef _AFX_PACKING
  26. #pragma pack(push, _AFX_PACKING)
  27. #endif
  28. #ifndef _RICHEDIT_
  29. #include "richedit.h"
  30. #endif
  31. #ifdef __AFXOLE_H__ // only include richole if OLE support is included
  32. #ifndef _RICHOLE_
  33. #include <richole.h>
  34. #define _RICHOLE_
  35. #endif
  36. #else
  37. struct IRichEditOle;
  38. struct IRichEditOleCallback;
  39. #endif
  40. /////////////////////////////////////////////////////////////////////////////
  41. // AFXCMN2 - RichEdit2 Control Class
  42. // Classes declared in this file
  43. //CObject
  44. //CCmdTarget;
  45. //CWnd
  46. class CRichEdit2Ctrl;
  47. #undef AFX_DATA
  48. #define AFX_DATA
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CRichEdit2Ctrl
  51. class CRichEdit2Ctrl : public CWnd
  52. {
  53. DECLARE_DYNAMIC(CRichEdit2Ctrl)
  54. // Constructors
  55. public:
  56. CRichEdit2Ctrl();
  57. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
  58. // Attributes
  59. BOOL CanUndo() const;
  60. int GetLineCount() const;
  61. BOOL GetModify() const;
  62. void SetModify(BOOL bModified = TRUE);
  63. void GetRect(LPRECT lpRect) const;
  64. CPoint GetCharPos(long lChar) const;
  65. void SetOptions(WORD wOp, DWORD dwFlags);
  66. // NOTE: first word in lpszBuffer must contain the size of the buffer!
  67. int GetLine(int nIndex, LPTSTR lpszBuffer) const;
  68. int GetLine(int nIndex, LPTSTR lpszBuffer, int nMaxLength) const;
  69. BOOL CanPaste(UINT nFormat = 0) const;
  70. void GetSel(long& nStartChar, long& nEndChar) const;
  71. void GetSel(CHARRANGE &cr) const;
  72. void LimitText(long nChars = 0);
  73. long LineFromChar(long nIndex) const;
  74. void SetSel(long nStartChar, long nEndChar);
  75. void SetSel(CHARRANGE &cr);
  76. DWORD GetDefaultCharFormat(CHARFORMAT &cf) const;
  77. DWORD GetSelectionCharFormat(CHARFORMAT &cf) const;
  78. long GetEventMask() const;
  79. long GetLimitText() const;
  80. DWORD GetParaFormat(PARAFORMAT &pf) const;
  81. // richedit EM_GETSELTEXT is ANSI
  82. long GetSelText(LPSTR lpBuf) const;
  83. CString GetSelText() const;
  84. WORD GetSelectionType() const;
  85. COLORREF SetBackgroundColor(BOOL bSysColor, COLORREF cr);
  86. BOOL SetDefaultCharFormat(CHARFORMAT &cf);
  87. BOOL SetSelectionCharFormat(CHARFORMAT &cf);
  88. BOOL SetWordCharFormat(CHARFORMAT &cf);
  89. DWORD SetEventMask(DWORD dwEventMask);
  90. BOOL SetParaFormat(PARAFORMAT &pf);
  91. BOOL SetTargetDevice(HDC hDC, long lLineWidth);
  92. BOOL SetTargetDevice(CDC &dc, long lLineWidth);
  93. long GetTextLength() const;
  94. BOOL SetReadOnly(BOOL bReadOnly = TRUE);
  95. int GetFirstVisibleLine() const;
  96. // Operations
  97. void EmptyUndoBuffer();
  98. int LineIndex(int nLine = -1) const;
  99. int LineLength(int nLine = -1) const;
  100. void LineScroll(int nLines, int nChars = 0);
  101. void ReplaceSel(LPCTSTR lpszNewText, BOOL bCanUndo = FALSE);
  102. void SetRect(LPCRECT lpRect);
  103. BOOL DisplayBand(LPRECT pDisplayRect);
  104. long FindText(DWORD dwFlags, FINDTEXTEX* pFindText) const;
  105. long FormatRange(FORMATRANGE* pfr, BOOL bDisplay = TRUE);
  106. void HideSelection(BOOL bHide, BOOL bPerm);
  107. void PasteSpecial(UINT nClipFormat, DWORD dvAspect = 0, HMETAFILE hMF = 0);
  108. void RequestResize();
  109. long StreamIn(int nFormat, EDITSTREAM &es);
  110. long StreamOut(int nFormat, EDITSTREAM &es);
  111. // Clipboard operations
  112. BOOL Undo();
  113. void Clear();
  114. void Copy();
  115. void Cut();
  116. void Paste();
  117. // OLE support
  118. IRichEditOle* GetIRichEditOle() const;
  119. BOOL SetOLECallback(IRichEditOleCallback* pCallback);
  120. // Implementation
  121. public:
  122. virtual ~CRichEdit2Ctrl();
  123. };
  124. /////////////////////////////////////////////////////////////////////////////
  125. // Inline function declarations
  126. #ifdef _AFX_PACKING
  127. #pragma pack(pop)
  128. #endif
  129. #ifdef _AFX_ENABLE_INLINES
  130. #define _AFXCMN_INLINE inline
  131. #include <afxcmn2.inl>
  132. #undef _AFXCMN_INLINE
  133. #endif
  134. #undef AFX_DATA
  135. #define AFX_DATA
  136. #ifdef _AFX_MINREBUILD
  137. #pragma component(minrebuild, on)
  138. #endif
  139. #ifndef _AFX_FULLTYPEINFO
  140. #pragma component(mintypeinfo, off)
  141. #endif
  142. #endif //__AFXCMN2_H__
  143. /////////////////////////////////////////////////////////////////////////////