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 * ====================================================== */
20 #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(InsetCommandParams const &);
37 Inset * Clone() const;
38 /** Currently \bibitem is used as a LyX2.x command,
39 so we need this method.
41 void Write(Buffer const *, std::ostream &) const;
43 void Read(Buffer const *, LyXLex & lex);
45 virtual string const getScreenLabel() const;
47 void Edit(BufferView *, int x, int y, unsigned int button);
49 EDITABLE Editable() const {
52 /// A user can't neither insert nor delete this inset
53 bool Deletable() const {
59 int getCounter() const { return counter; }
61 void callback( FD_bibitem_form *, long );
76 /** Used to insert BibTeX's information
78 class InsetBibtex : public InsetCommand {
81 InsetBibtex(InsetCommandParams const &);
85 Inset * Clone() const { return new InsetBibtex(params()); }
87 string const getScreenLabel() const;
89 EDITABLE Editable() const { return IS_EDITABLE; }
91 Inset::Code LyxCode() const { return Inset::BIBTEX_CODE; }
93 void Edit(BufferView *, int x, int y, unsigned int button);
95 int Latex(Buffer const *, std::ostream &,
96 bool fragile, bool freespace) const;
98 std::vector<std::pair<string,string> > const getKeys(Buffer const *) const;
100 bool addDatabase(string const &);
102 bool delDatabase(string const &);
104 bool display() const { return true; }