]> git.lyx.org Git - lyx.git/blob - src/LaTeXFeatures.h
Qt compilation fixes.
[lyx.git] / src / LaTeXFeatures.h
1 // -*- C++ -*-
2 /**
3  * \file LaTeXFeatures.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  * \author Jean-Marc Lasgouttes
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef LATEXFEATURES_H
14 #define LATEXFEATURES_H
15
16
17 #include <set>
18 #include <list>
19 #include <map>
20
21 class Buffer;
22 class BufferParams;
23 struct Language;
24
25 /** The packages and commands that a buffer needs. This class
26     contains a list<string>.  Each of the LaTeX packages that a buffer needs
27     should be added with void require(string const & name).
28
29     i.e require("amssymb")
30
31     To add support you should only need to require() the package name as
32     packages which don't have special requirements are handled automatically.
33     If your new package does need special consideration you'll need to alter
34     string const getPackages() const;
35     Remember to update the validate function in buffer.C and paragraph.C
36     when you do so.
37 */
38 class LaTeXFeatures {
39 public:
40         ///
41         LaTeXFeatures(Buffer const &, BufferParams const &);
42         /// The packages needed by the document
43         std::string const getPackages() const;
44         /// The macros definitions needed by the document
45         std::string const getMacros() const;
46         ///
47         std::string const getBabelOptions() const;
48         /// The definitions needed by the document's textclass
49         std::string const getTClassPreamble() const;
50         /// The sgml definitions needed by the document (dobook/linuxdoc)
51         std::string const getLyXSGMLEntities() const;
52         /// The SGML Required to include the files added with includeFile();
53         std::string const getIncludedFiles(std::string const & fname) const;
54         /// Include a file for use with the SGML entities
55         void includeFile(std::string const & key, std::string const & name);
56         /// The float definitions.
57         void getFloatDefinitions(std::ostream & os) const;
58         /// Print requirements to lyxerr
59         void showStruct() const;
60         ///
61         void addExternalPreamble(std::string const &);
62         /// Provide a string name-space to the requirements
63         void require(std::string const & name);
64         /// Is the package required?
65         bool isRequired(std::string const & name) const;
66         ///
67         void useFloat(std::string const & name);
68         ///
69         void useLanguage(Language const *);
70         ///
71         bool hasLanguages() const;
72         ///
73         std::string getLanguages() const;
74         ///
75         std::set<std::string> getEncodingSet(std::string const & doc_encoding) const;
76         ///
77         void useLayout(std::string const & lyt);
78         ///
79         Buffer const & buffer() const;
80         ///
81         BufferParams const & bufferParams() const;
82         /// the return value is dependent upon both LyXRC and LaTeXFeatures.
83         bool useBabel() const;
84
85 private:
86         std::list<std::string> usedLayouts_;
87
88         /// Static preamble bits from the external material insets
89         typedef std::list<std::string> FeaturesList;
90         ///
91         FeaturesList features_;
92         ///
93         FeaturesList preamble_snippets_;
94         ///
95         typedef std::set<Language const *> LanguageList;
96         ///
97         LanguageList UsedLanguages_;
98         ///
99         typedef std::set<std::string> UsedFloats;
100         ///
101         UsedFloats usedFloats_;
102         ///
103         typedef std::map<std::string , std::string> FileMap;
104         ///
105         FileMap IncludedFiles_;
106         ///
107         Buffer const & buffer_;
108         ///
109         BufferParams const & params_;
110 };
111
112 #endif