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, so we need this method.
45 void Write(Buffer const *, std::ostream &) const;
47 virtual string getScreenLabel() const;
49 void Edit(BufferView *, int x, int y, unsigned int button);
51 EDITABLE Editable() const {
54 /// A user can't neither insert nor delete this inset
55 bool Deletable() const {
61 int getCounter() const { return counter; }
63 void callback( FD_bibitem_form *, long );
78 /** Used to insert BibTeX's information
80 class InsetBibtex: public InsetCommand {
83 InsetBibtex() : InsetCommand("BibTeX") { owner = 0; }
85 InsetBibtex(string const & dbase, string const & style,
91 Inset * Clone() const {
92 return new InsetBibtex(getCmdName(), getOptions(), 0);
95 Inset::Code LyxCode() const
97 return Inset::BIBTEX_CODE;
100 string getScreenLabel() const;
102 void Edit(BufferView *, int x, int y, unsigned int button);
104 int Latex(Buffer const *, std::ostream &, bool fragile, bool freespace) const;
106 std::vector< std::pair<string,string> > getKeys() const;
108 EDITABLE Editable() const {
112 bool addDatabase(string const &);
114 bool delDatabase(string const &);
116 bool display() const { return true; }
125 mutable Buffer * owner;