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