#ifndef INSET_BIBTEX_H
#define INSET_BIBTEX_H
-
-#include <vector>
#include "InsetCommand.h"
-#include "support/FileName.h"
+namespace lyx {
+class BiblioInfo;
+class docstring_list;
-namespace lyx {
+namespace support {
+ class FileName;
+} // namespace support
/** Used to insert BibTeX's information
*/
class InsetBibtex : public InsetCommand {
public:
///
- InsetBibtex(InsetCommandParams const &);
+ InsetBibtex(Buffer *, InsetCommandParams const &);
+
///
- docstring const getScreenLabel(Buffer const &) const;
+ docstring_list getBibFiles() const;
///
- EDITABLE editable() const { return IS_EDITABLE; }
+ bool addDatabase(docstring const &);
+ ///
+ bool delDatabase(docstring const &);
+ ///
+ void write(std::ostream &) const;
+
+ /// \name Public functions inherited from Inset class
+ //@{
///
- Inset::Code lyxCode() const { return Inset::BIBTEX_CODE; }
+ docstring toolTip(BufferView const & bv, int x, int y) const;
+ ///
+ bool hasSettings() const { return true; }
+ ///
+ InsetCode lyxCode() const { return BIBTEX_CODE; }
///
DisplayType display() const { return AlignCenter; }
///
- int latex(Buffer const &, odocstream &, OutputParams const &) const;
+ void latex(otexstream &, OutputParams const &) const;
///
- virtual void fillWithBibKeys(Buffer const &,
- std::vector<std::pair<std::string, docstring> > &,
- InsetIterator const &) const;
+ int plaintext(odocstringstream & ods, OutputParams const & op,
+ size_t max_length = INT_MAX) const;
///
- std::vector<support::FileName> const getFiles(Buffer const &) const;
+ void updateBuffer(ParIterator const &, UpdateType);
///
- bool addDatabase(std::string const &);
+ void addToToc(DocIterator const & di, bool output_active,
+ UpdateType utype, TocBackend & backend) const;
///
- bool delDatabase(std::string const &);
+ void collectBibKeys(InsetIterator const &, support::FileNameList &) const;
///
void validate(LaTeXFeatures &) const;
-protected:
- virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
+ ///
+ docstring xhtml(XHTMLStream &, OutputParams const &) const;
+ ///
+ std::string contextMenuName() const;
+ //@}
+
+ /// \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)
+ { return s == "bibtex"; }
+ //@}
+
private:
- virtual std::auto_ptr<Inset> doClone() const;
+ ///
+ 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;
+ ///
+ void doDispatch(Cursor & cur, FuncRequest & cmd);
+ ///
+ Inset * clone() const { return new InsetBibtex(*this); }
+ //@}
+ /// \name Private functions inherited from InsetCommand class
+ //@{
+ ///
+ docstring screenLabel() const;
+ //@}
};