]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBibtex.h
Fix GRAPHICS_EDIT of InsetGraphics
[lyx.git] / src / insets / InsetBibtex.h
index 4e2b98849f8f3be75eafaad111f28524008a2948..efee21ef44158b4d78a74f89572f454f27e5022c 100644 (file)
 #include <map>
 #include "InsetCommand.h"
 #include "BiblioInfo.h"
-
-#include "support/FileName.h"
-
+#include "EmbeddedFiles.h"
 
 namespace lyx {
 
+
 /** Used to insert BibTeX's information
   */
 class InsetBibtex : public InsetCommand {
@@ -28,31 +27,53 @@ public:
        ///
        InsetBibtex(InsetCommandParams const &);
        ///
-       docstring const getScreenLabel(Buffer const &) const;
+       void setBuffer(Buffer & buffer);
+       ///
+       docstring screenLabel() const;
        ///
        EDITABLE editable() const { return IS_EDITABLE; }
        ///
-       Inset::Code lyxCode() const { return Inset::BIBTEX_CODE; }
+       InsetCode lyxCode() const { return BIBTEX_CODE; }
        ///
        DisplayType display() const { return AlignCenter; }
        ///
-       int latex(Buffer const &, odocstream &, OutputParams const &) const;
+       int latex(odocstream &, OutputParams const &) const;
        ///
-       virtual void fillWithBibKeys(Buffer const &,
-               BiblioInfo &, InsetIterator const &) const;
+       void fillWithBibKeys(BiblioInfo &, InsetIterator const &) const;
        ///
-       std::vector<support::FileName> const getFiles(Buffer const &) const;
+       EmbeddedFileList embeddedFiles() const;
        ///
        bool addDatabase(std::string const &);
        ///
        bool delDatabase(std::string const &);
        ///
        void validate(LaTeXFeatures &) const;
-protected:
-       virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
+       ///
+       static ParamInfo const & findInfo(std::string const &);
+       ///
+       static std::string defaultCommand() { return "bibtex"; };
+       ///
+       static bool isCompatibleCommand(std::string const & s) 
+               { return s == "bibtex"; }
+       /// create bibfiles_ from params bibfiles and embed
+       /**
+               \param bibfiles comma separated bib files
+               \param embed comma separated embed status
+       */
+       void createBibFiles(docstring const & bibfiles, docstring const & embed) const;
+       /// update bibfiles and embed from bibfiles_
+       void updateParam();
 private:
-       virtual Inset * clone() const;
-
+       ///
+       void registerEmbeddedFiles(EmbeddedFileList &) const;
+       ///
+       void updateEmbeddedFile(EmbeddedFile const & file);
+       /// embedded bib files
+       mutable EmbeddedFileList bibfiles_;
+       ///
+       void doDispatch(Cursor & cur, FuncRequest & cmd);
+       ///
+       Inset * clone() const { return new InsetBibtex(*this); }
 };