]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbibtex.h
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / insetbibtex.h
index 2a73b1d9a3abe521d045359dfa17b68440acf1a7..3c461d73bb02d76936b632af361c4f0a4f98017d 100644 (file)
 #define INSET_BIBTEX_H
 
 
-#include "inset.h"
-#include "renderers.h"
-#include "support/filename.h"
-#include "mailinset.h"
 #include <vector>
+#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<lyx::support::FileName> 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<InsetBase> 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<std::pair<string,string> > & keys) const;
+               std::vector<std::pair<std::string, docstring> > & keys) const;
        ///
-       std::vector<string> const getFiles(Buffer const &) const;
+       std::vector<support::FileName> 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<InsetBase> 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