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