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_RICHDOCUMENT_H__9D4A133E_6F29_4BF5_8CCF_2A02830663D5__INCLUDED_)
00023 #define AFX_RICHDOCUMENT_H__9D4A133E_6F29_4BF5_8CCF_2A02830663D5__INCLUDED_
00024
00025 #pragma once
00026
00027 class CRichElement;
00028 class CXMLElement;
00029
00030
00031 class CRichDocument
00032 {
00033
00034 public:
00035 CRichDocument();
00036 virtual ~CRichDocument();
00037
00038
00039 public:
00040 CCriticalSection m_pSection;
00041 CPtrList m_pElements;
00042 DWORD m_nCookie;
00043 public:
00044 CSize m_szMargin;
00045 COLORREF m_crBackground;
00046 COLORREF m_crText;
00047 COLORREF m_crLink;
00048 COLORREF m_crHover;
00049 COLORREF m_crHeading;
00050 public:
00051 CFont m_fntNormal;
00052 CFont m_fntBold;
00053 CFont m_fntItalic;
00054 CFont m_fntUnder;
00055 CFont m_fntBoldUnder;
00056 CFont m_fntHeading;
00057
00058
00059 public:
00060 POSITION GetIterator() const;
00061 CRichElement* GetNext(POSITION& pos) const;
00062 CRichElement* GetPrev(POSITION& pos) const;
00063 int GetCount() const;
00064 POSITION Find(CRichElement* pElement) const;
00065 public:
00066 CRichElement* Add(CRichElement* pElement, POSITION posBefore = NULL);
00067 CRichElement* Add(int nType, LPCTSTR pszText, LPCTSTR pszLink = NULL, DWORD nFlags = 0, int nGroup = 0, POSITION posBefore = NULL);
00068 void Remove(CRichElement* pElement);
00069 void ShowGroup(int nGroup, BOOL bShow = TRUE);
00070 void ShowGroupRange(int nMin, int nMax, BOOL bShow = TRUE);
00071 void SetModified();
00072 void Clear();
00073 public:
00074 BOOL LoadXML(CXMLElement* pBase, CMapStringToPtr* pMap = NULL, int nGroup = 0);
00075 void CreateFonts(LPCTSTR pszFaceName = theApp.m_sDefaultFont, int nSize = 12);
00076 protected:
00077 BOOL LoadXMLStyles(CXMLElement* pParent);
00078 BOOL LoadXMLColour(CXMLElement* pXML, LPCTSTR pszName, COLORREF* pColour);
00079 };
00080
00081 #endif // !defined(AFX_RICHDOCUMENT_H__9D4A133E_6F29_4BF5_8CCF_2A02830663D5__INCLUDED_)