4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Alejandro Aguilar Sierra
9 * Full author contact details are available in file CREDITS
17 #include "insetcommand.h"
21 /** Used to insert bibitem's information (key and label)
23 Must be automatically inserted as the first object in a
24 bibliography paragraph.
26 class InsetBibKey : public InsetCommand {
29 InsetBibKey(InsetCommandParams const &);
33 Inset * clone(Buffer const &, bool same_id = false) const;
34 /** Currently \bibitem is used as a LyX2.x command,
35 so we need this method.
37 void write(Buffer const *, std::ostream &) const;
39 void read(Buffer const *, LyXLex & lex);
41 virtual string const getScreenLabel(Buffer const *) const;
43 void edit(BufferView *, int x, int y, mouse_button::state button);
45 void edit(BufferView * bv, bool front = true);
47 EDITABLE editable() const { return IS_EDITABLE; }
48 /// keep .lyx format compatible
49 bool directWrite() const { return true; }
53 int getCounter() const { return counter; }
55 string const getBibLabel() const;
68 static int key_counter;
72 /** Used to insert BibTeX's information
74 class InsetBibtex : public InsetCommand {
77 InsetBibtex(InsetCommandParams const &, bool same_id = false);
81 Inset * clone(Buffer const &, bool same_id = false) const {
82 return new InsetBibtex(params(), same_id);
85 string const getScreenLabel(Buffer const *) const;
87 EDITABLE editable() const { return IS_EDITABLE; }
89 Inset::Code lyxCode() const { return Inset::BIBTEX_CODE; }
91 void edit(BufferView *, int x, int y, mouse_button::state button);
93 void edit(BufferView * bv, bool front = true);
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 std::vector<string> const getFiles(Buffer const &) const;
102 bool addDatabase(string const &);
104 bool delDatabase(string const &);
106 bool display() const { return true; }