]> git.lyx.org Git - lyx.git/blob - src/LaTeXFeatures.h
Point fix, earlier forgotten
[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 #include "support/types.h"
17
18 #include "LString.h"
19
20 #include <set>
21 #include <list>
22 #include <map>
23
24 class BufferParams;
25 struct Language;
26
27 /** The packages and commands that a buffer needs. This class
28     contains a list<string>.  Each of the LaTeX packages that a buffer needs
29     should be added with void require(string const & name).
30
31     i.e require("amssymb")
32
33     To add support you should only need to require() the package name as
34     packages which don't have special requirements are handled automatically.
35     If your new package does need special consideration you'll need to alter
36     string const getPackages() const;
37     Remember to update the validate function in buffer.C and paragraph.C
38     when you do so.
39 */
40 class LaTeXFeatures {
41 public:
42         ///
43         LaTeXFeatures(BufferParams const &);
44         /// The packages needed by the document
45         string const getPackages() const;
46         /// The macros definitions needed by the document
47         string const getMacros() const;
48         ///
49         string const getBabelOptions() const;
50         /// The definitions needed by the document's textclass
51         string const getTClassPreamble() const;
52         /// The sgml definitions needed by the document (dobook/linuxdoc)
53         string const getLyXSGMLEntities() const;
54         /// The SGML Required to include the files added with includeFile();
55         string const getIncludedFiles(string const & fname) const;
56         /// Include a file for use with the SGML entities
57         void includeFile(string const & key, string const & name);
58         /// The float definitions.
59         void getFloatDefinitions(std::ostream & os) const;
60         /// Print requirements to lyxerr
61         void showStruct() const;
62         ///
63         void addExternalPreamble(string const &);
64         /// Provide a string name-space to the requirements
65         void require(string const & name);
66         /// Is the package required?
67         bool isRequired(string const & name) const;
68         ///
69         void useFloat(string const & name);
70         ///
71         void useLanguage(Language const *);
72         ///
73         bool hasLanguages() const;
74         ///
75         string getLanguages() const;
76         ///
77         std::set<string> getEncodingSet(string const & doc_encoding) const;
78         ///
79         void useLayout(string const & lyt);
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         string externalPreambles;
87
88         std::list<string> usedLayouts;
89
90         /// Static preamble bits from the external material insets
91
92
93         typedef std::list<string> FeaturesList;
94         ///
95         FeaturesList features;
96         ///
97         typedef std::set<Language const *> LanguageList;
98         ///
99         LanguageList UsedLanguages;
100         ///
101         typedef std::set<string> UsedFloats;
102         ///
103         UsedFloats usedFloats;
104         ///
105         typedef std::map<string , string> FileMap;
106         ///
107         FileMap IncludedFiles;
108         ///
109         ///
110         BufferParams const & params;
111 };
112
113 #endif