00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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:
00095 ContentTagHandler(wxFontEncoding enc, wxTreeCtrl* tree = NULL,
00096 CHMListCtrl *list = NULL);
00097
00099 wxString GetSupportedTags() { return wxT("UL,OBJECT,PARAM"); }
00100
00106 bool HandleTag(const wxHtmlTag& tag);
00107
00108 private:
00109 wxTreeItemId _parents[TREE_BUF_SIZE];
00110 int _level;
00111 wxTreeCtrl* _treeCtrl;
00112 CHMListCtrl* _listCtrl;
00113
00114 wxString _title;
00115 wxString _url;
00116
00117 wxFontEncoding _enc;
00118 bool _useEnc;
00119 int _counter;
00120 };
00121
00122
00123 #endif // __CONTENTTAGHANDLER_H_