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 * ====================================================== */
19 #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() : InsetCommand("bibitem") { counter = 1; }
36 InsetBibKey(string const & key, string const & label = string());
39 InsetBibKey(InsetBibKey const *);
43 Inset * Clone() const { return new InsetBibKey(this); }
44 /// Currently \bibitem is used as a LyX2.x command, so we need this method.
45 void Write(Buffer const *, std::ostream &) const;
47 void Read(Buffer const *, LyXLex & lex);
49 virtual string getScreenLabel() const;
51 void Edit(BufferView *, int x, int y, unsigned int button);
53 EDITABLE Editable() const {
56 /// A user can't neither insert nor delete this inset
57 bool Deletable() const {
63 int getCounter() const { return counter; }
65 void callback( FD_bibitem_form *, long );
80 /** Used to insert BibTeX's information
82 class InsetBibtex: public InsetCommand {
85 InsetBibtex() : InsetCommand("BibTeX") { owner = 0; }
87 InsetBibtex(string const & dbase, string const & style,
93 Inset * Clone() const {
94 return new InsetBibtex(getCmdName(), getOptions(), 0);
97 Inset::Code LyxCode() const
99 return Inset::BIBTEX_CODE;
102 string getScreenLabel() const;
104 void Edit(BufferView *, int x, int y, unsigned int button);
106 int Latex(Buffer const *, std::ostream &, bool fragile, bool freespace) const;
108 std::vector< std::pair<string,string> > getKeys() const;
110 EDITABLE Editable() const {
114 bool addDatabase(string const &);
116 bool delDatabase(string const &);
118 bool display() const { return true; }
127 mutable Buffer * owner;