#ifndef INSET_BIBTEX_H
#define INSET_BIBTEX_H
-#include "BiblioInfo.h"
#include "InsetCommand.h"
-#include "support/FileNameList.h"
+namespace lyx {
-#include <map>
+class docstring_list;
-namespace lyx {
+namespace support {
+ class FileName;
+} // namespace support
/** Used to insert BibTeX's information
*/
class InsetBibtex : public InsetCommand {
public:
///
- InsetBibtex(Buffer const &, InsetCommandParams const &);
+ InsetBibtex(Buffer *, InsetCommandParams const &);
+
+ ///
+ docstring_list getBibFiles() const;
+ ///
+ bool addDatabase(docstring const &);
+ ///
+ bool delDatabase(docstring const &);
+ ///
+ void write(std::ostream &) const override;
+
+ /// \name Public functions inherited from Inset class
+ //@{
///
- virtual ~InsetBibtex();
+ docstring toolTip(BufferView const & bv, int x, int y) const override;
///
- docstring screenLabel() const;
+ bool hasSettings() const override { return true; }
///
- docstring toolTip(BufferView const & bv, int x, int y) const;
+ InsetCode lyxCode() const override { return BIBTEX_CODE; }
///
- EDITABLE editable() const { return IS_EDITABLE; }
+ int rowFlags() const override { return Display; }
///
- InsetCode lyxCode() const { return BIBTEX_CODE; }
+ void latex(otexstream &, OutputParams const &) const override;
///
- DisplayType display() const { return AlignCenter; }
+ int plaintext(odocstringstream & ods, OutputParams const & op,
+ size_t max_length = INT_MAX) const override;
///
- int latex(odocstream &, OutputParams const &) const;
+ void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false) override;
///
- void fillWithBibKeys(BiblioInfo &, InsetIterator const &) const;
+ void addToToc(DocIterator const & di, bool output_active,
+ UpdateType utype, TocBackend & backend) const override;
///
- support::FileNameList getBibFiles() const;
+ void collectBibKeys(InsetIterator const &, support::FileNameList &) const override;
///
- bool addDatabase(docstring const &);
+ void validate(LaTeXFeatures &) const override;
///
- bool delDatabase(docstring const &);
+ docstring xhtml(XMLStream &, OutputParams const &) const override;
///
- void validate(LaTeXFeatures &) const;
+ void docbook(XMLStream &, OutputParams const &) const override;
+ ///
+ std::string contextMenuName() const override;
+ //@}
+
+ /// \name Static public methods obligated for InsetCommand derived classes
+ //@{
///
static ParamInfo const & findInfo(std::string const &);
///
- static std::string defaultCommand() { return "bibtex"; };
+ static std::string defaultCommand() { return "bibtex"; }
///
- static bool isCompatibleCommand(std::string const & s)
+ static bool isCompatibleCommand(std::string const & s)
{ return s == "bibtex"; }
- /// look up the path to the file using TeX
- static support::FileName
- getBibTeXPath(docstring const & filename, Buffer const & buf);
- ///
- docstring contextMenu(BufferView const &, int, int) const;
+ //@}
+
private:
///
- void doDispatch(Cursor & cur, FuncRequest & cmd);
+ void editDatabases(docstring const & db = docstring()) const;
+ ///
+ void parseBibTeXFiles(support::FileNameList &) const;
+ ///
+ bool usingBiblatex() const;
+ ///
+ docstring getRefLabel() const;
+ ///
+ std::map<std::string, std::string> getFileEncodings() const;
+
+ /// \name Private functions inherited from Inset class
+ //@{
///
bool getStatus(Cursor & cur, FuncRequest const & cmd,
- FuncStatus & flag) const;
+ FuncStatus & flag) const override;
///
- void editDatabases() const;
+ void doDispatch(Cursor & cur, FuncRequest & cmd) override;
+ ///
+ Inset * clone() const override { return new InsetBibtex(*this); }
+ //@}
+
+ /// \name Private functions inherited from InsetCommand class
+ //@{
///
- Inset * clone() const { return new InsetBibtex(*this); }
+ docstring screenLabel() const override;
+ //@}
};