"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/src/include/bbcodegenerator.h" (12 May 2020, 2506 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                          bbcodegenerator.h  -  description
    3                              -------------------
    4     begin                : Jul 20 2009
    5     copyright            : (C) 2004-2007 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 BBCODEGENERATOR_H
   29 #define BBCODEGENERATOR_H
   30 
   31 #include <string>
   32 
   33 #include "codegenerator.h"
   34 #include "charcodes.h"
   35 #include "version.h"
   36 
   37 namespace highlight
   38 {
   39 
   40 /**
   41    \brief This class generates BBCode.
   42 
   43    It contains information about the resulting document structure (document
   44    header and footer), the colour system, white space handling and text
   45    formatting attributes.
   46 
   47 * @author Andre Simon
   48 */
   49 
   50 class BBCodeGenerator : public highlight::CodeGenerator
   51 {
   52 public:
   53     BBCodeGenerator();
   54     ~BBCodeGenerator();
   55 
   56     /** prints document header
   57      */
   58     string getHeader();
   59 
   60     /** Prints document footer*/
   61     string getFooter();
   62 
   63     /** Prints document body*/
   64     void printBody();
   65 
   66 private:
   67 
   68     /** \return escaped character*/
   69     virtual string maskCharacter ( unsigned char );
   70 
   71     /** @return BBcode open tags */
   72     string getOpenTag (const ElementStyle & elem );
   73 
   74     /** @return BBcode close tags */
   75     string  getCloseTag ( const ElementStyle &elem );
   76 
   77     /** initialize tags in specific format according to colouring information provided in DucumentStyle */
   78     void initOutputTags();
   79 
   80     /** @param styleID current style ID
   81         @return matching sequence to begin a new element formatting*/
   82     string getKeywordOpenTag ( unsigned int styleID );
   83 
   84     /** @param styleID current style ID
   85         @return matching  sequence to stop element formatting*/
   86     string getKeywordCloseTag ( unsigned int styleID );
   87 };
   88 
   89 }
   90 #endif