3 * \file LaTeXFeatures.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Jean-Marc Lasgouttes
10 * Full author contact details are available in file CREDITS.
13 #ifndef LATEXFEATURES_H
14 #define LATEXFEATURES_H
25 /** The packages and commands that a buffer needs. This class
26 contains a list<string>. Each of the LaTeX packages that a buffer needs
27 should be added with void require(string const & name).
29 i.e require("amssymb")
31 To add support you should only need to require() the package name as
32 packages which don't have special requirements are handled automatically.
33 If your new package does need special consideration you'll need to alter
34 string const getPackages() const;
35 Remember to update the validate function in buffer.C and paragraph.C
41 LaTeXFeatures(Buffer const &, BufferParams const &);
42 /// The packages needed by the document
43 std::string const getPackages() const;
44 /// The macros definitions needed by the document
45 std::string const getMacros() const;
47 std::string const getBabelOptions() const;
48 /// The definitions needed by the document's textclass
49 std::string const getTClassPreamble() const;
50 /// The sgml definitions needed by the document (dobook/linuxdoc)
51 std::string const getLyXSGMLEntities() const;
52 /// The SGML Required to include the files added with includeFile();
53 std::string const getIncludedFiles(std::string const & fname) const;
54 /// Include a file for use with the SGML entities
55 void includeFile(std::string const & key, std::string const & name);
56 /// The float definitions.
57 void getFloatDefinitions(std::ostream & os) const;
58 /// Print requirements to lyxerr
59 void showStruct() const;
61 void addExternalPreamble(std::string const &);
62 /// Provide a string name-space to the requirements
63 void require(std::string const & name);
64 /// Is the package required?
65 bool isRequired(std::string const & name) const;
67 void useFloat(std::string const & name);
69 void useLanguage(Language const *);
71 bool hasLanguages() const;
73 std::string getLanguages() const;
75 std::set<std::string> getEncodingSet(std::string const & doc_encoding) const;
77 void useLayout(std::string const & lyt);
79 Buffer const & buffer() const;
81 BufferParams const & bufferParams() const;
82 /// the return value is dependent upon both LyXRC and LaTeXFeatures.
83 bool useBabel() const;
86 std::list<std::string> usedLayouts_;
88 /// Static preamble bits from the external material insets
89 typedef std::list<std::string> FeaturesList;
91 FeaturesList features_;
93 FeaturesList preamble_snippets_;
95 typedef std::set<Language const *> LanguageList;
97 LanguageList UsedLanguages_;
99 typedef std::set<std::string> UsedFloats;
101 UsedFloats usedFloats_;
103 typedef std::map<std::string , std::string> FileMap;
105 FileMap IncludedFiles_;
107 Buffer const & buffer_;
109 BufferParams const & params_;