00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(AFX_RICHELEMENT_H__6026BA51_4D21_49AC_AB93_96EF387BFFEA__INCLUDED_)
00023 #define AFX_RICHELEMENT_H__6026BA51_4D21_49AC_AB93_96EF387BFFEA__INCLUDED_
00024
00025 #pragma once
00026
00027 class CRichDocument;
00028 class CRichFragment;
00029 class CRichViewCtrl;
00030
00031
00032 class CRichElement
00033 {
00034
00035 public:
00036 CRichElement(int nType = 0, LPCTSTR pszText = NULL, LPCTSTR pszLink = NULL, DWORD nFlags = 0, int nGroup = 0);
00037 virtual ~CRichElement();
00038
00039
00040 public:
00041 CRichDocument* m_pDocument;
00042 int m_nType;
00043 int m_nGroup;
00044 DWORD m_nFlags;
00045 CString m_sText;
00046 CString m_sLink;
00047 DWORD m_hImage;
00048 COLORREF m_cColour;
00049
00050
00051 public:
00052 void Show(BOOL bShow = TRUE);
00053 void SetText(LPCTSTR pszText);
00054 void SetFlags(DWORD nFlags, DWORD nMask = 0xFFFFFFFF);
00055 void Delete();
00056 protected:
00057 void PrePaint(CDC* pDC, BOOL bHover);
00058 void PrePaintBitmap(CDC* pDC);
00059 void PrePaintIcon(CDC* pDC);
00060 CSize GetSize();
00061
00062 friend class CRichFragment;
00063 friend class CRichViewCtrl;
00064 };
00065
00066 enum
00067 {
00068 retNull, retNewline, retGap, retAlign,
00069 retBitmap, retIcon, retAnchor, retCmdIcon, retEmoticon,
00070 retText, retLink, retHeading,
00071 };
00072
00073 enum
00074 {
00075 retfNull = 0x00,
00076 retfBold = 0x01,
00077 retfItalic = 0x02,
00078 retfUnderline = 0x04,
00079 retfHeading = 0x08,
00080 retfMiddle = 0x10,
00081 retfColour = 0x20,
00082 retfHidden = 0x80,
00083 };
00084
00085 enum
00086 {
00087 reaLeft, reaCenter, reaRight
00088 };
00089
00090 #endif // !defined(AFX_RICHELEMENT_H__6026BA51_4D21_49AC_AB93_96EF387BFFEA__INCLUDED_)