]> git.lyx.org Git - lyx.git/blob - src/insets/insetbibtex.h
The markDirty() and fitCursor() changes
[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         /// small wrapper for the time being
34         virtual dispatch_result localDispatch(FuncRequest const & cmd);
35         ///
36         string const getScreenLabel(Buffer const *) const;
37         ///
38         EDITABLE editable() const { return IS_EDITABLE; }
39         ///
40         Inset::Code lyxCode() const { return Inset::BIBTEX_CODE; }
41         ///
42         void edit(BufferView *, int x, int y, mouse_button::state button);
43         ///
44         void edit(BufferView * bv, bool front = true);
45         ///
46         int latex(Buffer const *, std::ostream &,
47                   bool fragile, bool freespace) const;
48         ///
49         void fillWithBibKeys(Buffer const *,
50                 std::vector<std::pair<string,string> > &) const;
51         ///
52         std::vector<string> const getFiles(Buffer const &) const;
53         ///
54         bool addDatabase(string const &);
55         ///
56         bool delDatabase(string const &);
57         ///
58         bool display() const { return true; }
59         ///
60         struct Holder {
61                 InsetBibtex * inset;
62                 BufferView * view;
63         };
64
65 private:
66         ///
67         Holder holder;
68 };
69
70 #endif // INSET_BIBTEX_H