]> git.lyx.org Git - lyx.git/blob - src/output_latex.h
Add Sam Crawley to credits.
[lyx.git] / src / output_latex.h
1 // -*- C++ -*-
2 /**
3  * \file output_latex.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef OUTPUT_LATEX_H
13 #define OUTPUT_LATEX_H
14
15 #include <utility>
16
17 #include "support/docstream.h"
18 #include "Layout.h"
19 #include "ParagraphList.h"
20
21
22 namespace lyx {
23
24 class Buffer;
25 class BufferParams;
26 class Encoding;
27 class Paragraph;
28 class OutputParams;
29 class Text;
30
31 /** Register a language switch when using polyglossia or begin/end commands.
32     Set \p localswitch to true if a local command switch is used.
33  */
34 void pushLanguageName(std::string const & lang, bool localswitch = false);
35
36 /** Unregister the last language switch when using polyglossia
37     or begin/end commands.
38  */
39 void popLanguageName();
40
41 /** Return a reference to the last active language opened with
42     polyglossia or when using begin/end commands. If none or when
43     using babel with only a begin command, return a reference to
44     an empty string.
45  */
46 std::string const & openLanguageName();
47
48 /** Export optional and required arguments of the paragraph \p par.
49     Non-existing required arguments are output empty: {}.
50  */
51 void latexArgInsets(Paragraph const & par,
52                     otexstream & os, OutputParams const & runparams,
53                     Layout::LaTeXArgMap const & latexargs,
54                     std::string const & prefix = std::string());
55 /// Same for merged environments
56 void latexArgInsets(ParagraphList const & pars,
57                     ParagraphList::const_iterator pit,
58                     otexstream & os, OutputParams const & runparams,
59                     Layout::LaTeXArgMap const & latexargs,
60                     std::string const & prefix = std::string());
61 /// Same for InsetLayouts
62 void latexArgInsetsForParent(ParagraphList const & pars, otexstream & os,
63                              OutputParams const & runparams,
64                              Layout::LaTeXArgMap const & latexargs,
65                              std::string const & prefix = std::string());
66 /** Export \p paragraphs of buffer \p buf to LaTeX.
67     Don't use a temporary stringstream for \p os if the final output is
68     supposed to go to a file.
69     \sa Buffer::writeLaTeXSource for the reason.
70  */
71 void latexParagraphs(Buffer const & buf,
72                      Text const & text,
73                      otexstream & ofs,
74                      OutputParams const &,
75                      std::string const & everypar = std::string());
76
77 /** Switch the encoding of \p os from runparams.encoding to \p newEnc if needed.
78     \p force forces this also within non-default or -auto encodings.
79     \return (did the encoding change?, number of characters written to \p os)
80  */
81 std::pair<bool, int> switchEncoding(odocstream & os,
82                      BufferParams const & bparams,
83                      OutputParams const &, Encoding const & newEnc,
84                      bool force = false, bool noswitchmacro = false);
85
86 /// FIXME: this should not be visible.
87 void TeXOnePar(Buffer const & buf,
88                    Text const & text,
89                    pit_type pit,
90                    otexstream & os,
91                    OutputParams const & runparams,
92                    std::string const & everypar = std::string(),
93                    int start_pos = -1, int end_pos = -1,
94                    bool const force = false);
95
96 } // namespace lyx
97
98 #endif