]> git.lyx.org Git - features.git/blob - src/insets/InsetBibtex.h
Add possibility for command inset to inherit enclosing font
[features.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
21 namespace support {
22         class FileName;
23         class FileNamePairList;
24 }
25
26 /** Used to insert BibTeX's information
27   */
28 class InsetBibtex : public InsetCommand {
29 public:
30         ///
31         InsetBibtex(Buffer *, InsetCommandParams const &);
32         ///
33         ~InsetBibtex();
34
35         ///
36         support::FileNamePairList getBibFiles() const;
37         ///
38         bool addDatabase(docstring const &);
39         ///
40         bool delDatabase(docstring const &);
41         ///
42         void write(std::ostream &) const;
43
44         /// \name Public functions inherited from Inset class
45         //@{
46         ///
47         docstring toolTip(BufferView const & bv, int x, int y) const;
48         ///
49         bool hasSettings() const { return true; }
50         ///
51         bool inheritFont() const { return true; }
52         ///
53         InsetCode lyxCode() const { return BIBTEX_CODE; }
54         ///
55         DisplayType display() const { return AlignCenter; }
56         ///
57         void latex(otexstream &, OutputParams const &) const;
58         ///
59         int plaintext(odocstringstream & ods, OutputParams const & op,
60                       size_t max_length = INT_MAX) const;
61         ///
62         void collectBibKeys(InsetIterator const &) const;
63         ///
64         void validate(LaTeXFeatures &) const;
65         ///
66         docstring xhtml(XHTMLStream &, OutputParams const &) const;
67         ///
68         std::string contextMenuName() const;
69         //@}
70
71         /// \name Static public methods obligated for InsetCommand derived classes
72         //@{
73         ///
74         static ParamInfo const & findInfo(std::string const &);
75         ///
76         static std::string defaultCommand() { return "bibtex"; }
77         ///
78         static bool isCompatibleCommand(std::string const & s)
79                 { return s == "bibtex"; }
80         //@}
81
82 private:
83         /// look up the path to the file using TeX
84         static support::FileName
85                 getBibTeXPath(docstring const & filename, Buffer const & buf);
86         ///
87         void editDatabases() const;
88         ///
89         void parseBibTeXFiles() const;
90         ///
91         bool usingBiblatex() const;
92
93         /// \name Private functions inherited from Inset class
94         //@{
95         ///
96         bool getStatus(Cursor & cur, FuncRequest const & cmd,
97                 FuncStatus & flag) const;
98         ///
99         void doDispatch(Cursor & cur, FuncRequest & cmd);
100         ///
101         Inset * clone() const { return new InsetBibtex(*this); }
102         //@}
103
104         /// \name Private functions inherited from InsetCommand class
105         //@{
106         ///
107         docstring screenLabel() const;
108         //@}
109 };
110
111
112 } // namespace lyx
113
114 #endif // INSET_BIBTEX_H