]> git.lyx.org Git - lyx.git/blob - src/output_latex.h
Translations for listings insets
[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 "Paragraph.h"
19 #include "ParIterator.h"
20 #include "ParagraphList.h"
21
22
23 namespace lyx {
24
25 class Buffer;
26 class BufferParams;
27 class Encoding;
28 class Layout;
29 class Paragraph;
30 class OutputParams;
31 class TexRow;
32 class Text;
33
34 /// Export up to \p reqargs required arguments and
35 /// \p optargs optional ones. If not enough required
36 /// ones are given, we'll output: {}. The optional ones
37 /// must all come first.
38 void latexArgInsets(Paragraph const & par,
39                 otexstream & os, OutputParams const & runparams,
40                 unsigned int reqargs, unsigned int optargs);
41
42 /** Export \p paragraphs of buffer \p buf to LaTeX.
43     Don't use a temporary stringstream for \p os if the final output is
44     supposed to go to a file.
45     \sa Buffer::writeLaTeXSource for the reason.
46  */
47 void latexParagraphs(Buffer const & buf,
48                      Text const & text,
49                      otexstream & ofs,
50                      OutputParams const &,
51                      std::string const & everypar = std::string());
52
53 /** Switch the encoding of \p os from runparams.encoding to \p newEnc if needed.
54     \p force forces this also within non-default or -auto encodings.
55     \return (did the encoding change?, number of characters written to \p os)
56  */
57 std::pair<bool, int> switchEncoding(odocstream & os,
58                      BufferParams const & bparams,
59                      OutputParams const &, Encoding const & newEnc,
60                      bool force = false);
61
62 /// FIXME: this should not be visible.
63 void TeXOnePar(Buffer const & buf,
64                    Text const & text,
65                    pit_type pit,
66                    otexstream & os,
67                    OutputParams const & runparams,
68                    std::string const & everypar = std::string(),
69                    int start_pos = -1, int end_pos = -1);
70
71 } // namespace lyx
72
73 #endif