#include "TextClass.h"
#include "Box.h"
-#include "Font.h"
#include <string>
namespace lyx {
-class Text;
-class Paragraph;
class CursorSlice;
+class FontInfo;
class InsetLayout;
+class Paragraph;
+class Text;
namespace frontend { class Painter; }
*/
class InsetCollapsable : public InsetText {
public:
- ///
- static int const TEXT_TO_TOP_OFFSET = 2;
- ///
- static int const TEXT_TO_BOTTOM_OFFSET = 2;
///
InsetCollapsable(BufferParams const &, CollapseStatus status = Inset::Open);
///
InsetCollapsable(InsetCollapsable const & rhs);
- ///
+
+ InsetCollapsable * asInsetCollapsable() { return this; }
+ InsetCollapsable const * asInsetCollapsable() const { return this; }
docstring name() const { return from_ascii("Collapsable"); }
///
void setLayout(BufferParams const &);
///
void write(Buffer const &, std::ostream &) const;
///
- bool metrics(MetricsInfo &, Dimension &) const;
+ void metrics(MetricsInfo &, Dimension &) const;
///
void draw(PainterInfo & pi, int x, int y) const;
- ///
- void drawSelection(PainterInfo & pi, int x, int y) const;
+
/// return x,y of given position relative to the inset's baseline
void cursorPos(BufferView const & bv, CursorSlice const & sl,
bool boundary, int & x, int & y) const;
///
virtual void setButtonLabel() {}
///
- void setLabelFont(Font const & f);
- ///
bool isOpen() const { return geometry() != ButtonOnly; }
///
- bool inlined() const { return decoration() == Minimalistic|| decoration() == Conglomerate; }
- ///
CollapseStatus status() const;
/** Of the old CollapseStatus we only keep the values
* Open and Collapsed.
* -------------+-------------------------------
* Classic | *) TopButton, <--x) ButtonOnly
* | LeftButton
- * Minimalistic | NoButton NoButton
+ * Minimalistic | ButtonOnly NoButton
* Conglomerate | SubLabel Corners
* ---------------------------------------------
* *) toggled by openinlined_
///
bool allowSpellCheck() const { return true; }
///
+ bool allowMultiPar() const;
+ ///
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
///
void setStatus(Cursor & cur, CollapseStatus st);
///
bool setMouseHover(bool mouse_hover);
///
- virtual Color_color backgroundColor() const {return layout_.bgcolor; }
+ virtual ColorCode backgroundColor() const {return layout_.bgcolor; }
int latex(Buffer const &, odocstream &,
OutputParams const &) const;
///
void validate(LaTeXFeatures &) const;
+ ///
+ virtual InsetCode lyxCode() const { return COLLAPSABLE_CODE; }
+
+ /// Allow multiple blanks
+ virtual bool isFreeSpacing() const { return layout_.freespacing; }
+ /// Don't eliminate empty paragraphs
+ virtual bool allowEmpty() const { return layout_.keepempty; }
protected:
///
Inset * editXY(Cursor & cur, int x, int y);
///
docstring floatName(std::string const & type, BufferParams const &) const;
+ ///
+ virtual void resetParagraphsFont();
protected:
///
mutable bool openinlined_;
/// the inset will automatically open when the cursor is inside
mutable bool autoOpen_;
- ///
- mutable Dimension textdim_;
/// changes color when mouse enters/leaves this inset
bool mouse_hover_;
};