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 bool inheritFont() const { return true; }
53 InsetCode lyxCode() const { return BIBTEX_CODE; }
55 DisplayType display() const { return AlignCenter; }
57 void latex(otexstream &, OutputParams const &) const;
59 int plaintext(odocstringstream & ods, OutputParams const & op,
60 size_t max_length = INT_MAX) const;
62 void collectBibKeys(InsetIterator const &) const;
64 void validate(LaTeXFeatures &) const;
66 docstring xhtml(XHTMLStream &, OutputParams const &) const;
68 std::string contextMenuName() const;
71 /// \name Static public methods obligated for InsetCommand derived classes
74 static ParamInfo const & findInfo(std::string const &);
76 static std::string defaultCommand() { return "bibtex"; }
78 static bool isCompatibleCommand(std::string const & s)
79 { return s == "bibtex"; }
83 /// look up the path to the file using TeX
84 static support::FileName
85 getBibTeXPath(docstring const & filename, Buffer const & buf);
87 void editDatabases() const;
89 void parseBibTeXFiles() const;
91 bool usingBiblatex() const;
93 /// \name Private functions inherited from Inset class
96 bool getStatus(Cursor & cur, FuncRequest const & cmd,
97 FuncStatus & flag) const;
99 void doDispatch(Cursor & cur, FuncRequest & cmd);
101 Inset * clone() const { return new InsetBibtex(*this); }
104 /// \name Private functions inherited from InsetCommand class
107 docstring screenLabel() const;
114 #endif // INSET_BIBTEX_H