]> git.lyx.org Git - lyx.git/blob - src/insets/InsetBibtex.h
Change cursor shape for clickable math insets
[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 #include "InsetCommand.h"
16
17 namespace lyx {
18
19 class docstring_list;
20
21 namespace support {
22         class FileName;
23 } // namespace support
24
25 /** Used to insert BibTeX's information
26   */
27 class InsetBibtex : public InsetCommand {
28 public:
29         ///
30         InsetBibtex(Buffer *, InsetCommandParams const &);
31
32         ///
33         docstring_list getBibFiles() const;
34         ///
35         bool addDatabase(docstring const &);
36         ///
37         bool delDatabase(docstring const &);
38         ///
39         void write(std::ostream &) const override;
40
41         /// \name Public functions inherited from Inset class
42         //@{
43         ///
44         docstring toolTip(BufferView const & bv, int x, int y) const override;
45         ///
46         bool hasSettings() const override { return true; }
47         ///
48         InsetCode lyxCode() const override { return BIBTEX_CODE; }
49         ///
50         RowFlags rowFlags() const override { return Display; }
51         ///
52         void latex(otexstream &, OutputParams const &) const override;
53         ///
54         int plaintext(odocstringstream & ods, OutputParams const & op,
55                       size_t max_length = INT_MAX) const override;
56         ///
57         void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false) override;
58         ///
59         void addToToc(DocIterator const & di, bool output_active,
60                                   UpdateType utype, TocBackend & backend) const override;
61         ///
62         void collectBibKeys(InsetIterator const &, support::FileNameList &) const override;
63         ///
64         void validate(LaTeXFeatures &) const override;
65         ///
66         docstring xhtml(XMLStream &, OutputParams const &) const override;
67         ///
68         void docbook(XMLStream &, OutputParams const &) const override;
69         ///
70         std::string contextMenuName() const override;
71         //@}
72
73         /// \name Static public methods obligated for InsetCommand derived classes
74         //@{
75         ///
76         static ParamInfo const & findInfo(std::string const &);
77         ///
78         static std::string defaultCommand() { return "bibtex"; }
79         ///
80         static bool isCompatibleCommand(std::string const & s)
81                 { return s == "bibtex"; }
82         //@}
83
84 private:
85         ///
86         void editDatabases(docstring const & db = docstring()) const;
87         ///
88         void parseBibTeXFiles(support::FileNameList &) const;
89         ///
90         bool usingBiblatex() const;
91         ///
92         docstring getRefLabel() const;
93         ///
94         std::map<std::string, std::string> getFileEncodings() const;
95
96         /// \name Private functions inherited from Inset class
97         //@{
98         ///
99         bool getStatus(Cursor & cur, FuncRequest const & cmd,
100                 FuncStatus & flag) const override;
101         ///
102         void doDispatch(Cursor & cur, FuncRequest & cmd) override;
103         ///
104         Inset * clone() const override { return new InsetBibtex(*this); }
105         //@}
106
107         /// \name Private functions inherited from InsetCommand class
108         //@{
109         ///
110         docstring screenLabel() const override;
111         //@}
112 };
113
114
115 } // namespace lyx
116
117 #endif // INSET_BIBTEX_H