//| //| HTML Browser for the Fast Light Tool Kit (FLTK). //| //| Copyright 1998-1999 by Vivality llc, Venice, CA, U.S.A. //| and Matthias Melcher. //| //| This library is free software; you can redistribute it and/or //| modify it under the terms of the GNU Library General Public //| License as published by the Free Software Foundation; either //| version 2 of the License, or (at your option) any later version. //| //| This library is distributed in the hope that it will be useful, //| but WITHOUT ANY WARRANTY; without even the implied warranty of //| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //| Library General Public License for more details. //| //| You should have received a copy of the GNU Library General Public //| License along with this library; if not, write to the Free Software //| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 //| USA. //| //| Please report all bugs and problems to "matthias@mediaone.net". //| #ifndef FL_HELP_H #define FL_HELP_H #include "FL/Fl_Widget.H" #include "FL/Fl_Select_Browser.H" #include class Fl_Help : public Fl_Widget { public: Fl_Help(int, int, int, int, char *name=0L); }; typedef char *_FlString; class Fl_Simple_Html: public Fl_Select_Browser { public: Fl_Simple_Html(int, int, int, int, char *name=0L); virtual ~Fl_Simple_Html(); int read(const char *html, const char *path=0L); int load(const char *filename, const char *path=0L); void gotoAnchor(const char *a); void clear(); const char *url() { return url_; } const char *previousUrl() { return prevUrl_; } protected: int handle(int); int read(); int readHtml(); int readText(); int readWord(_FlString &c); int readArg(_FlString &c); void rewind(); void flush(); void gotoTagEnd(); void add(const char*, const char*, int n=0, void *user=0L); int addWord(const char *word, int n); void addAnchor(const char*, int); void addHref(const char*, int); protected: const char *inText; FILE *inFile; char *lineBuffer, *crsr, *outBuffer, *outCrsr, *docPath, *url_, *prevUrl_; int flags, clearFlags, indent, td, dl, heading, fsize, fontCnt; struct Anchor *anchor; int nAnchor, NAnchor; struct Href *href; int nHref, NHref; }; #endif