]> git.lyx.org Git - lyx.git/blob - src/insets/InsetBibitem.h
Well, it turns out that we need a different return value for the xhtml
[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 #include "BiblioInfo.h"
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 const &, InsetCommandParams const &);
36         ///
37         virtual ~InsetBibitem();
38         ///
39         static ParamInfo const & findInfo(std::string const &);
40         ///
41         static std::string defaultCommand() { return "bibitem"; }
42         ///
43         static bool isCompatibleCommand(std::string const & s) 
44                 { return s == "bibitem"; }
45 private:
46         /// verify label and update references.
47         /// Overloaded from Inset::initView.
48         void initView();
49         ///
50         bool isLabeled() const { return true; }
51         ///
52         void read(Lexer & lex);
53         ///
54         docstring screenLabel() const;
55         ///
56         bool hasSettings() const { return true; }
57         ///
58         InsetCode lyxCode() const { return BIBITEM_CODE; }
59         ///
60         docstring bibLabel() const;
61         ///
62         int plaintext(odocstream &, OutputParams const &) const;
63         ///
64         docstring xhtml(odocstream &, OutputParams const &) const;
65         ///
66         virtual void fillWithBibKeys(BiblioInfo &, InsetIterator const &) const;
67         /// Update the counter of this inset
68         virtual void updateLabels(ParIterator const &);
69         ///
70         void updateCommand(docstring const & new_key, bool dummy = false);
71         ///
72         void doDispatch(Cursor & cur, FuncRequest & cmd);
73         ///
74         Inset * clone() const { return new InsetBibitem(*this); }
75
76         friend docstring bibitemWidest(Buffer const & buffer);
77         /// The label that is set by updateLabels
78         docstring autolabel_;
79         ///
80         static int key_counter;
81 };
82
83
84 /// Return the widest label in the Bibliography.
85 docstring bibitemWidest(Buffer const &);
86
87 } // namespace lyx
88
89 #endif // INSET_BIBITEM_H