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