htmlgenerator.h

00001 /***************************************************************************
00002                           htmlgenerator.h  -  description
00003                              -------------------
00004     begin                : Wed Nov 28 2001
00005     copyright            : (C) 2001 by Andre Simon
00006     email                : andre.simon1@gmx.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 
00019 #ifndef HTMLGENERATOR_H
00020 #define HTMLGENERATOR_H
00021 
00022 #include <fstream>
00023 #include <iostream>
00024 #include <string>
00025 #include <sstream>
00026 
00027 #include "codegenerator.h"
00028 #include "version.h"
00029 #include "stylecolour.h"
00030 #include "elementstyle.h"
00031 #include "platform_fs.h"
00032 
00033 namespace highlight {
00034 
00045 class HtmlGenerator  : public highlight::CodeGenerator
00046   {
00047   public:
00048 
00049     HtmlGenerator();
00050 
00052     virtual ~HtmlGenerator() {};
00053 
00056     virtual void insertLineNumber(bool insertNewLine=true);
00057 
00061     string getHeader(const string &title);
00062 
00064     void printBody();
00065 
00067     string getFooter();
00068 
00072      bool printExternalStyle(const string &outFile);
00073 
00078      bool printIndexFile(const vector<string> & fileList, const string &outPath);
00079 
00083      void setAttachAnchors(bool b){ attachAnchors = b; }
00084 
00088      void setOrderedList(bool b){ orderedList = b; }
00089 
00090   protected:
00091 
00093     string brTag, hrTag, idAttr, fileSuffix;
00094 
00096     //string HTML_FOOTER;
00097 
00099     string styleDefinitionCache;
00100 
00102     bool orderedList;
00103 
00105     string  getStyleDefinition();
00106 
00108     string readUserStyleDef();
00109 
00112     virtual string getHeaderStart(const string &title);
00113 
00114     string getGeneratorComment();
00115 
00116   private:
00117 
00121     string getOpenTag(const string& styleName);
00122 
00124     virtual string maskCharacter(unsigned char );
00125 
00127     bool attachAnchors;
00128 
00130     string  formatStyleAttributes(const string & elemName, const ElementStyle & elem);
00131 
00135     string getMatchingOpenTag(unsigned int styleID);
00136 
00140     string getMatchingCloseTag(unsigned int styleID);
00141 
00142     string getNewLine();
00143   };
00144 
00145 }
00146 
00147 #endif

Generated on Fri Apr 27 13:12:36 2007 for Highlight Code Converter by  doxygen 1.5.2