X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetbib.h;h=a478f646f9f0061e10f7ca4d0d7588d104786563;hb=3c8aba3b556871fb1100a2f98cd93d5d4e3f70c9;hp=4c5fc0157c465b8c0d31dd6bd1e7ac00d287dc78;hpb=1d7d3cc4afa2205c801ccc2aa71c7ac59359dc5f;p=lyx.git diff --git a/src/insets/insetbib.h b/src/insets/insetbib.h index 4c5fc0157c..a478f646f9 100644 --- a/src/insets/insetbib.h +++ b/src/insets/insetbib.h @@ -4,8 +4,8 @@ * * LyX, The Document Processor * - * Copyright (C) 1995 Matthias Ettrich - * Copyright (C) 1995-1999 The LyX Team. + * Copyright 1995 Matthias Ettrich + * Copyright 1995-2000 The LyX Team. * * ====================================================== */ @@ -18,31 +18,40 @@ #include "insetcommand.h" -// Created by Alejandro 970222 - +class Buffer; /** Used to insert citations */ class InsetCitation: public InsetCommand { public: /// - InsetCitation(): InsetCommand("cite") {} + InsetCitation() : InsetCommand("cite") {} /// + explicit InsetCitation(string const & key, string const & note = string()); /// ~InsetCitation(); /// - InsetCitation * Clone() const { + Inset * Clone() const { return new InsetCitation(contents, options); } /// 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; } + /// + struct Holder { + InsetCitation * inset; + BufferView * view; + }; + +private: + /// + Holder holder; }; @@ -56,22 +65,24 @@ public: /// InsetBibKey() : InsetCommand("bibitem") { counter = 1; } /// + explicit InsetBibKey(string const & key, string const & label = string()); /// + explicit InsetBibKey(InsetBibKey const *); /// ~InsetBibKey(); /// - InsetBibKey * Clone() const { return new InsetBibKey(this); } + Inset * Clone() const { return new InsetBibKey(this); } /// Currently \bibitem is used as a LyX2.x command, so we need this method. - void Write(FILE *); + void Write(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 +92,18 @@ public: void setCounter(int); /// int getCounter() const { return counter; } + /// + struct Holder { + InsetBibKey * inset; + BufferView * view; + }; private: /// int counter; + + /// + Holder holder; }; @@ -93,12 +112,15 @@ public: class InsetBibtex: public InsetCommand { public: /// - InsetBibtex(): InsetCommand("BibTeX") { owner = 0; } + InsetBibtex() : InsetCommand("BibTeX") { owner = 0; } /// InsetBibtex(string const & dbase, string const & style, Buffer *); + /// + ~InsetBibtex(); + /// - InsetBibtex * Clone() const { + Inset * Clone() const { return new InsetBibtex(contents, options, 0); } /// @@ -109,26 +131,33 @@ public: /// string getScreenLabel() const; /// - void Edit(int, int); + void Edit(BufferView *, int x, int y, unsigned int button); /// - int Latex(FILE *, signed char); + int Latex(std::ostream &, bool fragile, bool freespace) const; /// - int Latex(string & file, signed char fragile); + string getKeys(char delim); /// - string getKeys(); - /// - 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