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
16 #include "InsetCommand.h"
17 #include "BiblioInfo.h"
18 #include "EmbeddedFiles.h"
23 /** Used to insert BibTeX's information
25 class InsetBibtex : public InsetCommand {
28 InsetBibtex(InsetCommandParams const &);
30 void setBuffer(Buffer & buffer);
32 docstring screenLabel() const;
34 EDITABLE editable() const { return IS_EDITABLE; }
36 InsetCode lyxCode() const { return BIBTEX_CODE; }
38 DisplayType display() const { return AlignCenter; }
40 int latex(odocstream &, OutputParams const &) const;
42 void fillWithBibKeys(BiblioInfo &, InsetIterator const &) const;
44 EmbeddedFileList embeddedFiles() const;
46 bool addDatabase(std::string const &);
48 bool delDatabase(std::string const &);
50 void validate(LaTeXFeatures &) const;
52 static ParamInfo const & findInfo(std::string const &);
54 static std::string defaultCommand() { return "bibtex"; };
56 static bool isCompatibleCommand(std::string const & s)
57 { return s == "bibtex"; }
58 /// create bibfiles_ from params bibfiles and embed
60 \param bibfiles comma separated bib files
61 \param embed comma separated embed status
63 void createBibFiles(docstring const & bibfiles, docstring const & embed) const;
64 /// update bibfiles and embed from bibfiles_
68 void registerEmbeddedFiles(EmbeddedFileList &) const;
70 void updateEmbeddedFile(EmbeddedFile const & file);
71 /// embedded bib files
72 mutable EmbeddedFileList bibfiles_;
74 void doDispatch(Cursor & cur, FuncRequest & cmd);
76 Inset * clone() const { return new InsetBibtex(*this); }
82 #endif // INSET_BIBTEX_H