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"
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() : InsetCommand("bibitem") { counter = 1; }
35 InsetBibKey(string const & key, string const & label = string());
38 InsetBibKey(InsetBibKey const *);
42 Inset * Clone() const { return new InsetBibKey(this); }
43 /// Currently \bibitem is used as a LyX2.x command, so we need this method.
44 void Write(std::ostream &) const;
46 virtual string getScreenLabel() const;
48 void Edit(BufferView *, int x, int y, unsigned int button);
50 EDITABLE Editable() const {
53 /// A user can't neither insert nor delete this inset
54 bool Deletable() const {
60 int getCounter() const { return counter; }
76 /** Used to insert BibTeX's information
78 class InsetBibtex: public InsetCommand {
81 InsetBibtex() : InsetCommand("BibTeX") { owner = 0; }
83 InsetBibtex(string const & dbase, string const & style,
89 Inset * Clone() const {
90 return new InsetBibtex(getCmdName(), getOptions(), 0);
93 Inset::Code LyxCode() const
95 return Inset::BIBTEX_CODE;
98 string getScreenLabel() const;
100 void Edit(BufferView *, int x, int y, unsigned int button);
102 int Latex(std::ostream &, bool fragile, bool freespace) const;
104 std::vector< std::pair<string,string> > getKeys() const;
106 EDITABLE Editable() const {
110 bool addDatabase(string const &);
112 bool delDatabase(string const &);
114 bool display() const { return true; }
123 mutable Buffer * owner;