4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
15 #include "InsetText.h"
16 #include "RenderButton.h"
19 #include "support/Translator.h"
23 /** Used to insert index labels
25 class InsetInfo : public InsetText {
28 UNKNOWN_INFO, // Invalid type
29 SHORTCUT_INFO, // Keyboard shortcut
30 PACKAGE_INFO, // Availability of package
31 TEXTCLASS_INFO, // Availability of textclass
32 MENU_INFO, // Which menu item is used for certain function
36 InsetInfo(BufferParams const & bp, std::string const & info = std::string());
38 Inset * editXY(Cursor & cur, int x, int y);
40 EDITABLE editable() const { return NOT_EDITABLE; }
42 void draw(PainterInfo & pi, int x, int y) const;
44 void read(Buffer const &, Lexer & lex);
46 void write(Buffer const & buf, std::ostream & os) const;
48 void doDispatch(Cursor & cur, FuncRequest & cmd);
50 Inset::Code lyxCode() const { return Inset::INFO_CODE; }
52 void setInfo(std::string const & info);
54 bool setMouseHover(bool mouse_hover);
57 /// The translator between the information type enum and corresponding string.
58 Translator<info_type, std::string> const & nameTranslator() const;
59 /// update info_ and text
62 virtual Inset * clone() const { return new InsetInfo(*this); }
67 /// store the buffer parameter
68 BufferParams const & bp_;