]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbib.h
Hopefully fixed the redo problems with insets!
[lyx.git] / src / insets / insetbib.h
index 58266516ab109aa586f678bee68c561fc4fc01e5..e51b236deaf9dfa610932c7067697f6cad72947f 100644 (file)
@@ -5,7 +5,7 @@
  *           LyX, The Document Processor
  *      
  *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2000 The LyX Team.
+ *           Copyright 1995-2001 The LyX Team.
  * 
  * ====================================================== */
 
@@ -20,7 +20,6 @@
 #include "insetcommand.h"
 
 class Buffer;
-struct FD_bibitem_form;
 
 /** Used to insert bibitem's information (key and label)
   
@@ -34,31 +33,31 @@ public:
        ///
        ~InsetBibKey();
        ///
-       Inset * Clone() const;
+       Inset * clone(Buffer const &, bool same_id = false) const;
        /** Currently \bibitem is used as a LyX2.x command,
            so we need this method.
        */
-        void Write(Buffer const *, std::ostream &) const;
+       void write(Buffer const *, std::ostream &) const;
        ///
-       void Read(Buffer const *, LyXLex & lex);
+       void read(Buffer const *, LyXLex & lex);
        ///
-       virtual string getScreenLabel() const;
-        ///
-       void Edit(BufferView *, int x, int y, unsigned int button);
+       virtual string const getScreenLabel(Buffer const *) const;
        ///
-       EDITABLE Editable() const {
-               return IS_EDITABLE;
-       }
+       void edit(BufferView *, int x, int y, unsigned int button);
+       ///
+       void edit(BufferView * bv, bool front = true);
+       ///
+       EDITABLE editable() const { return IS_EDITABLE; } 
        /// A user can't neither insert nor delete this inset
-       bool Deletable() const {
+       bool deletable() const {
                return false;
        }
-        ///
-        void setCounter(int);
-        ///
-        int  getCounter() const { return counter; }
        ///
-       void callback( FD_bibitem_form *, long );
+       void setCounter(int);
+       ///
+       int  getCounter() const { return counter; }
+       ///
+       string const getBibLabel() const;
        ///
        struct Holder {
                InsetBibKey * inset;
@@ -67,9 +66,11 @@ public:
  
 private:
        ///
-        int counter;
+       int counter;
        ///
        Holder holder;
+       ///
+       static int key_counter;
 };
 
 
@@ -78,28 +79,34 @@ private:
 class InsetBibtex : public InsetCommand {
 public:
        ///
-       InsetBibtex(InsetCommandParams const &, Buffer *);
+       InsetBibtex(InsetCommandParams const &, bool same_id = false);
        ///
        ~InsetBibtex();
        ///
-       Inset * Clone() const { return new InsetBibtex(params(), owner); }
+       Inset * clone(Buffer const &, bool same_id = false) const {
+               return new InsetBibtex(params(), same_id);
+       }
        ///
-       string getScreenLabel() const;
+       string const getScreenLabel(Buffer const *) const;
        ///
-       EDITABLE Editable() const { return IS_EDITABLE; }
+       EDITABLE editable() const { return IS_EDITABLE; }
        ///
-       Inset::Code LyxCode() const { return Inset::BIBTEX_CODE; }
+       Inset::Code lyxCode() const { return Inset::BIBTEX_CODE; }
        ///
-       void Edit(BufferView *, int x, int y, unsigned int button);
+       void edit(BufferView *, int x, int y, unsigned int button);
+       ///
+       void edit(BufferView * bv, bool front = true);
        /// 
-       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> > const getKeys(Buffer const *) const;
+       ///
+       std::vector<string> const getFiles(Buffer const &) const;
        ///
-       std::vector<std::pair<string,string> > getKeys() const;
-        ///
-        bool addDatabase(string const &);
-        ///
-        bool delDatabase(string const &);
+       bool addDatabase(string const &);
+       ///
+       bool delDatabase(string const &);
        ///
        bool display() const { return true; } 
        ///
@@ -109,9 +116,6 @@ public:
        };
 
 private:
-       ///
-       mutable Buffer * owner;
-
        ///
        Holder holder;
 };