"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/src/include/odtgenerator.h" (12 May 2020, 2532 Bytes) of package /windows/www/highlight-3.57-x64.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /***************************************************************************
    2                          odtgenerator.h  -  description
    3                              -------------------
    4     begin                : Jul 19 2012
    5     copyright            : (C) 2004-2012 by Andre Simon
    6     email                : a.simon@mailbox.org
    7  ***************************************************************************/
    8 
    9 
   10 /*
   11 This file is part of Highlight.
   12 
   13 Highlight is free software: you can redistribute it and/or modify
   14 it under the terms of the GNU General Public License as published by
   15 the Free Software Foundation, either version 3 of the License, or
   16 (at your option) any later version.
   17 
   18 Highlight is distributed in the hope that it will be useful,
   19 but WITHOUT ANY WARRANTY; without even the implied warranty of
   20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   21 GNU General Public License for more details.
   22 
   23 You should have received a copy of the GNU General Public License
   24 along with Highlight.  If not, see <http://www.gnu.org/licenses/>.
   25 */
   26 
   27 
   28 #ifndef ODTGENERATOR_H
   29 #define ODTGENERATOR_H
   30 
   31 #include <string>
   32 
   33 #include "codegenerator.h"
   34 #include "version.h"
   35 
   36 namespace highlight
   37 {
   38 
   39 /**
   40    \brief This class generates OpenDocument Textfiles (Flat XML).
   41 
   42    It contains information about the resulting document structure (document
   43    header and footer), the colour system, white space handling and text
   44    formatting attributes.
   45 
   46 * @author Andre Simon
   47 */
   48 
   49 class ODTGenerator : public highlight::CodeGenerator
   50 {
   51 public:
   52     ODTGenerator();
   53     ~ODTGenerator();
   54 
   55     /** prints document header
   56      */
   57     string getHeader();
   58 
   59     /** Prints document footer*/
   60     string getFooter();
   61 
   62     /** Prints document body*/
   63     void printBody();
   64 
   65 private:
   66 
   67     /** \return escaped character*/
   68     virtual string maskCharacter ( unsigned char );
   69 
   70     /** @return ODT open tags */
   71     string getOpenTag ( const string& styleName );
   72 
   73     /** initialize tags in specific format according to colouring information provided in DucumentStyle */
   74     void initOutputTags();
   75 
   76     /** @param styleID current style ID
   77         @return matching sequence to begin a new element formatting*/
   78     string getKeywordOpenTag ( unsigned int styleID );
   79 
   80     /** @param styleID current style ID
   81         @return matching  sequence to stop element formatting*/
   82     string getKeywordCloseTag ( unsigned int styleID );
   83 
   84     string styleDefinitionCache;
   85 
   86     string getStyleDefinition();
   87 
   88     string getAttributes ( const string &, const ElementStyle & );
   89 };
   90 
   91 }
   92 #endif