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