]> git.lyx.org Git - lyx.git/blob - src/insets/InsetBibtex.h
3711c390984e9d6740ae53a27f80850266939169
[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 "BiblioInfo.h"
16 #include "EmbeddedFiles.h"
17 #include "InsetCommand.h"
18
19 #include <map>
20
21 namespace lyx {
22
23
24 /** Used to insert BibTeX's information
25   */
26 class InsetBibtex : public InsetCommand {
27 public:
28         ///
29         InsetBibtex(InsetCommandParams const &);
30         ///
31         virtual void setBuffer(Buffer & buffer);
32         ///
33         docstring screenLabel() const;
34         ///
35         EDITABLE editable() const { return IS_EDITABLE; }
36         ///
37         InsetCode lyxCode() const { return BIBTEX_CODE; }
38         ///
39         DisplayType display() const { return AlignCenter; }
40         ///
41         int latex(odocstream &, OutputParams const &) const;
42         ///
43         void fillWithBibKeys(BiblioInfo &, InsetIterator const &) const;
44         ///
45         EmbeddedFileList const & getBibFiles() const;
46         ///
47         bool addDatabase(docstring const &);
48         ///
49         bool delDatabase(docstring const &);
50         ///
51         void validate(LaTeXFeatures &) const;
52         ///
53         static ParamInfo const & findInfo(std::string const &);
54         ///
55         static std::string defaultCommand() { return "bibtex"; };
56         ///
57         static bool isCompatibleCommand(std::string const & s) 
58                 { return s == "bibtex"; }
59         /// create bibfiles_ from params bibfiles and embed
60         /**
61                 \param bibfiles comma separated bib files
62                 \param embed comma separated embed status
63         */
64         void createBibFiles(docstring const & bibfiles, docstring const & embed) const;
65         /// update bibfiles and embed from bibfiles_
66         void updateParam();
67 private:
68         ///
69         void registerEmbeddedFiles(EmbeddedFileList &) const;
70         ///
71         void updateEmbeddedFile(EmbeddedFile const & file);
72         ///
73         void doDispatch(Cursor & cur, FuncRequest & cmd);
74         ///
75         Inset * clone() const { return new InsetBibtex(*this); }
76         /// embedded bib files
77         mutable EmbeddedFileList bibfiles_;
78 };
79
80
81 } // namespace lyx
82
83 #endif // INSET_BIBTEX_H