#include "Box.h"
#include "TextClass.h"
-#include "TextClassPtr.h"
-
-#include <string>
namespace lyx {
class CursorSlice;
-class FontInfo;
class InsetLayout;
-class Paragraph;
-class Text;
namespace frontend { class Painter; }
class InsetCollapsable : public InsetText {
public:
///
- InsetCollapsable(
- BufferParams const &,
- CollapseStatus status = Inset::Open,
- TextClassPtr tc = 0
- );
+ InsetCollapsable(Buffer const &,
+ CollapseStatus status = Inset::Open, DocumentClass * tc = 0);
///
InsetCollapsable(InsetCollapsable const & rhs);
///
///
docstring name() const { return from_ascii("Collapsable"); }
///
- InsetLayout const & getLayout(BufferParams const &) const
- { return *layout_; }
+ InsetLayout const & getLayout(BufferParams const &) const { return *layout_; }
///
- InsetLayout const & getLayout() const
- { return *layout_; }
+ InsetLayout const & getLayout() const { return *layout_; }
///
void setLayout(BufferParams const &);
/// (Re-)set the character style parameters from \p tc according
/// to name()
- void setLayout(TextClassPtr tc);
+ void setLayout(DocumentClass const * const tc);
///
virtual bool useEmptyLayout() { return true; }
///
- void read(Buffer const &, Lexer &);
+ void read(Lexer &);
///
- void write(Buffer const &, std::ostream &) const;
+ void write(std::ostream &) const;
///
void metrics(MetricsInfo &, Dimension &) const;
///
/// can we go further down on mouse click?
bool descendable() const;
///
- bool isMacroScope(Buffer const & buf) const;
- ///
void setLabel(docstring const & l);
///
virtual void setButtonLabel() {}
///
bool setMouseHover(bool mouse_hover);
///
- virtual ColorCode backgroundColor() const {return layout_->bgcolor(); }
+ ColorCode backgroundColor() const { return layout_->bgcolor(); }
///
- int latex(Buffer const &, odocstream &,
- OutputParams const &) const;
+ int latex(odocstream &, OutputParams const &) const;
///
void validate(LaTeXFeatures &) const;
///
- virtual InsetCode lyxCode() const { return COLLAPSABLE_CODE; }
+ InsetCode lyxCode() const { return COLLAPSABLE_CODE; }
/// Allow multiple blanks
virtual bool isFreeSpacing() const { return layout_->isFreeSpacing(); }
/// Is this inset's layout defined in the document's textclass?
/// May be wrong after textclass change or paste from another document
bool undefined() const;
+ ///
+ virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
protected:
///
- virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
+ void doDispatch(Cursor & cur, FuncRequest & cmd);
///
void edit(Cursor & cur, bool front,
EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
virtual void resetParagraphsFont();
private:
- /// text class to keep the InsetLayout above in memory
- /// FIXME This probably isn't needed now
- TextClassPtr textClass_;
- /// cache for the layout_. Make sure it is in sync with the text class!
+ /// cache for the layout_. Make sure it is in sync with the document class!
InsetLayout const * layout_;
///
Dimension dimensionCollapsed() const;