]> git.lyx.org Git - lyx.git/blob - src/insets/InsetBibtex.h
Don't add localswitch if no language 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 #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         ~InsetBibtex();
34
35         ///
36         docstring_list 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         InsetCode lyxCode() const { return BIBTEX_CODE; }
52         ///
53         DisplayType display() const { return AlignCenter; }
54         ///
55         void latex(otexstream &, OutputParams const &) const;
56         ///
57         int plaintext(odocstringstream & ods, OutputParams const & op,
58                       size_t max_length = INT_MAX) const;
59         ///
60         void collectBibKeys(InsetIterator const &, support::FileNameList &) const;
61         ///
62         void validate(LaTeXFeatures &) const;
63         ///
64         docstring xhtml(XHTMLStream &, OutputParams const &) const;
65         ///
66         std::string contextMenuName() const;
67         //@}
68
69         /// \name Static public methods obligated for InsetCommand derived classes
70         //@{
71         ///
72         static ParamInfo const & findInfo(std::string const &);
73         ///
74         static std::string defaultCommand() { return "bibtex"; }
75         ///
76         static bool isCompatibleCommand(std::string const & s)
77                 { return s == "bibtex"; }
78         //@}
79
80 private:
81         ///
82         void editDatabases() const;
83         ///
84         void parseBibTeXFiles(support::FileNameList &) const;
85         ///
86         bool usingBiblatex() const;
87
88         /// \name Private functions inherited from Inset class
89         //@{
90         ///
91         bool getStatus(Cursor & cur, FuncRequest const & cmd,
92                 FuncStatus & flag) const;
93         ///
94         void doDispatch(Cursor & cur, FuncRequest & cmd);
95         ///
96         Inset * clone() const { return new InsetBibtex(*this); }
97         //@}
98
99         /// \name Private functions inherited from InsetCommand class
100         //@{
101         ///
102         docstring screenLabel() const;
103         //@}
104 };
105
106
107 } // namespace lyx
108
109 #endif // INSET_BIBTEX_H