]> git.lyx.org Git - lyx.git/blob - src/insets/InsetBibtex.h
Fix bug #6315: counters in insets that don't produce output have ghost values.
[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
21 namespace support {
22         class FileName;
23         class FileNameList;
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::FileNameList getBibFiles() const;
37         ///
38         bool addDatabase(docstring const &);
39         ///
40         bool delDatabase(docstring 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         DisplayType display() const { return AlignCenter; }
52         ///
53         int latex(odocstream &, OutputParams const &) const;
54         ///
55         void fillWithBibKeys(BiblioInfo &, InsetIterator const &) const;
56         ///
57         void validate(LaTeXFeatures &) const;
58         ///
59         docstring xhtml(XHTMLStream &, OutputParams const &) const;
60         ///
61         docstring contextMenu(BufferView const &, int, int) const;
62         //@}
63
64         /// \name Static public methods obligated for InsetCommand derived classes
65         //@{
66         ///
67         static ParamInfo const & findInfo(std::string const &);
68         ///
69         static std::string defaultCommand() { return "bibtex"; }
70         ///
71         static bool isCompatibleCommand(std::string const & s) 
72                 { return s == "bibtex"; }
73         //@}
74
75 private:
76         /// look up the path to the file using TeX
77         static support::FileName 
78                 getBibTeXPath(docstring const & filename, Buffer const & buf);
79         ///
80         void editDatabases() const;
81
82         /// \name Private functions inherited from Inset class
83         //@{
84         ///
85         bool getStatus(Cursor & cur, FuncRequest const & cmd,
86                 FuncStatus & flag) const;
87         ///
88         void doDispatch(Cursor & cur, FuncRequest & cmd);
89         ///
90         Inset * clone() const { return new InsetBibtex(*this); }
91         //@}
92
93         /// \name Private functions inherited from InsetCommand class
94         //@{
95         ///
96         docstring screenLabel() const;
97         //@}
98 };
99
100
101 } // namespace lyx
102
103 #endif // INSET_BIBTEX_H