#ifndef INSETCOLLAPSABLE_H
#define INSETCOLLAPSABLE_H
-#include "Inset.h"
#include "InsetText.h"
#include "Box.h"
-#include "TextClass.h"
+
+#include <map>
namespace lyx {
///
InsetCollapsable(InsetCollapsable const & rhs);
///
+ virtual ~InsetCollapsable();
+ ///
InsetCollapsable * asInsetCollapsable() { return this; }
///
InsetCollapsable const * asInsetCollapsable() const { return this; }
///
docstring toolTip(BufferView const & bv, int x, int y) const;
///
- docstring name() const { return from_ascii("Collapsable"); }
+ docstring layoutName() const { return from_ascii("Collapsable"); }
///
void read(Lexer &);
///
bool editable() const;
///
bool hasSettings() const { return true; }
+ ///
+ bool clickable(int x, int y) const;
/// can we go further down on mouse click?
bool descendable(BufferView const & bv) const;
///
/// Default looks
virtual InsetLayout::InsetDecoration decoration() const;
+ /// Inset font
+ virtual FontInfo getFont() const { return getLayout().font(); }
+ /// Label font
+ virtual FontInfo getLabelfont() const { return getLayout().labelfont(); }
///
enum Geometry {
TopButton,
///
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
///
- bool setMouseHover(bool mouse_hover);
+ bool setMouseHover(BufferView const * bv, bool mouse_hover) const;
///
- ColorCode backgroundColor() const { return getLayout().bgcolor(); }
+ ColorCode backgroundColor(PainterInfo const &) const
+ { return getLayout().bgcolor(); }
///
ColorCode labelColor() const { return getLayout().labelfont().color(); }
///
///
virtual bool usePlainLayout() const { return true; }
///
- virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
+ std::string contextMenu(BufferView const & bv, int x, int y) const;
+ ///
+ std::string contextMenuName() const;
+ ///
+ docstring floatName(std::string const & type) const;
protected:
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
///
Inset * editXY(Cursor & cur, int x, int y);
///
- docstring floatName(std::string const & type) const;
- ///
mutable CollapseStatus status_;
private:
///
/// dependent on the bufferview, compare with MathMacro::editing_.
mutable std::map<BufferView const *, bool> auto_open_;
/// changes color when mouse enters/leaves this inset
- bool mouse_hover_;
+ mutable std::map<BufferView const *, bool> mouse_hover_;
};
} // namespace lyx