]> git.lyx.org Git - lyx.git/blob - src/insets/insetbibtex.h
Hold on to your hats.
[lyx.git] / src / insets / insetbibtex.h
1 // -*- C++ -*-
2 /**
3  * \file insetbibtex.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Alejandro Aguilar Sierra
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef INSET_BIBTEX_H
13 #define INSET_BIBTEX_H
14
15
16 #include <vector>
17 #include "insetcommand.h"
18
19 class Buffer;
20
21 /** Used to insert BibTeX's information
22   */
23 class InsetBibtex : public InsetCommand {
24 public:
25         ///
26         InsetBibtex(InsetCommandParams const &, bool same_id = false);
27         ///
28         ~InsetBibtex();
29         ///
30         Inset * clone(Buffer const &, bool same_id = false) const {
31                 return new InsetBibtex(params(), same_id);
32         }
33         ///
34         string const getScreenLabel(Buffer const *) const;
35         ///
36         EDITABLE editable() const { return IS_EDITABLE; }
37         ///
38         Inset::Code lyxCode() const { return Inset::BIBTEX_CODE; }
39         ///
40         void edit(BufferView *, int x, int y, mouse_button::state button);
41         ///
42         void edit(BufferView * bv, bool front = true);
43         ///
44         int latex(Buffer const *, std::ostream &,
45                   bool fragile, bool freespace) const;
46         ///
47         void fillWithBibKeys(Buffer const *,
48                 std::vector<std::pair<string,string> > &) const;
49         ///
50         std::vector<string> const getFiles(Buffer const &) const;
51         ///
52         bool addDatabase(string const &);
53         ///
54         bool delDatabase(string const &);
55         ///
56         bool display() const { return true; }
57         ///
58         struct Holder {
59                 InsetBibtex * inset;
60                 BufferView * view;
61         };
62
63 private:
64         ///
65         Holder holder;
66 };
67
68 #endif // INSET_BIBTEX_H