Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

RichDocument.h

Go to the documentation of this file.
00001 //
00002 // RichDocument.h
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 // Construction
00034 public:
00035         CRichDocument();
00036         virtual ~CRichDocument();
00037         
00038 // Attributes
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 // Operations
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_)

Generated on Thu Dec 15 10:39:47 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2