3 * \file ControlCitation.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
8 * \author Abdelrazak Younes
10 * Full author contact details are available in file CREDITS.
13 #ifndef CONTROLCITATION_H
14 #define CONTROLCITATION_H
17 #include "ControlCommand.h"
22 /** A controller for Citation dialogs.
24 class ControlCitation : public ControlCommand {
27 ControlCitation(Dialog &);
28 virtual ~ControlCitation() {}
29 virtual bool initialiseParams(std::string const & data);
32 virtual void clearParams();
34 /** Disconnect from the inset when the Apply button is pressed.
35 * Allows easy insertion of multiple citations.
37 virtual bool disconnectOnApply() const { return true; }
39 /// \return the list of all available bibliography keys.
40 std::vector<std::string> const availableKeys() const;
42 biblio::CiteEngine const getEngine() const;
44 /// \return information for this key.
45 docstring const getInfo(std::string const & key) const;
47 /// Search a given string within the passed keys.
48 /// \return the vector of matched keys.
49 std::vector<std::string> searchKeys(
50 std::vector<std::string> const & keys_to_search, //< Keys to search.
51 docstring const & search_expression, //< Search expression (regex possible)
52 bool case_sensitive = false, // set to true is the search should be case sensitive
53 bool regex = false /// \set to true if \c search_expression is a regex
56 /// \return possible citations based on this key.
57 std::vector<docstring> const getCiteStrings(std::string const & key) const;
59 /// available CiteStyle-s (depends on availability of Natbib/Jurabib)
60 static std::vector<biblio::CiteStyle> const & getCiteStyles() {
64 /// The info associated with each key
65 biblio::InfoMap bibkeysInfo_;
68 static std::vector<biblio::CiteStyle> citeStyles_;
71 } // namespace frontend
74 #endif // CONTROLCITATION_H