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

contenttaghandler.h

00001 /*
00002 
00003   Copyright (C) 2003  Razvan Cojocaru <razvanco@gmx.net>
00004  
00005   This program is free software; you can redistribute it and/or modify
00006   it under the terms of the GNU General Public License as published by
00007   the Free Software Foundation; either version 2 of the License, or
00008   (at your option) any later version.
00009   
00010   This program is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013   GNU General Public License for more details.
00014   
00015   You should have received a copy of the GNU General Public License
00016   along with this program; if not, write to the Free Software
00017   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 
00019 */
00020 
00021 
00022 #ifndef __CONTENTTAGHANDLER_H_
00023 #define __CONTENTTAGHANDLER_H_
00024 
00025 #include <wx/html/htmlpars.h>
00026 #include <wx/treectrl.h>
00027 #include <wx/font.h>
00028 #include <wx/string.h>
00029 
00030 
00031 class CHMListCtrl;
00032 
00033 
00040 
00041 class ContentParser : public wxHtmlParser {
00042 public:
00044         wxObject* GetProduct() { return NULL; }
00045 
00046 protected:
00048         virtual void AddText(const wxChar* WXUNUSED(txt)) {}
00049 };
00050 
00051 
00063 struct URLTreeItem : public wxTreeItemData {
00064 
00066         URLTreeItem(const wxString& str) : _url(str) {}
00067 
00069         wxString _url;
00070 };
00071 
00072 
00079 
00080 #define TREE_BUF_SIZE 128
00081 
00082 
00084 class ContentTagHandler : public wxHtmlTagHandler {
00085 
00086 public:
00096         ContentTagHandler(wxFontEncoding enc, bool useEnc,
00097                           wxTreeCtrl* tree = NULL, 
00098                           CHMListCtrl *list = NULL);
00099 
00101         wxString GetSupportedTags() { return wxT("UL,OBJECT,PARAM"); }
00102 
00108         bool HandleTag(const wxHtmlTag& tag);
00109 
00110 private:
00111         wxTreeItemId _parents[TREE_BUF_SIZE];
00112         int _level;
00113         wxTreeCtrl* _treeCtrl;
00114         CHMListCtrl* _listCtrl;
00115         
00116         wxString _title;
00117         wxString _url;
00118 
00119         wxFontEncoding _enc;
00120         bool _useEnc;
00121 };
00122 
00123 
00124 #endif // __CONTENTTAGHANDLER_H_

Generated on Mon Feb 21 11:08:37 2005 for xCHM by  doxygen 1.4.0