]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbib.h
prepare for 1.1.6pre2
[lyx.git] / src / insets / insetbib.h
index 1c3adc371e56531f00ff575dd49529d469a64d2d..3c02c7618db0ec8cee5da2c1fe5ad75d727e3eaa 100644 (file)
 #pragma interface
 #endif
 
-#include "insetcommand.h"
 #include <vector>
+#include "insetcommand.h"
 
 class Buffer;
+struct FD_bibitem_form;
 
 /** Used to insert bibitem's information (key and label)
   
   Must be automatically inserted as the first object in a
   bibliography paragraph. 
   */
-class InsetBibKey: public InsetCommand {
+class InsetBibKey : public InsetCommand {
 public:
        ///
-       InsetBibKey() : InsetCommand("bibitem") { counter = 1; }
-       ///
-       explicit
-       InsetBibKey(string const & key, string const & label = string());
-       ///
-       explicit
-       InsetBibKey(InsetBibKey const *);
+       InsetBibKey(InsetCommandParams const &);
        ///
        ~InsetBibKey();
        ///
-        Inset * Clone() const { return new InsetBibKey(this); }
-       /// Currently \bibitem is used as a LyX2.x command, so we need this method.
+       Inset * Clone(Buffer const &) const;
+       /** Currently \bibitem is used as a LyX2.x command,
+           so we need this method.
+       */
         void Write(Buffer const *, std::ostream &) const;
        ///
-       virtual string getScreenLabel() const;
+       void Read(Buffer const *, LyXLex & lex);
+       ///
+       virtual string const getScreenLabel() const;
         ///
        void Edit(BufferView *, int x, int y, unsigned int button);
        ///
@@ -59,15 +58,16 @@ public:
         ///
         int  getCounter() const { return counter; }
        ///
+       void callback( FD_bibitem_form *, long );
+       ///
        struct Holder {
                InsetBibKey * inset;
                BufferView * view;
        };
  
- private:
+private:
        ///
         int counter;
-
        ///
        Holder holder;
 };
@@ -75,53 +75,42 @@ public:
 
 /** Used to insert BibTeX's information 
   */
-class InsetBibtex: public InsetCommand {
+class InsetBibtex : public InsetCommand {
 public:
-       /// 
-       InsetBibtex() : InsetCommand("BibTeX") { owner = 0; }
        ///
-       InsetBibtex(string const & dbase, string const & style,
-                   Buffer *);
+       InsetBibtex(InsetCommandParams const &);
        ///
        ~InsetBibtex();
-
-        ///
-       Inset * Clone() const {
-               return new InsetBibtex(getCmdName(), getOptions(), 0);
-       }
-       ///  
-       Inset::Code LyxCode() const
-       {
-               return Inset::BIBTEX_CODE;
+       ///
+       Inset * Clone(Buffer const &) const {
+               return new InsetBibtex(params());
        }
        ///
-       string getScreenLabel() const;
+       string const getScreenLabel() const;
+       ///
+       EDITABLE Editable() const { return IS_EDITABLE; }
+       ///
+       Inset::Code LyxCode() const { return Inset::BIBTEX_CODE; }
        ///
        void Edit(BufferView *, int x, int y, unsigned int button);
        /// 
-       int Latex(Buffer const *, std::ostream &, bool fragile, bool freespace) const;
+       int Latex(Buffer const *, std::ostream &,
+                 bool fragile, bool freespace) const;
        ///
-       std::vector< std::pair<string,string> > getKeys() const;
-       ///
-       EDITABLE Editable() const {
-               return IS_EDITABLE;
-       }
+       std::vector<std::pair<string,string> > const getKeys(Buffer const *) const;
         ///
         bool addDatabase(string const &);
         ///
         bool delDatabase(string const &);
        ///
        bool display() const { return true; } 
-
+       ///
        struct Holder {
                InsetBibtex * inset;
                BufferView * view;
        };
 
 private:
-       ///
-       mutable Buffer * owner;
-
        ///
        Holder holder;
 };