4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
10 * Full author contact details are available in file CREDITS.
16 #include "Biblio_typedefs.h"
27 ENGINE_NATBIB_AUTHORYEAR,
28 ENGINE_NATBIB_NUMERICAL,
57 /** Fills keys with BibTeX information derived from the various
58 * in this document or its master document.
60 void fillWithBibKeys(Buffer const * const buf, BibKeyList & keys);
62 /** Each citation engine recognizes only a subset of all possible
63 * citation commands. Given a latex command \c input, this function
64 * returns an appropriate command, valid for \c engine.
66 std::string const asValidLatexCommand(std::string const & input,
67 CiteEngine const engine);
69 /// Returns a vector of bibliography keys
70 std::vector<std::string> const getKeys(BibKeyList const &);
72 /** Returns the BibTeX data associated with a given key.
73 Empty if no info exists. */
74 docstring const getInfo(BibKeyList const &, std::string const & key);
76 /// return the year from the bibtex data record
77 docstring const getYear(BibKeyList const & map, std::string const & key);
79 /// return the short form of an authorlist
80 docstring const getAbbreviatedAuthor(BibKeyList const & map, std::string const & key);
82 /// return only the family name
83 docstring const familyName(docstring const & name);
85 /** Search a BibTeX info field for the given key and return the
87 docstring const getValueForKey(BibTeXInfo const & data, std::string const & findkey);
89 /** Returns an iterator to the first key that meets the search
90 criterion, or end() if unsuccessful.
93 the BibKeyList of bibliography info,
94 the vector of keys to be searched,
96 an iterator defining the starting point of the search,
97 an enum defining a Simple or Regex search,
98 an enum defining the search direction.
100 std::vector<std::string>::const_iterator
101 searchKeys(BibKeyList const & map,
102 std::vector<std::string> const & keys_to_search,
103 docstring const & search_expression,
104 std::vector<std::string>::const_iterator start,
105 Search, Direction, bool caseSensitive=false);
108 class CitationStyle {
111 CitationStyle(CiteStyle s = CITE, bool f = false, bool force = false)
112 : style(s), full(f), forceUCase(force) {}
113 /// \param latex_str a LaTeX command, "cite", "Citep*", etc
114 CitationStyle(std::string const & latex_str);
116 std::string const asLatexStr() const;
126 /// Returns a vector of available Citation styles.
127 std::vector<CiteStyle> const getCiteStyles(CiteEngine const );
130 "Translates" the available Citation Styles into strings for this key.
131 The returned string is displayed by the GUI.
134 [XX] is used in place of the actual reference
135 Eg, the vector will contain: [XX], Jones et al. [XX], ...
139 the BibKeyList of bibkeys info,
140 the available citation styles
142 std::vector<docstring> const
143 getNumericalStrings(std::string const & key,
144 BibKeyList const & map,
145 std::vector<CiteStyle> const & styles);
148 "Translates" the available Citation Styles into strings for this key.
149 The returned string is displayed by the GUI.
151 Eg, the vector will contain:
152 Jones et al. (1990), (Jones et al. 1990), Jones et al. 1990, ...
156 the BibKeyList of bibkeys info,
157 the available citation styles
159 std::vector<docstring> const
160 getAuthorYearStrings(std::string const & key,
161 BibKeyList const & map,
162 std::vector<CiteStyle> const & styles);
164 } // namespace biblio