X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetbibtex.h;h=0a7cbf7093a71798a37cca582c9a118b35bb216a;hb=5603df4a5b7e511b31026c9a4f8f55b2b10fde57;hp=2a73b1d9a3abe521d045359dfa17b68440acf1a7;hpb=9498f9758fcfd317c74969b12397b753846eb2f6;p=lyx.git diff --git a/src/insets/insetbibtex.h b/src/insets/insetbibtex.h index 2a73b1d9a3..0a7cbf7093 100644 --- a/src/insets/insetbibtex.h +++ b/src/insets/insetbibtex.h @@ -13,98 +13,42 @@ #define INSET_BIBTEX_H -#include "inset.h" -#include "renderers.h" -#include "support/filename.h" -#include "mailinset.h" #include +#include "insetcommand.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; -}; - - -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; + std::string 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); - /// 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; + OutputParams const &) const; /// void fillWithBibKeys(Buffer const & buffer, - std::vector > & keys) const; - /// - std::vector const getFiles(Buffer const &) const; - /// - bool addDatabase(string const &); - bool delDatabase(string const &); - /// - InsetBibtexParams const & params() const { return params_; } - void setParams(InsetBibtexParams const &); -private: - InsetBibtexParams params_; - mutable bool set_label_; - mutable unsigned int center_indent_; - mutable ButtonRenderer button_; -}; - - -class InsetBibtexMailer : public MailInset { -public: - /// - InsetBibtexMailer(InsetBibtex & inset); - /// - virtual InsetBase & inset() const { return inset_; } - /// - virtual string const & name() const { return name_; } + std::vector > & keys) const; /// - virtual string const inset2string(Buffer const &) const; + std::vector const getFiles(Buffer const &) const; /// - static void string2params(string const &, Buffer const &, - InsetBibtexParams &); + bool addDatabase(std::string const &); /// - static string const params2string(InsetBibtexParams const &, - Buffer const &); -private: + bool delDatabase(std::string const &); /// - InsetBibtex & inset_; + void validate(LaTeXFeatures &) const; +protected: /// - static string const name_; + virtual void priv_dispatch(LCursor & cur, FuncRequest & cmd); }; #endif // INSET_BIBTEX_H