]> git.lyx.org Git - lyx.git/blob - src/sgml.h
Tweak layout in GToc
[lyx.git] / src / sgml.h
1 // -*- C++ -*-
2 /**
3  * \file sgml.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author José Matos
8  * \author John Levon
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef SGML_H
14 #define SGML_H
15
16 #include "support/types.h"
17
18 #include <iosfwd>
19 #include <string>
20 #include <utility>
21
22 class Buffer;
23 class Paragraph;
24 class OutputParams;
25
26 namespace sgml {
27
28 /**
29  * Escape the given character, if necessary,
30  * to an SGML entity. Returns true
31  * if it was a whitespace character.
32  */
33 std::pair<bool, std::string> escapeChar(char c);
34
35 /// Escape a word instead of a single character
36 std::string escapeString(std::string const & raw);
37
38 /// replaces illegal characters from SGML/XML ID attributes
39 std::string cleanID(Buffer const & buf, OutputParams const & runparams,
40                     std::string const & orig);
41
42 /// returns a unique numeric id
43 std::string const uniqueID(std::string const label);
44
45 /// Opens tag
46 void openTag(std::ostream & os, std::string const & name,
47             std::string const & attribute = std::string());
48
49 /// Open tag
50 void openTag(Buffer const & buf, std::ostream & os,
51              OutputParams const & runparams, Paragraph const & par);
52
53 /// Close tag
54 void closeTag(std::ostream & os, std::string const & name);
55
56 /// Close tag
57 void closeTag(std::ostream & os, Paragraph const & par);
58 }
59 #endif // SGML_H