]> git.lyx.org Git - lyx.git/blob - src/insets/InsetBibtex.h
Fix GRAPHICS_EDIT of InsetGraphics
[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         void setBuffer(Buffer & buffer);
31         ///
32         docstring screenLabel() const;
33         ///
34         EDITABLE editable() const { return IS_EDITABLE; }
35         ///
36         InsetCode lyxCode() const { return BIBTEX_CODE; }
37         ///
38         DisplayType display() const { return AlignCenter; }
39         ///
40         int latex(odocstream &, OutputParams const &) const;
41         ///
42         void fillWithBibKeys(BiblioInfo &, InsetIterator const &) const;
43         ///
44         EmbeddedFileList embeddedFiles() const;
45         ///
46         bool addDatabase(std::string const &);
47         ///
48         bool delDatabase(std::string const &);
49         ///
50         void validate(LaTeXFeatures &) const;
51         ///
52         static ParamInfo 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         /// create bibfiles_ from params bibfiles and embed
59         /**
60                 \param bibfiles comma separated bib files
61                 \param embed comma separated embed status
62         */
63         void createBibFiles(docstring const & bibfiles, docstring const & embed) const;
64         /// update bibfiles and embed from bibfiles_
65         void updateParam();
66 private:
67         ///
68         void registerEmbeddedFiles(EmbeddedFileList &) const;
69         ///
70         void updateEmbeddedFile(EmbeddedFile const & file);
71         /// embedded bib files
72         mutable EmbeddedFileList bibfiles_;
73         ///
74         void doDispatch(Cursor & cur, FuncRequest & cmd);
75         ///
76         Inset * clone() const { return new InsetBibtex(*this); }
77 };
78
79
80 } // namespace lyx
81
82 #endif // INSET_BIBTEX_H