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
16 #include "BiblioInfo.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<docstring> const availableKeys() const;
41 /// \return the list of all used BibTeX fields
42 std::vector<docstring> const availableFields() const;
43 /// \return the list of all used BibTeX entry types
44 std::vector<docstring> const availableEntries() const;
46 void filterByEntryType(
47 std::vector<docstring> & keyVector, docstring entryType);
49 biblio::CiteEngine const getEngine() const;
51 /// \return information for this key.
52 docstring const getInfo(docstring const & key) const;
54 /// Search a given string within the passed keys.
55 /// \return the vector of matched keys.
56 std::vector<docstring> searchKeys(
57 std::vector<docstring> const & keys_to_search, //< Keys to search.
58 bool only_keys, //< whether to search only the keys
59 docstring const & search_expression, //< Search expression (regex possible)
60 docstring field, //< field to search, empty for all fields
61 bool case_sensitive = false, //< set to true is the search should be case sensitive
62 bool regex = false //< \set to true if \c search_expression is a regex
65 /// \return possible citations based on this key.
66 std::vector<docstring> const getCiteStrings(docstring const & key) const;
68 /// available CiteStyle-s (depends on availability of Natbib/Jurabib)
69 static std::vector<biblio::CiteStyle> const & getCiteStyles() {
73 /// The BibTeX information available to the dialog
74 BiblioInfo bibkeysInfo_;
77 static std::vector<biblio::CiteStyle> citeStyles_;
80 } // namespace frontend
83 #endif // CONTROLCITATION_H