X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fcontrollers%2Fbiblio.h;h=55882cff56cbf998853885fe5f15ed1454d206f5;hb=e4c3ce462791c85922d919f8859e3408f57d10fa;hp=602ad6b2fc8a63f5736323fa4a2c4a56034a309d;hpb=ea6a5fe92db34116130c64ca0ab72e40df80fe16;p=lyx.git diff --git a/src/frontends/controllers/biblio.h b/src/frontends/controllers/biblio.h index 602ad6b2fc..55882cff56 100644 --- a/src/frontends/controllers/biblio.h +++ b/src/frontends/controllers/biblio.h @@ -12,13 +12,15 @@ #ifndef BIBLIOHELPERS_H #define BIBLIOHELPERS_H +#include "support/docstring.h" + #include -#include #include class Buffer; /** Functions of use to citation and bibtex GUI controllers and views */ +namespace lyx { namespace biblio { class CiteEngine_enum; @@ -49,28 +51,36 @@ enum Direction { BACKWARD }; + +/** Each citation engine recognizes only a subset of all possible + * citation commands. Given a latex command \c input, this function + * returns an appropriate command, valid for \c engine. + */ +std::string const asValidLatexCommand(std::string const & input, + CiteEngine_enum const & engine); + /// First entry is the bibliography key, second the data -typedef std::map InfoMap; +typedef std::map InfoMap; /// Returns a vector of bibliography keys std::vector const getKeys(InfoMap const &); /** Returns the BibTeX data associated with a given key. Empty if no info exists. */ -std::string const getInfo(InfoMap const &, std::string const &); +docstring const getInfo(InfoMap const &, std::string const & key); -// rturn the year from the bibtex data record -std::string const getYear(InfoMap const & map, std::string const & key); +/// return the year from the bibtex data record +docstring const getYear(InfoMap const & map, std::string const & key); /// return the short form of an authorlist -std::string const getAbbreviatedAuthor(InfoMap const & map, std::string const & key); +docstring const getAbbreviatedAuthor(InfoMap const & map, std::string const & key); // return only the family name -std::string const familyName(std::string const & name); +docstring const familyName(docstring const & name); /** Search a BibTeX info field for the given key and return the associated field. */ -std::string const parseBibTeX(std::string data, std::string const & findkey); +docstring const parseBibTeX(docstring data, std::string const & findkey); /** Returns an iterator to the first key that meets the search criterion, or end() if unsuccessful. @@ -87,14 +97,15 @@ std::string const parseBibTeX(std::string data, std::string const & findkey); std::vector::const_iterator searchKeys(InfoMap const & map, std::vector const & keys_to_search, - std::string const & search_expression, + docstring const & search_expression, std::vector::const_iterator start, Search, Direction, bool caseSensitive=false); -struct CitationStyle { +class CitationStyle { +public: /// CitationStyle(CiteStyle s = CITE, bool f = false, bool force = false) : style(s), full(f), forceUCase(force) {} @@ -127,7 +138,7 @@ std::vector const getCiteStyles(CiteEngine_enum const &); the InfoMap of bibkeys info, the available citation styles */ -std::vector const +std::vector const getNumericalStrings(std::string const & key, InfoMap const & map, std::vector const & styles); @@ -144,10 +155,12 @@ getNumericalStrings(std::string const & key, the InfoMap of bibkeys info, the available citation styles */ -std::vector const +std::vector const getAuthorYearStrings(std::string const & key, InfoMap const & map, std::vector const & styles); + } // namespace biblio +} // namespace lyx #endif // BIBLIOHELPERS_H