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
20 #include "support/types.h"
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).
35 i.e require("amssymb")
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
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;
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;
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;
73 void useFloat(string const & name);
75 void useLanguage(Language const *);
79 string getLanguages() const;
81 std::set<string> getEncodingSet(string const & doc_encoding);
83 void useLayout(string const & lyt);
85 BufferParams const & bufferParams() const;
89 string externalPreambles;
91 std::list<string> usedLayouts;
93 /// Static preamble bits from the external material insets
96 typedef std::list<string> FeaturesList;
98 FeaturesList features;
100 typedef std::set<Language const *> LanguageList;
102 LanguageList UsedLanguages;
104 typedef std::set<string> UsedFloats;
106 UsedFloats usedFloats;
108 typedef std::map<string , string> FileMap;
110 FileMap IncludedFiles;
113 BufferParams const & params;