X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetbibtex.h;h=3c461d73bb02d76936b632af361c4f0a4f98017d;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=2a73b1d9a3abe521d045359dfa17b68440acf1a7;hpb=9498f9758fcfd317c74969b12397b753846eb2f6;p=lyx.git diff --git a/src/insets/insetbibtex.h b/src/insets/insetbibtex.h index 2a73b1d9a3..3c461d73bb 100644 --- a/src/insets/insetbibtex.h +++ b/src/insets/insetbibtex.h @@ -13,98 +13,49 @@ #define INSET_BIBTEX_H -#include "inset.h" -#include "renderers.h" -#include "support/filename.h" -#include "mailinset.h" #include +#include "insetcommand.h" +#include "support/filename.h" -class InsetBibtexParams { -public: - InsetBibtexParams(); - bool empty() const; - void erase(); - void write(Buffer const &, std::ostream &) const; - void read(Buffer const &, LyXLex &); - - std::vector databases; - string style; - bool bibtotoc; -}; +namespace lyx { -class InsetBibtex : public InsetOld { +/** Used to insert BibTeX's information + */ +class InsetBibtex : public InsetCommand { public: /// - InsetBibtex(); - InsetBibtex(InsetBibtexParams const &); - /// - ~InsetBibtex(); + InsetBibtex(InsetCommandParams const &); /// - std::auto_ptr clone() const; - /// small wrapper for the time being - virtual dispatch_result localDispatch(FuncRequest const & cmd); - /// - string const getScreenLabel(Buffer const &) const; + docstring const getScreenLabel(Buffer const &) const; /// EDITABLE editable() const { return IS_EDITABLE; } /// - InsetOld::Code lyxCode() const { return InsetOld::BIBTEX_CODE; } - /// - virtual void metrics(MetricsInfo &, Dimension &) const; - virtual void draw(PainterInfo & pi, int x, int y) const; - /// - virtual void write(Buffer const &, std::ostream & os) const; - virtual void read(Buffer const &, LyXLex & lex); + InsetBase::Code lyxCode() const { return InsetBase::BIBTEX_CODE; } /// bool display() const { return true; } /// - int latex(Buffer const &, std::ostream &, - LatexRunParams const &) const; - virtual int ascii(Buffer const &, std::ostream &, int linelen) const; - virtual int linuxdoc(Buffer const &, std::ostream &) const; - virtual int docbook(Buffer const &, std::ostream &, bool) const; + int latex(Buffer const &, odocstream &, OutputParams const &) const; /// void fillWithBibKeys(Buffer const & buffer, - std::vector > & keys) const; + std::vector > & keys) const; /// - std::vector const getFiles(Buffer const &) const; + std::vector const getFiles(Buffer const &) const; /// - bool addDatabase(string const &); - bool delDatabase(string const &); + bool addDatabase(std::string const &); /// - InsetBibtexParams const & params() const { return params_; } - void setParams(InsetBibtexParams const &); + bool delDatabase(std::string const &); + /// + void validate(LaTeXFeatures &) const; +protected: + virtual void doDispatch(LCursor & cur, FuncRequest & cmd); private: - InsetBibtexParams params_; - mutable bool set_label_; - mutable unsigned int center_indent_; - mutable ButtonRenderer button_; + virtual std::auto_ptr doClone() const; + }; -class InsetBibtexMailer : public MailInset { -public: - /// - InsetBibtexMailer(InsetBibtex & inset); - /// - virtual InsetBase & inset() const { return inset_; } - /// - virtual string const & name() const { return name_; } - /// - virtual string const inset2string(Buffer const &) const; - /// - static void string2params(string const &, Buffer const &, - InsetBibtexParams &); - /// - static string const params2string(InsetBibtexParams const &, - Buffer const &); -private: - /// - InsetBibtex & inset_; - /// - static string const name_; -}; +} // namespace lyx #endif // INSET_BIBTEX_H