4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Alejandro Aguilar Sierra
9 * Full author contact details are available in file CREDITS.
12 #ifndef INSET_BIBTEX_H
13 #define INSET_BIBTEX_H
15 #include "InsetCommand.h"
23 class FileNamePairList;
26 /** Used to insert BibTeX's information
28 class InsetBibtex : public InsetCommand {
31 InsetBibtex(Buffer *, InsetCommandParams const &);
36 support::FileNamePairList getBibFiles() const;
38 bool addDatabase(docstring const &);
40 bool delDatabase(docstring const &);
42 void write(std::ostream &) const;
44 /// \name Public functions inherited from Inset class
47 docstring toolTip(BufferView const & bv, int x, int y) const;
49 bool hasSettings() const { return true; }
51 InsetCode lyxCode() const { return BIBTEX_CODE; }
53 DisplayType display() const { return AlignCenter; }
55 void latex(otexstream &, OutputParams const &) const;
57 int plaintext(odocstringstream & ods, OutputParams const & op,
58 size_t max_length = INT_MAX) const;
60 void collectBibKeys(InsetIterator const &) const;
62 void validate(LaTeXFeatures &) const;
64 docstring xhtml(XHTMLStream &, OutputParams const &) const;
66 std::string contextMenuName() const;
69 /// \name Static public methods obligated for InsetCommand derived classes
72 static ParamInfo const & findInfo(std::string const &);
74 static std::string defaultCommand() { return "bibtex"; }
76 static bool isCompatibleCommand(std::string const & s)
77 { return s == "bibtex"; }
81 /// look up the path to the file using TeX
82 static support::FileName
83 getBibTeXPath(docstring const & filename, Buffer const & buf);
85 void editDatabases() const;
87 void parseBibTeXFiles() const;
89 bool usingBiblatex() const;
91 /// \name Private functions inherited from Inset class
94 bool getStatus(Cursor & cur, FuncRequest const & cmd,
95 FuncStatus & flag) const;
97 void doDispatch(Cursor & cur, FuncRequest & cmd);
99 Inset * clone() const { return new InsetBibtex(*this); }
102 /// \name Private functions inherited from InsetCommand class
105 docstring screenLabel() const;
112 #endif // INSET_BIBTEX_H