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 "BiblioInfo.h"
16 #include "EmbeddedFiles.h"
17 #include "InsetCommand.h"
24 /** Used to insert BibTeX's information
26 class InsetBibtex : public InsetCommand {
29 InsetBibtex(InsetCommandParams const &);
31 virtual void setBuffer(Buffer & buffer);
33 docstring screenLabel() const;
35 EDITABLE editable() const { return IS_EDITABLE; }
37 InsetCode lyxCode() const { return BIBTEX_CODE; }
39 DisplayType display() const { return AlignCenter; }
41 int latex(odocstream &, OutputParams const &) const;
43 void fillWithBibKeys(BiblioInfo &, InsetIterator const &) const;
45 EmbeddedFileList const & getBibFiles() const;
47 bool addDatabase(docstring const &);
49 bool delDatabase(docstring const &);
51 void validate(LaTeXFeatures &) const;
53 static ParamInfo const & findInfo(std::string const &);
55 static std::string defaultCommand() { return "bibtex"; };
57 static bool isCompatibleCommand(std::string const & s)
58 { return s == "bibtex"; }
59 /// update bibfiles and embed from bibfiles_
61 /// look up the path to the file using TeX
62 static support::FileName
63 getBibTeXPath(docstring const & filename, Buffer const & buf);
66 void updateBibFiles() const;
68 void registerEmbeddedFiles(EmbeddedFileList &) const;
70 void updateEmbeddedFile(EmbeddedFile const & file);
72 void doDispatch(Cursor & cur, FuncRequest & cmd);
74 Inset * clone() const { return new InsetBibtex(*this); }
75 /// embedded bib files
76 mutable EmbeddedFileList bibfiles_;
82 #endif // INSET_BIBTEX_H