]> git.lyx.org Git - features.git/blobdiff - src/CiteEnginesList.h
Rework default bibliography style UI
[features.git] / src / CiteEnginesList.h
index 0e6d119128be2744da6641d858e1a3124226251c..f1fc04b442b9edf0f739a17981b906b1934ddaeb 100644 (file)
@@ -13,6 +13,8 @@
 #ifndef CITEENGINESLIST_H
 #define CITEENGINESLIST_H
 
+#include "Citation.h"
+
 #include <string>
 #include <vector>
 
@@ -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,6 +51,7 @@ public:
        ///
        LyXCiteEngine(std::string const & name, std::string const & id,
                      std::vector<std::string> const & enginetypes,
+                     std::vector<std::string> const & defaultbiblios,
                      std::string const & description,
                      std::vector<std::string> const & packagelist,
                      std::vector<std::string> const & requires,
@@ -66,6 +69,12 @@ public:
        ///
        std::vector<std::string> 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<std::string> const & getPackageList() const
@@ -93,6 +102,8 @@ private:
        std::string filename_;
        /// the engine type(s)
        std::vector<std::string> engine_types_;
+       /// default bibliography styles
+       std::vector<std::string> default_biblios_;
        /// a short description for use in the ui
        std::string description_;
        /// the LaTeX packages on which this depends, if any
@@ -121,6 +132,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,7 +160,8 @@ public:
        void operator=(CiteEnginesList const &);
        /// add an engine to the list
        void addCiteEngine(std::string const &, std::string const &,
-               std::vector<std::string> const &, std::string const &, std::vector<std::string> const &,
+               std::vector<std::string> const &, std::vector<std::string> const &,
+               std::string const &, std::vector<std::string> const &,
                std::vector<std::string> const &, std::vector<std::string> const &);
        ///
        std::vector<LyXCiteEngine> englist_;