X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fcontrollers%2Fbiblio.h;h=d1021ded09ed0e4272e0cf61f2f5dfb1237a95a6;hb=a61a18e2a0d7b91dd364b2d7c4a91800a4c1cec9;hp=8ce0b9f35984927e7a8199aea199d328be298e73;hpb=0c2a3e5960f032dcd8be726e3e63628207a06dd3;p=lyx.git diff --git a/src/frontends/controllers/biblio.h b/src/frontends/controllers/biblio.h index 8ce0b9f359..d1021ded09 100644 --- a/src/frontends/controllers/biblio.h +++ b/src/frontends/controllers/biblio.h @@ -24,6 +24,17 @@ /** Functions of use to citation and bibtex GUI controllers and views */ namespace biblio { + /// + enum CiteStyle { + CITE, + CITET, + CITEP, + CITEALT, + CITEALP, + CITEAUTHOR, + CITEYEAR, + CITEYEARPAR + }; /// enum Search { /// @@ -66,32 +77,74 @@ namespace biblio */ std::vector::const_iterator - searchKeys(InfoMap const & map, - std::vector const & keys_to_search, - string const & search_expression, - std::vector::const_iterator start, - Search, - Direction, - bool caseSensitive=false); - - /** Do the dirty work for the search. - Should use through the function above */ - std::vector::const_iterator - simpleSearch(InfoMap const & map, - std::vector const & keys_to_search, - string const & search_expression, - std::vector::const_iterator start, - Direction, - bool caseSensitive=false); - - /// Should use through the function above - std::vector::const_iterator - regexSearch(InfoMap const & map, - std::vector const & keys_to_search, - string const & search_expression, - std::vector::const_iterator start, - Direction); + searchKeys(InfoMap const & map, + std::vector const & keys_to_search, + string const & search_expression, + std::vector::const_iterator start, + Search, + Direction, + bool caseSensitive=false); + + /// Type returned by getCitationStyle, below + struct CitationStyle { + /// + CitationStyle() : style(CITE), full(false), forceUCase(false) {} + /// + CiteStyle style; + /// + bool full; + /// + bool forceUCase; + }; + /// Given the LaTeX command, return the appropriate CitationStyle + CitationStyle const getCitationStyle(string const & command); + + /** Returns the LaTeX citation command + + User supplies : + The CiteStyle enum, + a flag forcing the full author list, + a flag forcing upper case, e.g. "della Casa" becomes "Della Case" + */ + string const getCiteCommand(CiteStyle, bool full, bool forceUCase); + + /// Returns a vector of available Citation styles. + std::vector const getCiteStyles(bool usingNatbib); + + /** + "Translates" the available Citation Styles into strings for this key. + The returned string is displayed by the GUI. + + + [XX] is used in place of the actual reference + Eg, the vector will contain: [XX], Jones et al. [XX], ... + + User supplies : + the key, + the InfoMap of bibkeys info, + the available citation styles + */ + std::vector const + getNumericalStrings(string const & key, + InfoMap const & map, + std::vector const & styles); + /** + "Translates" the available Citation Styles into strings for this key. + The returned string is displayed by the GUI. + + Eg, the vector will contain: + Jones et al. (1990), (Jones et al. 1990), Jones et al. 1990, ... + + User supplies : + the key, + the InfoMap of bibkeys info, + the available citation styles + */ + std::vector const + getAuthorYearStrings(string const & key, + InfoMap const & map, + std::vector const & styles); } // namespace biblio #endif // BIBLIOHELPERS_H