X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetBibtex.h;h=55451f564186da57ba64ecd804f1b17f136c731a;hb=3a949b32f08ce4884906a9c5d47c4d7031c794b2;hp=4b19f0fcfacc44f27977b043fbb330bdc0ff2481;hpb=35f3f7cbc4c4bda01aee68cdd5c24abd53365954;p=lyx.git diff --git a/src/insets/InsetBibtex.h b/src/insets/InsetBibtex.h index 4b19f0fcfa..55451f5641 100644 --- a/src/insets/InsetBibtex.h +++ b/src/insets/InsetBibtex.h @@ -12,14 +12,15 @@ #ifndef INSET_BIBTEX_H #define INSET_BIBTEX_H -#include "BiblioInfo.h" #include "InsetCommand.h" -#include "support/FileNameList.h" +namespace lyx { -#include +class docstring_list; -namespace lyx { +namespace support { + class FileName; +} // namespace support /** Used to insert BibTeX's information */ @@ -27,54 +28,87 @@ class InsetBibtex : public InsetCommand { public: /// InsetBibtex(Buffer *, InsetCommandParams const &); + /// - ~InsetBibtex(); + docstring_list getBibFiles() const; /// - docstring screenLabel() const; + bool addDatabase(docstring const &); /// - docstring toolTip(BufferView const & bv, int x, int y) const; + bool delDatabase(docstring const &); /// - bool hasSettings() const { return true; } + void write(std::ostream &) const override; + + /// \name Public functions inherited from Inset class + //@{ /// - InsetCode lyxCode() const { return BIBTEX_CODE; } + docstring toolTip(BufferView const & bv, int x, int y) const override; /// - DisplayType display() const { return AlignCenter; } + bool hasSettings() const override { return true; } /// - int latex(odocstream &, OutputParams const &) const; + InsetCode lyxCode() const override { return BIBTEX_CODE; } /// - void fillWithBibKeys(BiblioInfo &) const; + int rowFlags() const override { return Display; } /// - support::FileNameList getBibFiles() const; + void latex(otexstream &, OutputParams const &) const override; /// - bool addDatabase(docstring const &); + int plaintext(odocstringstream & ods, OutputParams const & op, + size_t max_length = INT_MAX) const override; /// - bool delDatabase(docstring const &); + void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false) override; + /// + void addToToc(DocIterator const & di, bool output_active, + UpdateType utype, TocBackend & backend) const override; + /// + void collectBibKeys(InsetIterator const &, support::FileNameList &) const override; + /// + void validate(LaTeXFeatures &) const override; /// - void validate(LaTeXFeatures &) const; + docstring xhtml(XMLStream &, OutputParams const &) const override; /// - docstring xhtml(XHTMLStream &, OutputParams const &) 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 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 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; + //@} };