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"
32 /** The packages and commands that a buffer needs. This class
33 contains a list<string>. Each of the LaTeX packages that a buffer needs
34 should be added with void require(string const & name).
36 i.e require("amssymb")
38 To add support you should only need to require() the package name as
39 packages which don't have special requirements are handled automatically.
40 If your new package does need special consideration you'll need to alter
41 string const getPackages() const;
42 Remember to update the validate function in buffer.C and paragraph.C
48 LaTeXFeatures(BufferParams const &);
49 /// The packages needed by the document
50 string const getPackages() const;
51 /// The macros definitions needed by the document
52 string const getMacros() const;
53 /// The definitions needed by the document's textclass
54 string const getTClassPreamble() const;
55 /// The sgml definitions needed by the document (dobook/linuxdoc)
56 string const getLyXSGMLEntities() const;
57 /// The SGML Required to include the files added with includeFile();
58 string const getIncludedFiles(string const & fname) const;
59 /// Include a file for use with the SGML entities
60 void includeFile(string const & key, string const & name);
61 /// The float definitions.
62 void getFloatDefinitions(std::ostream & os) const;
63 /// Print requirements to lyxerr
64 void showStruct() const;
66 void addExternalPreamble(string const &);
67 /// Provide a string name-space to the requirements
68 void require(string const & name);
69 /// Is the package required?
70 bool isRequired(string const & name) const;
72 void useFloat(string const & name);
74 void useLanguage(Language const *);
78 string getLanguages() const;
80 std::set<string> getEncodingSet(string const & doc_encoding);
82 void useLayout(string const & lyt);
84 BufferParams const & bufferParams() const;
88 string externalPreambles;
90 std::set<string> layout;
92 /// Static preamble bits from the external material insets
95 typedef std::list<string> FeaturesList;
97 FeaturesList features;
99 typedef std::set<Language const *> LanguageList;
101 LanguageList UsedLanguages;
103 typedef std::set<string> UsedFloats;
105 UsedFloats usedFloats;
107 typedef std::map<string , string> FileMap;
109 FileMap IncludedFiles;
112 BufferParams const & params;