]> git.lyx.org Git - lyx.git/blob - src/insets/InsetBibitem.h
Rename LATEX debug level to OUTFILE and use it for DocBook, HTML, and XML messages.
[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
18
19 namespace lyx {
20
21 /////////////////////////////////////////////////////////////////////////
22 //
23 // InsetBibItem
24 //
25 /////////////////////////////////////////////////////////////////////////
26
27 /// Used to insert bibitem's information (key and label)
28
29 //  Must be automatically inserted as the first object in a
30 //  bibliography paragraph.
31 class InsetBibitem : public InsetCommand
32 {
33 public:
34         ///
35         InsetBibitem(Buffer *, InsetCommandParams const &);
36         ///
37         ~InsetBibitem();
38
39         ///
40         void updateCommand(docstring const & new_key, bool dummy = false);
41
42         /// \name Public functions inherited from Inset class
43         //@{
44         ///
45         InsetCode lyxCode() const override { return BIBITEM_CODE; }
46         ///
47         bool hasSettings() const override { return true; }
48         /// \copydoc Inset::initView()
49         /// verify label and update references.
50         void initView() override;
51         ///
52         bool isLabeled() const override { return true; }
53         ///
54         void read(Lexer & lex) override;
55         ///
56         int plaintext(odocstringstream &, OutputParams const &,
57                       size_t max_length = INT_MAX) const override;
58         ///
59         docstring xhtml(XMLStream &, OutputParams const &) const override;
60         ///
61         void docbook(XMLStream &, OutputParams const &) const override;
62         ///
63         void collectBibKeys(InsetIterator const &, support::FileNameList &) const override;
64         /// update the counter of this inset
65         void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false) override;
66         ///@}
67
68         /// \name Static public methods obligated for InsetCommand derived classes
69         //@{
70         ///
71         static ParamInfo const & findInfo(std::string const &);
72         ///
73         static std::string defaultCommand() { return "bibitem"; }
74         ///
75         static bool isCompatibleCommand(std::string const & s)
76                 { return s == "bibitem"; }
77         ///
78         docstring bibLabel() const;
79         ///@}
80
81 private:
82         /// \name Private functions inherited from Inset class
83         //@{
84         ///
85         void doDispatch(Cursor & cur, FuncRequest & cmd) override;
86         ///
87         Inset * clone() const override { return new InsetBibitem(*this); }
88         /// Is the content of this inset part of the immediate (visible) text sequence?
89         bool isPartOfTextSequence() const override { return false; }
90         ///@}
91
92         /// \name Private functions inherited from InsetCommand class
93         //@{
94         ///
95         docstring screenLabel() const override;
96         //@}
97
98         friend docstring bibitemWidest(Buffer const & buffer, OutputParams const &);
99
100         /// The label that is set by updateBuffer
101         docstring autolabel_;
102         ///
103         static int key_counter;
104 };
105
106
107 /// Return the widest label in the Bibliography.
108 docstring bibitemWidest(Buffer const &, OutputParams const &);
109
110
111 } // namespace lyx
112
113 #endif // INSET_BIBITEM_H