]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCollapsable.h
More headers.
[lyx.git] / src / insets / InsetCollapsable.h
index c507cda475f0030d862d9c877b6be800982ad826..22ca612f3ba32d021aa3a00099b88796a3173374 100644 (file)
@@ -15,7 +15,6 @@
 #define INSETCOLLAPSABLE_H
 
 #include "Inset.h"
-#include "InsetLayout.h"
 #include "InsetText.h"
 
 #include "Box.h"
@@ -47,21 +46,28 @@ public:
                );
        ///
        InsetCollapsable(InsetCollapsable const & rhs);
-       
+       ///
        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"); }
+       ///
        InsetLayout const & getLayout(BufferParams const &) const
-       { return *layout_; } 
+               { return *layout_; } 
+       ///
        InsetLayout const & getLayout() const
-       { return *layout_; } 
+               { return *layout_; } 
        ///
        void setLayout(BufferParams const &);
        /// (Re-)set the character style parameters from \p tc according
        /// to name()
        void setLayout(TextClassPtr tc);
        ///
+       virtual bool useEmptyLayout() { return true; }
+       ///
        void read(Buffer const &, Lexer &);
        ///
        void write(Buffer const &, std::ostream &) const;
@@ -72,7 +78,8 @@ public:
 
        /// 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;
+       ///
+       bool boundary, int & x, int & y) const;
        ///
        bool hitButton(FuncRequest const &) const;
        ///
@@ -103,7 +110,7 @@ public:
         *   -------------+-------------------------------
         *   Classic      | *) TopButton, <--x) ButtonOnly
         *                | LeftButton
-        *   Minimalistic | ButtonOnly          NoButton
+        *   Minimalistic | NoButton            ButtonOnly
         *   Conglomerate | SubLabel            Corners
         *   ---------------------------------------------
         *   *) toggled by openinlined_
@@ -142,8 +149,8 @@ public:
        ///
        bool setMouseHover(bool mouse_hover);
        ///
-       virtual ColorCode backgroundColor() const {return layout_->bgcolor; }
-
+       virtual ColorCode backgroundColor() const {return layout_->bgcolor(); }
+       ///
        int latex(Buffer const &, odocstream &,
                  OutputParams const &) const;
        ///
@@ -152,17 +159,22 @@ public:
        virtual InsetCode lyxCode() const { return COLLAPSABLE_CODE; }
 
        /// Allow multiple blanks
-       virtual bool isFreeSpacing() const { return layout_->freespacing; }
+       virtual bool isFreeSpacing() const { return layout_->isFreeSpacing(); }
        /// Don't eliminate empty paragraphs
-       virtual bool allowEmpty() const { return layout_->keepempty; }
+       virtual bool allowEmpty() const { return layout_->isKeepEmpty(); }
        /// Force inset into LTR environment if surroundings are RTL?
-       virtual bool forceLTR() const { return layout_->forceltr; }
-
+       virtual bool forceLTR() const { return layout_->isForceLtr(); }
+       ///
+       virtual bool useEmptyLayout() const { return true; }
+       /// 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;
 protected:
        ///
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
        ///
-       void edit(Cursor & cur, bool left);
+       void edit(Cursor & cur, bool front, 
+               EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
        ///
        Inset * editXY(Cursor & cur, int x, int y);
        ///