]> git.lyx.org Git - lyx.git/blob - src/insets/InsetBibitem.h
Fix GRAPHICS_EDIT of InsetGraphics
[lyx.git] / src / insets / InsetBibitem.h
1 // -*- C++ -*-
2 /**
3  * \file InsetBibitem.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_BIBITEM_H
13 #define INSET_BIBITEM_H
14
15
16 #include "InsetCommand.h"
17 #include "BiblioInfo.h"
18
19
20 namespace lyx {
21
22 /** Used to insert bibitem's information (key and label)
23
24   Must be automatically inserted as the first object in a
25   bibliography paragraph.
26   */
27 class InsetBibitem : public InsetCommand {
28 public:
29         ///
30         InsetBibitem(InsetCommandParams const &);
31         /// verify label and update references.
32         /**
33           * Overloaded from Inset::initView.
34           **/
35         void initView();
36         ///
37         bool isLabeled() const { return true; }
38         ///
39         void read(Lexer & lex);
40         ///
41         docstring screenLabel() const;
42         ///
43         EDITABLE editable() const { return IS_EDITABLE; }
44         ///
45         InsetCode lyxCode() const { return BIBITEM_CODE; }
46         ///
47         docstring bibLabel() const;
48         ///
49         int plaintext(odocstream &, OutputParams const &) const;
50         ///
51         virtual void fillWithBibKeys(BiblioInfo &, InsetIterator const &) const;
52         /// Update the counter of this inset
53         virtual void updateLabels(ParIterator const &);
54         ///
55         static ParamInfo const & findInfo(std::string const &);
56         ///
57         static std::string defaultCommand() { return "bibitem"; };
58         ///
59         static bool isCompatibleCommand(std::string const & s) 
60                 { return s == "bibitem"; }
61         ///
62         void updateCommand(docstring const & new_key, bool dummy = false);
63 protected:
64         ///
65         virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
66 private:
67         ///
68         virtual Inset * clone() const { return new InsetBibitem(*this); }
69         /// The label that is set by updateLabels
70         docstring autolabel_;
71         ///
72         static int key_counter;
73 };
74
75
76 /// Return the widest label in the Bibliography.
77 docstring const bibitemWidest(Buffer const &);
78
79
80 } // namespace lyx
81
82 #endif // INSET_BIBITEM_H