rtfgenerator.h

00001 /***************************************************************************
00002                           rtfcode.h  -  description
00003                              -------------------
00004     begin                : Die Jul 9 2002
00005     copyright            : (C) 2002 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 #ifndef RTFGENERATOR_H
00019 #define RTFGENERATOR_H
00020 
00021 #include <iostream>
00022 #include <fstream>
00023 #include <string>
00024 #include <sstream>
00025 
00026 #include "codegenerator.h"
00027 #include "charcodes.h"
00028 #include "version.h"
00029 
00030 namespace highlight {
00031 
00043 struct PageSize {
00044   int width;
00045   int height;
00046   PageSize(){
00047   }
00048   PageSize(int w, int h){
00049     width=w;
00050     height = h;
00051   }
00052 };
00053 
00054 typedef  map<string, struct PageSize> PagesizeMap;
00055 
00056 class RtfGenerator : public highlight::CodeGenerator
00057   {
00058   public:
00059 
00060     RtfGenerator();
00061 
00062     ~RtfGenerator();
00063 
00069    bool initStyle(const string& stylePath);
00070 
00074     string getHeader(const string & title);
00075 
00077     string getFooter();
00078 
00080     void printBody();
00081 
00083    void setPageSize(const string & ps);
00084 
00085   private:
00086 
00087     PagesizeMap psMap;
00088     string pageSize;
00089 
00091     virtual string maskCharacter(unsigned char );
00092 
00094     string  formatStyleAttributes( const ElementStyle & col);
00095 
00097     string getOpenTag(int styleNumber,const ElementStyle &);
00098 
00099     string getCloseTag(const ElementStyle &);
00100 
00101     string getMatchingOpenTag(unsigned int styleID);
00102     string getMatchingCloseTag(unsigned int styleID);
00103   };
00104 
00105 }
00106 #endif

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