2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2001 the LyX Team.
10 * ====================================================== */
12 #ifndef LATEXFEATURES_H
13 #define LATEXFEATURES_H
15 #include "support/types.h"
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).
30 i.e require("amssymb")
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
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;
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;
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;
68 void useFloat(string const & name);
70 void useLanguage(Language const *);
72 bool hasLanguages() const;
74 string getLanguages() const;
76 std::set<string> getEncodingSet(string const & doc_encoding) const;
78 void useLayout(string const & lyt);
80 BufferParams const & bufferParams() const;
84 string externalPreambles;
86 std::list<string> usedLayouts;
88 /// Static preamble bits from the external material insets
91 typedef std::list<string> FeaturesList;
93 FeaturesList features;
95 typedef std::set<Language const *> LanguageList;
97 LanguageList UsedLanguages;
99 typedef std::set<string> UsedFloats;
101 UsedFloats usedFloats;
103 typedef std::map<string , string> FileMap;
105 FileMap IncludedFiles;
108 BufferParams const & params;