X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLaTeXFeatures.h;h=0b4d6cd0ec60145878e52d1ff046032d3473d7fa;hb=b9963e1a57135c3e2ab128a9ec4300f0e4886992;hp=c179896daaa94f584d73a7e25d1aeb3c63230cdf;hpb=eb36b71ce3b9880a9b577f3db25d16e6a86cd338;p=lyx.git diff --git a/src/LaTeXFeatures.h b/src/LaTeXFeatures.h index c179896daa..0b4d6cd0ec 100644 --- a/src/LaTeXFeatures.h +++ b/src/LaTeXFeatures.h @@ -21,25 +21,25 @@ class Buffer; class BufferParams; -struct Language; +class Language; /** The packages and commands that a buffer needs. This class - contains a list. Each of the LaTeX packages that a buffer needs - should be added with void require(string const & name). - - i.e require("amssymb") - - To add support you should only need to require() the package name as - packages which don't have special requirements are handled automatically. - If your new package does need special consideration you'll need to alter - string const getPackages() const; - Remember to update the validate function in buffer.C and paragraph.C - when you do so. -*/ + * contains a list. Each of the LaTeX packages that a buffer needs + * should be added with void require(string const & name). + * + * i.e require("amssymb") + * + * To add support you should only need to require() the package name as + * packages which don't have special requirements are handled automatically. + * If your new package does need special consideration you'll need to alter + * string const getPackages() const; + * Remember to update the validate function in buffer.C and paragraph.C + * when you do so. + */ class LaTeXFeatures { public: /// - LaTeXFeatures(Buffer const &, BufferParams const &); + LaTeXFeatures(Buffer const &, BufferParams const &, bool); /// The packages needed by the document std::string const getPackages() const; /// The macros definitions needed by the document @@ -62,8 +62,12 @@ public: void addExternalPreamble(std::string const &); /// Provide a string name-space to the requirements void require(std::string const & name); + /// Which of the required packages are installed? + static void getAvailable(); /// Is the package required? bool isRequired(std::string const & name) const; + /// Is the (required) package available? + bool isAvailable(std::string const & name) const; /// void useFloat(std::string const & name); /// @@ -79,9 +83,13 @@ public: /// Buffer const & buffer() const; /// + void setBuffer(Buffer const &); + /// BufferParams const & bufferParams() const; /// the return value is dependent upon both LyXRC and LaTeXFeatures. bool useBabel() const; + /// + bool nice() const { return nice_; }; private: std::list usedLayouts_; @@ -92,6 +100,10 @@ private: FeaturesList features_; /// FeaturesList preamble_snippets_; + /// The available (required) packages + typedef std::list PackagesList; + /// + static PackagesList packages_; /// typedef std::set LanguageList; /// @@ -104,10 +116,18 @@ private: typedef std::map FileMap; /// FileMap IncludedFiles_; - /// - Buffer const & buffer_; + /** Buffer of the file being processed. + * This may be a child buffer of the to-be-exported file and + * therefore may not be the buffer that belongs to params_. + * Only needed by InsetInclude::validate(). + */ + Buffer const * buffer_; /// BufferParams const & params_; + /** If we are writing a nice LaTeX file or not. + * Only needed by InsetInclude::validate(). + */ + bool nice_; }; #endif