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(Buffer const &) 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 string const getBibLabel() const;
63 void callback( FD_bibitem_form *, long );
76 static int key_counter;
80 /** Used to insert BibTeX's information
82 class InsetBibtex : public InsetCommand {
85 InsetBibtex(InsetCommandParams const &);
89 Inset * Clone(Buffer const &) const {
90 return new InsetBibtex(params());
93 string const getScreenLabel() const;
95 EDITABLE Editable() const { return IS_EDITABLE; }
97 Inset::Code LyxCode() const { return Inset::BIBTEX_CODE; }
99 void Edit(BufferView *, int x, int y, unsigned int button);
101 int Latex(Buffer const *, std::ostream &,
102 bool fragile, bool freespace) const;
104 std::vector<std::pair<string,string> > const getKeys(Buffer const *) const;
106 bool addDatabase(string const &);
108 bool delDatabase(string const &);
110 bool display() const { return true; }