2 /* This file is part of*
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2001 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 &, bool same_id = false) 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(Buffer const *) const;
46 void edit(BufferView *, int x, int y, unsigned int button);
48 void edit(BufferView * bv, bool front = true);
50 EDITABLE editable() const { return IS_EDITABLE; }
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 &, bool same_id = false);
86 Inset * clone(Buffer const &, bool same_id = false) const {
87 return new InsetBibtex(params(), same_id);
90 string const getScreenLabel(Buffer const *) 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 void edit(BufferView * bv, bool front = true);
100 int latex(Buffer const *, std::ostream &,
101 bool fragile, bool freespace) const;
103 std::vector<std::pair<string,string> > const getKeys(Buffer const *) const;
105 std::vector<string> const getFiles(Buffer const &) const;
107 bool addDatabase(string const &);
109 bool delDatabase(string const &);
111 bool display() const { return true; }