]> git.lyx.org Git - lyx.git/blob - src/insets/InsetBibtex.h
This should be the last of the commits refactoring the InsetLayout code.
[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 <map>
16 #include "InsetCommand.h"
17 #include "BiblioInfo.h"
18
19 namespace lyx {
20
21 class EmbeddedFileList;
22
23
24 /** Used to insert BibTeX's information
25   */
26 class InsetBibtex : public InsetCommand {
27 public:
28         ///
29         InsetBibtex(InsetCommandParams const &);
30         ///
31         docstring const getScreenLabel(Buffer const &) const;
32         ///
33         EDITABLE editable() const { return IS_EDITABLE; }
34         ///
35         InsetCode lyxCode() const { return BIBTEX_CODE; }
36         ///
37         DisplayType display() const { return AlignCenter; }
38         ///
39         int latex(Buffer const &, odocstream &, OutputParams const &) const;
40         ///
41         virtual void fillWithBibKeys(Buffer const &,
42                 BiblioInfo &, InsetIterator const &) const;
43         ///
44         EmbeddedFileList const getFiles(Buffer const &) const;
45         ///
46         bool addDatabase(std::string const &);
47         ///
48         bool delDatabase(std::string const &);
49         ///
50         void validate(LaTeXFeatures &) const;
51         ///
52         static CommandInfo const * findInfo(std::string const &);
53         ///
54         static std::string defaultCommand() { return "bibtex"; };
55         ///
56         static bool isCompatibleCommand(std::string const & s) 
57                 { return s == "bibtex"; }
58         ///
59         void registerEmbeddedFiles(Buffer const &, EmbeddedFileList &) const;
60         ///
61         void updateEmbeddedFile(Buffer const & buf, EmbeddedFile const & file);
62         
63 protected:
64         virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
65 private:
66         virtual Inset * clone() const;
67
68 };
69
70
71 } // namespace lyx
72
73 #endif // INSET_BIBTEX_H