]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbib.h
Some more changes for updating text-insets.
[lyx.git] / src / insets / insetbib.h
index 04ec9d3d5ec987643525d6460359ff407a6ea794..1c3adc371e56531f00ff575dd49529d469a64d2d 100644 (file)
 #endif
 
 #include "insetcommand.h"
+#include <vector>
 
-// Created by Alejandro 970222
-
-
-/** Used to insert citations  
- */
-class InsetCitation: public InsetCommand {
-public:
-       ///
-       InsetCitation() : InsetCommand("cite") {}
-       ///
-       InsetCitation(string const & key, string const & note = string());
-        ///
-       ~InsetCitation();
-        ///
-        Inset * Clone() const {
-               return new InsetCitation(contents, options);
-       }
-       ///
-       string getScreenLabel()const;
-        ///
-       void Edit(int, int);
-        ///
-       unsigned char Editable() const {
-               return 1;
-       }
-};
-
+class Buffer;
 
 /** Used to insert bibitem's information (key and label)
   
@@ -56,22 +31,24 @@ public:
        ///
        InsetBibKey() : InsetCommand("bibitem") { counter = 1; }
        ///
+       explicit
        InsetBibKey(string const & key, string const & label = string());
        ///
+       explicit
        InsetBibKey(InsetBibKey const *);
        ///
        ~InsetBibKey();
        ///
         Inset * Clone() const { return new InsetBibKey(this); }
        /// Currently \bibitem is used as a LyX2.x command, so we need this method.
-        void Write(ostream &);
+        void Write(Buffer const *, std::ostream &) const;
        ///
        virtual string getScreenLabel() const;
         ///
-       void Edit(int, int);
+       void Edit(BufferView *, int x, int y, unsigned int button);
        ///
-       unsigned char Editable() const {
-               return 1;
+       EDITABLE Editable() const {
+               return IS_EDITABLE;
        }
        /// A user can't neither insert nor delete this inset
        bool Deletable() const {
@@ -81,10 +58,18 @@ public:
         void setCounter(int);
         ///
         int  getCounter() const { return counter; }
-
+       ///
+       struct Holder {
+               InsetBibKey * inset;
+               BufferView * view;
+       };
  private:
        ///
         int counter;
+
+       ///
+       Holder holder;
 };
 
 
@@ -97,9 +82,12 @@ public:
        ///
        InsetBibtex(string const & dbase, string const & style,
                    Buffer *);
+       ///
+       ~InsetBibtex();
+
         ///
        Inset * Clone() const {
-               return new InsetBibtex(contents, options, 0);
+               return new InsetBibtex(getCmdName(), getOptions(), 0);
        }
        ///  
        Inset::Code LyxCode() const
@@ -109,26 +97,33 @@ public:
        ///
        string getScreenLabel() const;
        ///
-       void Edit(int, int);
+       void Edit(BufferView *, int x, int y, unsigned int button);
        /// 
-       int Latex(ostream &, signed char);
-       ///
-       int Latex(string & file, signed char fragile);
+       int Latex(Buffer const *, std::ostream &, bool fragile, bool freespace) const;
        ///
-       string getKeys(char delim);
+       std::vector< std::pair<string,string> > getKeys() const;
        ///
-       unsigned char Editable() const {
-               return 1;
+       EDITABLE Editable() const {
+               return IS_EDITABLE;
        }
         ///
         bool addDatabase(string const &);
         ///
         bool delDatabase(string const &);
        ///
-       bool display() const { return true; }    
+       bool display() const { return true; } 
+
+       struct Holder {
+               InsetBibtex * inset;
+               BufferView * view;
+       };
+
 private:
        ///
-       Buffer * owner;
+       mutable Buffer * owner;
+
+       ///
+       Holder holder;
 };
 
 #endif