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"
24 /** Used to insert bibitem's information (key and label)
26 Must be automatically inserted as the first object in a
27 bibliography paragraph.
29 class InsetBibKey : public InsetCommand {
32 InsetBibKey(InsetCommandParams const &);
36 Inset * Clone(Buffer const &) const;
37 /** Currently \bibitem is used as a LyX2.x command,
38 so we need this method.
40 void Write(Buffer const *, std::ostream &) const;
42 void Read(Buffer const *, LyXLex & lex);
44 virtual string const getScreenLabel() const;
46 void Edit(BufferView *, int x, int y, unsigned int button);
48 EDITABLE Editable() const {
51 /// A user can't neither insert nor delete this inset
52 bool Deletable() const {
58 int getCounter() const { return counter; }
60 string const getBibLabel() const;
73 static int key_counter;
77 /** Used to insert BibTeX's information
79 class InsetBibtex : public InsetCommand {
82 InsetBibtex(InsetCommandParams const &);
86 Inset * Clone(Buffer const &) const {
87 return new InsetBibtex(params());
90 string const getScreenLabel() const;
92 EDITABLE Editable() const { return IS_EDITABLE; }
94 Inset::Code LyxCode() const { return Inset::BIBTEX_CODE; }
96 void Edit(BufferView *, int x, int y, unsigned int button);
98 int Latex(Buffer const *, std::ostream &,
99 bool fragile, bool freespace) const;
101 std::vector<std::pair<string,string> > const getKeys(Buffer const *) const;
103 bool addDatabase(string const &);
105 bool delDatabase(string const &);
107 bool display() const { return true; }