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"
18 #include "frontend_helpers.h"
23 /** A controller for Citation dialogs.
25 class ControlCitation : public ControlCommand {
28 ControlCitation(Dialog &);
29 virtual ~ControlCitation() {}
30 virtual bool initialiseParams(std::string const & data);
33 virtual void clearParams();
35 /** Disconnect from the inset when the Apply button is pressed.
36 * Allows easy insertion of multiple citations.
38 virtual bool disconnectOnApply() const { return true; }
40 /// \return the list of all available bibliography keys.
41 std::vector<std::string> const availableKeys() const;
43 biblio::CiteEngine const getEngine() const;
45 /// \return information for this key.
46 docstring const getInfo(std::string const & key) const;
48 /// Search a given string within the passed keys.
49 /// \return the vector of matched keys.
50 std::vector<std::string> searchKeys(
51 std::vector<std::string> const & keys_to_search, //< Keys to search.
52 docstring const & search_expression, //< Search expression (regex possible)
53 bool case_sensitive = false, // set to true is the search should be case sensitive
54 bool regex = false /// \set to true if \c search_expression is a regex
57 /// \return possible citations based on this key.
58 std::vector<docstring> const getCiteStrings(std::string const & key) const;
60 /// available CiteStyle-s (depends on availability of Natbib/Jurabib)
61 static std::vector<biblio::CiteStyle> const & getCiteStyles() {
65 /// The info associated with each key
66 biblio::InfoMap bibkeysInfo_;
69 static std::vector<biblio::CiteStyle> citeStyles_;
72 } // namespace frontend
75 #endif // CONTROLCITATION_H