2 /* This file is part of*
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2000 The LyX Team.
10 * ====================================================== */
19 #include "insetcommand.h"
23 struct FD_bibitem_form;
25 /** Used to insert bibitem's information (key and label)
27 Must be automatically inserted as the first object in a
28 bibliography paragraph.
30 class InsetBibKey : public InsetCommand {
33 InsetBibKey() : InsetCommand("bibitem") { counter = 1; }
36 InsetBibKey(string const & key, string const & label = string());
39 InsetBibKey(InsetBibKey const *);
43 Inset * Clone() const { return new InsetBibKey(this); }
44 /** Currently \bibitem is used as a LyX2.x command,
45 so we need this method.
47 void Write(Buffer const *, std::ostream &) const;
49 void Read(Buffer const *, LyXLex & lex);
51 virtual string getScreenLabel() const;
53 void Edit(BufferView *, int x, int y, unsigned int button);
55 EDITABLE Editable() const {
58 /// A user can't neither insert nor delete this inset
59 bool Deletable() const {
65 int getCounter() const { return counter; }
67 void callback( FD_bibitem_form *, long );
82 /** Used to insert BibTeX's information
84 class InsetBibtex : public InsetCommand {
87 InsetBibtex() : InsetCommand("BibTeX") { owner = 0; }
89 InsetBibtex(string const & dbase, string const & style,
95 Inset * Clone() const {
96 return new InsetBibtex(getContents(), getOptions(), owner);
99 Inset::Code LyxCode() const
101 return Inset::BIBTEX_CODE;
104 string getScreenLabel() const;
106 void Edit(BufferView *, int x, int y, unsigned int button);
108 int Latex(Buffer const *, std::ostream &,
109 bool fragile, bool freespace) const;
111 std::vector<std::pair<string,string> > getKeys() const;
113 EDITABLE Editable() const {
117 bool addDatabase(string const &);
119 bool delDatabase(string const &);
121 bool display() const { return true; }
130 mutable Buffer * owner;