X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCiteEnginesList.h;h=24bec03852015130ec8cb5cf2620dc097cd028e6;hb=194a45270cc4062897aca2857af72c1be24a4558;hp=0e6d119128be2744da6641d858e1a3124226251c;hpb=97aea7e5b1707d662d6d7146d53adc97045c44c9;p=lyx.git diff --git a/src/CiteEnginesList.h b/src/CiteEnginesList.h index 0e6d119128..24bec03852 100644 --- a/src/CiteEnginesList.h +++ b/src/CiteEnginesList.h @@ -13,6 +13,8 @@ #ifndef CITEENGINESLIST_H #define CITEENGINESLIST_H +#include "Citation.h" + #include #include @@ -29,13 +31,13 @@ namespace lyx { * which must begin roughly so: * # \DeclareLyXCiteEngine[natbib.sty]{Natbib} * # DescriptionBegin - * # Loads the LaTeX package natbib, a citation engine. Natbib supports - * # both author-year and numerical styles for citations, automatic sorting - * # and merging of numerical citations, annotations, capitalization of the - * # `van' part of author names, shortened and full author lists, and more. + * # Natbib supports a range of both author-year and numerical styles mainly + * # aimed at the Humanities. It features automatic sorting and merging of + * # numerical citations, annotations, capitalization of the `van' part of + * # author names, shortened and full author lists, and more. * # DescriptionEnd * # Excludes: basic | jurabib - * The description might be used in the gui to give information to the user. The + * The description will be used in the gui to give information to the user. The * Requires and Excludes lines are read by the configuration script * and written to a file citeengines.lst in the user configuration directory. * That file is then read on startup to populate the CiteEnginesList, below. @@ -49,10 +51,10 @@ public: /// LyXCiteEngine(std::string const & name, std::string const & id, std::vector const & enginetypes, + std::string const & cfm, + std::vector const & defaultbiblios, std::string const & description, - std::vector const & packagelist, - std::vector const & requires, - std::vector const & excludes); + std::vector const & packagelist); /// whether the required packages are available bool isAvailable() const; /// the missing prerequisites, if any @@ -64,25 +66,22 @@ public: /// std::string const & getFilename() const { return filename_; } /// + std::string const & getCiteFramework() const { return cite_framework_; } + /// std::vector const & getEngineType() const { return engine_types_; } /// + bool hasEngineType(CiteEngineType const &) const; + /// + std::string getDefaultBiblio(CiteEngineType const &) const; + /// + bool isDefaultBiblio(std::string const &) const; + /// std::string const & getDescription() const { return description_; } /// std::vector const & getPackageList() const { return package_list_; } /// - std::vector const & getRequiredEngines() const - { return required_engines_; } - /// Engines this one excludes: the list should be treated disjunctively - std::vector const & getExcludedEngines() const - { return excluded_engines_; } - /// \return true if the engine is compatible with this one, i.e., - /// it does not exclude us and we do not exclude it. - /// this will also return true if cename is unknown and we do not - /// exclude it, since in that case we cannot check its exclusions. - bool isCompatible(std::string const & cename) const; - /// - static bool areCompatible(std::string const & eng1, std::string const & eng2); + bool requires(std::string const p) const; private: /// what appears in the ui std::string name_; @@ -93,14 +92,14 @@ private: std::string filename_; /// the engine type(s) std::vector engine_types_; + /// cite framework (bibtex, biblatex) + std::string cite_framework_; + /// default bibliography styles + std::vector default_biblios_; /// a short description for use in the ui std::string description_; /// the LaTeX packages on which this depends, if any std::vector package_list_; - /// Engines this one requires: at least one - std::vector required_engines_; - /// Engines this one excludes: none of these - std::vector excluded_engines_; // these are mutable because they are used to cache the results // or an otherwise const operation. /// @@ -121,6 +120,10 @@ class CiteEnginesList { public: /// CiteEnginesList() {} + /// + std::string getTypeAsString(CiteEngineType const &) const; + /// + CiteEngineType getType(std::string const &) const; /// reads the engines from a file generated by configure.py bool read(); /// @@ -145,12 +148,13 @@ public: void operator=(CiteEnginesList const &); /// add an engine to the list void addCiteEngine(std::string const &, std::string const &, - std::vector const &, std::string const &, std::vector const &, - std::vector const &, std::vector const &); + std::vector const &, std::string const &, + std::vector const &, std::string const &, + std::vector const &); /// std::vector englist_; }; extern CiteEnginesList theCiteEnginesList; -} +} // namespace lyx #endif