]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbibtex.h
convert graphics for .tex export, fixes bug 1231
[lyx.git] / src / insets / insetbibtex.h
index 2a73b1d9a3abe521d045359dfa17b68440acf1a7..0a7cbf7093a71798a37cca582c9a118b35bb216a 100644 (file)
 #define INSET_BIBTEX_H
 
 
-#include "inset.h"
-#include "renderers.h"
-#include "support/filename.h"
-#include "mailinset.h"
 #include <vector>
+#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<lyx::support::FileName> 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<InsetBase> 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<std::pair<string,string> > & keys) const;
-       ///
-       std::vector<string> 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<std::pair<std::string,std::string> > & keys) const;
        ///
-       virtual string const inset2string(Buffer const &) const;
+       std::vector<std::string> 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