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"
24 } // namespace support
26 /** Used to insert BibTeX's information
28 class InsetBibtex : public InsetCommand {
31 InsetBibtex(Buffer *, InsetCommandParams const &);
34 docstring_list getBibFiles() const;
36 bool addDatabase(docstring const &);
38 bool delDatabase(docstring const &);
40 void write(std::ostream &) const;
42 /// \name Public functions inherited from Inset class
45 docstring toolTip(BufferView const & bv, int x, int y) const;
47 bool hasSettings() const { return true; }
49 InsetCode lyxCode() const { return BIBTEX_CODE; }
51 RowFlags rowFlags() const { return Display; }
53 void latex(otexstream &, OutputParams const &) const;
55 int plaintext(odocstringstream & ods, OutputParams const & op,
56 size_t max_length = INT_MAX) const;
58 void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
60 void addToToc(DocIterator const & di, bool output_active,
61 UpdateType utype, TocBackend & backend) const;
63 void collectBibKeys(InsetIterator const &, support::FileNameList &) const;
65 void validate(LaTeXFeatures &) const;
67 docstring xhtml(XMLStream &, OutputParams const &) const;
69 void docbook(XMLStream &, OutputParams const &) const;
71 std::string contextMenuName() const;
74 /// \name Static public methods obligated for InsetCommand derived classes
77 static ParamInfo const & findInfo(std::string const &);
79 static std::string defaultCommand() { return "bibtex"; }
81 static bool isCompatibleCommand(std::string const & s)
82 { return s == "bibtex"; }
87 void editDatabases(docstring const & db = docstring()) const;
89 void parseBibTeXFiles(support::FileNameList &) const;
91 bool usingBiblatex() const;
93 docstring getRefLabel() const;
95 std::map<std::string, std::string> getFileEncodings() const;
97 /// \name Private functions inherited from Inset class
100 bool getStatus(Cursor & cur, FuncRequest const & cmd,
101 FuncStatus & flag) const;
103 void doDispatch(Cursor & cur, FuncRequest & cmd);
105 Inset * clone() const { return new InsetBibtex(*this); }
108 /// \name Private functions inherited from InsetCommand class
111 docstring screenLabel() const;
118 #endif // INSET_BIBTEX_H