]> git.lyx.org Git - lyx.git/blob - src/output_latex.h
Avoid full metrics computation with Update:FitCursor
[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 "Layout.h"
18 #include "ParagraphList.h"
19
20
21 namespace lyx {
22
23 class Buffer;
24 class BufferParams;
25 class Encoding;
26 class Paragraph;
27 class OutputParams;
28 class Text;
29
30 /** Register a language switch when using polyglossia or begin/end commands.
31     Set \p localswitch to true if a local command switch is used.
32  */
33 void pushLanguageName(std::string const & lang, bool localswitch = false);
34
35 /** Unregister the last language switch when using polyglossia
36     or begin/end commands.
37  */
38 void popLanguageName();
39
40 // Check if we have an empty language stack
41 bool languageStackEmpty();
42
43 /** Return a reference to the last active language opened with
44     polyglossia or when using begin/end commands. If none or when
45     using babel with only a begin command, return a reference to
46     an empty string.
47  */
48 std::string const & openLanguageName();
49
50 /** Export optional and required arguments of the paragraph \p par.
51     Non-existing required arguments are output empty: {}.
52  */
53 void latexArgInsets(Paragraph const & par,
54                     otexstream & os, OutputParams const & runparams,
55                     Layout::LaTeXArgMap const & latexargs,
56                     std::string const & prefix = std::string());
57 /// Same for merged environments
58 void latexArgInsets(ParagraphList const & pars,
59                     ParagraphList::const_iterator pit,
60                     otexstream & os, OutputParams const & runparams,
61                     Layout::LaTeXArgMap const & latexargs,
62                     std::string const & prefix = std::string());
63 /// Same for InsetLayouts
64 void latexArgInsetsForParent(ParagraphList const & pars, otexstream & os,
65                              OutputParams const & runparams,
66                              Layout::LaTeXArgMap const & latexargs,
67                              std::string const & prefix = std::string());
68 /** Export \p paragraphs of buffer \p buf to LaTeX.
69     Don't use a temporary stringstream for \p os if the final output is
70     supposed to go to a file.
71     \sa Buffer::writeLaTeXSource for the reason.
72  */
73 void latexParagraphs(Buffer const & buf,
74                      Text const & text,
75                      otexstream & ofs,
76                      OutputParams const &,
77                      std::string const & everypar = std::string());
78
79 /** Switch the encoding of \p os from runparams.encoding to \p newEnc if needed.
80     \p force forces this also within non-default or -auto encodings.
81     \return (did the encoding change?, number of characters written to \p os)
82  */
83 std::pair<bool, int> switchEncoding(odocstream & os,
84                      BufferParams const & bparams,
85                      OutputParams const &, Encoding const & newEnc,
86                      bool force = false, bool noswitchmacro = false);
87
88 /// FIXME: this should not be visible.
89 void TeXOnePar(Buffer const & buf,
90                    Text const & text,
91                    pit_type pit,
92                    otexstream & os,
93                    OutputParams const & runparams,
94                    std::string const & everypar = std::string(),
95                    int start_pos = -1, int end_pos = -1,
96                    bool const force = false);
97
98 } // namespace lyx
99
100 #endif