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 /** Used to insert citations
25 class InsetCitation: public InsetCommand {
28 InsetCitation() : InsetCommand("cite") {}
31 InsetCitation(string const & key, string const & note = string());
35 Inset * Clone() const {
36 return new InsetCitation(contents, options);
39 string getScreenLabel()const;
41 void Edit(BufferView *, int x, int y, unsigned int button);
43 EDITABLE Editable() const {
46 int Ascii(std::ostream &) const;
49 InsetCitation * inset;
59 /** Used to insert bibitem's information (key and label)
61 Must be automatically inserted as the first object in a
62 bibliography paragraph.
64 class InsetBibKey: public InsetCommand {
67 InsetBibKey() : InsetCommand("bibitem") { counter = 1; }
70 InsetBibKey(string const & key, string const & label = string());
73 InsetBibKey(InsetBibKey const *);
77 Inset * Clone() const { return new InsetBibKey(this); }
78 /// Currently \bibitem is used as a LyX2.x command, so we need this method.
79 void Write(std::ostream &) const;
81 virtual string getScreenLabel() const;
83 void Edit(BufferView *, int x, int y, unsigned int button);
85 EDITABLE Editable() const {
88 /// A user can't neither insert nor delete this inset
89 bool Deletable() const {
95 int getCounter() const { return counter; }
111 /** Used to insert BibTeX's information
113 class InsetBibtex: public InsetCommand {
116 InsetBibtex() : InsetCommand("BibTeX") { owner = 0; }
118 InsetBibtex(string const & dbase, string const & style,
124 Inset * Clone() const {
125 return new InsetBibtex(contents, options, 0);
128 Inset::Code LyxCode() const
130 return Inset::BIBTEX_CODE;
133 string getScreenLabel() const;
135 void Edit(BufferView *, int x, int y, unsigned int button);
137 int Latex(std::ostream &, bool fragile, bool freespace) const;
139 string getKeys(char delim);
141 EDITABLE Editable() const {
145 bool addDatabase(string const &);
147 bool delDatabase(string const &);
149 bool display() const { return true; }
158 mutable Buffer * owner;