Orb/Doxygen/src/xmlditacodegenerator.h
changeset 0 42188c7ea2d9
equal deleted inserted replaced
-1:000000000000 0:42188c7ea2d9
       
     1 /******************************************************************************
       
     2  *
       
     3  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4  *
       
     5  * Permission to use, copy, modify, and distribute this software and its
       
     6  * documentation under the terms of the GNU General Public License is hereby 
       
     7  * granted. No representations are made about the suitability of this software 
       
     8  * for any purpose. It is provided "as is" without express or implied warranty.
       
     9  * See the GNU General Public License for more details.
       
    10  *
       
    11  */
       
    12 
       
    13 #ifndef XMLDITACODEGENERATOR_H
       
    14 #define XMLDITACODEGENERATOR_H
       
    15 
       
    16 #include "outputgen.h"
       
    17 //#include "definition.h"
       
    18 #include "config.h"
       
    19 //#include "xmlditalink.h"
       
    20 #include "xmlwriter.h"
       
    21 
       
    22 /* TODO: Decide how to implement this in DITA.
       
    23 Do we use the elements in:
       
    24 Chapter 14 Programming Elements
       
    25 of the DITA Version 1.1 Language Specification?
       
    26 e.g. <sep> <kwd> etc.?
       
    27 */
       
    28 /** Macro to remove implementaiton code from the XMLDITACodeGenerator
       
    29 If defined as 0 then all the implementation 
       
    30 */
       
    31 #define DITA_CODE_GENERATE 0
       
    32 class XMLDITACodeGenerator : public CodeOutputInterface
       
    33 {
       
    34 public:
       
    35 	XMLDITACodeGenerator(XmlStream &t);
       
    36 	virtual ~XMLDITACodeGenerator();
       
    37 	void codify(const char *text);
       
    38     void writeCodeLink(const char *ref,const char *file,
       
    39                        const char *anchor,const char *name,
       
    40                        const char *tooltip);
       
    41 	void startCodeLine();
       
    42 	void endCodeLine();
       
    43 	void startCodeAnchor(const char *id);
       
    44 	void endCodeAnchor();
       
    45 	void startFontClass(const char *colorClass);
       
    46 	void endFontClass();
       
    47 	void writeCodeAnchor(const char *);
       
    48     void writeLineNumber(const char *extRef,const char *compId,
       
    49                          const char *anchorId,int l);
       
    50 	void linkableSymbol(int, const char *,Definition *,Definition *);
       
    51     void finish();
       
    52   private:
       
    53     XmlStream &m_xs;
       
    54 	XmlElementStack m_xes;
       
    55     QCString m_refId;
       
    56     QCString m_external;
       
    57     int m_lineNumber;
       
    58     bool m_isMemberRef;
       
    59     int col;
       
    60     bool m_insideCodeLine;
       
    61     bool m_normalHLNeedStartTag;
       
    62     bool m_insideSpecialHL;
       
    63 	void writeXMLDITACodeString(XmlStream &xt, const char *s, int &col);
       
    64 };
       
    65 
       
    66 #endif // XMLDITACODEGENERATOR_H