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 } // namespace support
25 /** Used to insert BibTeX's information
27 class InsetBibtex : public InsetCommand {
30 InsetBibtex(Buffer *, InsetCommandParams const &);
33 docstring_list getBibFiles() const;
35 bool addDatabase(docstring const &);
37 bool delDatabase(docstring const &);
39 void write(std::ostream &) const override;
41 /// \name Public functions inherited from Inset class
44 docstring toolTip(BufferView const & bv, int x, int y) const override;
46 bool hasSettings() const override { return true; }
48 InsetCode lyxCode() const override { return BIBTEX_CODE; }
50 RowFlags rowFlags() const override { return Display; }
52 void latex(otexstream &, OutputParams const &) const override;
54 int plaintext(odocstringstream & ods, OutputParams const & op,
55 size_t max_length = INT_MAX) const override;
57 void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false) override;
59 void addToToc(DocIterator const & di, bool output_active,
60 UpdateType utype, TocBackend & backend) const override;
62 void collectBibKeys(InsetIterator const &, support::FileNameList &) const override;
64 void validate(LaTeXFeatures &) const override;
66 docstring xhtml(XMLStream &, OutputParams const &) const override;
68 void docbook(XMLStream &, OutputParams const &) const override;
70 std::string contextMenuName() const override;
73 /// \name Static public methods obligated for InsetCommand derived classes
76 static ParamInfo const & findInfo(std::string const &);
78 static std::string defaultCommand() { return "bibtex"; }
80 static bool isCompatibleCommand(std::string const & s)
81 { return s == "bibtex"; }
86 void editDatabases(docstring const & db = docstring()) const;
88 void parseBibTeXFiles(support::FileNameList &) const;
90 bool usingBiblatex() const;
92 docstring getRefLabel() const;
94 std::map<std::string, std::string> getFileEncodings() const;
96 /// \name Private functions inherited from Inset class
99 bool getStatus(Cursor & cur, FuncRequest const & cmd,
100 FuncStatus & flag) const override;
102 void doDispatch(Cursor & cur, FuncRequest & cmd) override;
104 Inset * clone() const override { return new InsetBibtex(*this); }
107 /// \name Private functions inherited from InsetCommand class
110 docstring screenLabel() const override;
117 #endif // INSET_BIBTEX_H