]> git.lyx.org Git - lyx.git/blobdiff - src/insets/inset.h
Enable convertDefault.sh to run even if its executable bit is not set.
[lyx.git] / src / insets / inset.h
index 8acdb59699fb9b5586a3e1937d396b064065a748..4ccb05d740b4dc0011dcc1d06e73c7dc6755fa51 100644 (file)
@@ -9,7 +9,7 @@
  * \author Lars Gullik Bjønnes
  * \author Matthias Ettrich
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef INSETOLD_H
@@ -51,7 +51,7 @@ public:
            in a cleaner way. */
        enum Code {
                ///
-               NO_CODE,
+               NO_CODE, // 0
                ///
                TOC_CODE,  // do these insets really need a code? (ale)
                ///
@@ -59,9 +59,9 @@ public:
                ///
                MARK_CODE,
                ///
-               REF_CODE, // 5
+               REF_CODE,
                ///
-               URL_CODE,
+               URL_CODE, // 5
                ///
                HTMLURL_CODE,
                ///
@@ -69,9 +69,9 @@ public:
                ///
                ENDING_CODE,
                ///
-               LABEL_CODE, // 10
+               LABEL_CODE,
                ///
-               NOTE_CODE,
+               NOTE_CODE, // 10
                ///
                ACCENT_CODE,
                ///
@@ -79,9 +79,9 @@ public:
                ///
                INDEX_CODE,
                ///
-               INCLUDE_CODE, // 15
+               INCLUDE_CODE,
                ///
-               GRAPHICS_CODE,
+               GRAPHICS_CODE, // 15
                ///
                BIBITEM_CODE,
                ///
@@ -89,9 +89,9 @@ public:
                ///
                TEXT_CODE,
                ///
-               ERT_CODE, // 20
+               ERT_CODE,
                ///
-               FOOT_CODE,
+               FOOT_CODE, // 20
                ///
                MARGIN_CODE,
                ///
@@ -101,9 +101,9 @@ public:
                ///
                MINIPAGE_CODE,
                ///
-               SPACE_CODE,
+               SPACE_CODE, // 25
                ///
-               SPECIALCHAR_CODE, // 25
+               SPECIALCHAR_CODE,
                ///
                TABULAR_CODE,
                ///
@@ -125,13 +125,15 @@ public:
                ///
                INDEX_PRINT_CODE,
                ///
-               OPTARG_CODE,
+               OPTARG_CODE, // 35
                ///
                ENVIRONMENT_CODE,
                ///
                HFILL_CODE,
                ///
-               NEWLINE_CODE
+               NEWLINE_CODE,
+               ///
+               BRANCH_CODE
        };
 
        ///
@@ -176,19 +178,19 @@ public:
        /// wrapper around the above
        bool insetAllowed(InsetOld * in) const;
        ///
-       virtual void write(Buffer const *, std::ostream &) const = 0;
+       virtual void write(Buffer const &, std::ostream &) const = 0;
        ///
-       virtual void read(Buffer const *, LyXLex & lex) = 0;
+       virtual void read(Buffer const &, LyXLex & lex) = 0;
        /// returns the number of rows (\n's) of generated tex code.
-       virtual int latex(Buffer const *, std::ostream &,
+       virtual int latex(Buffer const &, std::ostream &,
                          LatexRunParams const &) const = 0;
        ///
-       virtual int ascii(Buffer const *,
+       virtual int ascii(Buffer const &,
                          std::ostream &, int linelen = 0) const = 0;
        ///
-       virtual int linuxdoc(Buffer const *, std::ostream &) const = 0;
+       virtual int linuxdoc(Buffer const &, std::ostream &) const = 0;
        ///
-       virtual int docbook(Buffer const *, std::ostream &, bool) const = 0;
+       virtual int docbook(Buffer const &, std::ostream &, bool) const = 0;
 
        /// returns LyX code associated with the inset. Used for TOC, ...)
        virtual InsetOld::Code lyxCode() const { return NO_CODE; }
@@ -196,14 +198,6 @@ public:
        /// returns true to override begin and end inset in file
        virtual bool directWrite() const;
 
-       /// Returns true if the inset should be centered alone
-       virtual bool display() const { return false; }
-       /// Changes the display state of the inset
-       virtual void display(bool) {}
-       ///
-       /// returns true if this inset needs a row on it's own
-       ///
-       virtual bool needFullRow() const { return false; }
        ///
        void setInsetName(string const & s) { name_ = s; }
        ///
@@ -213,10 +207,6 @@ public:
        ///
        UpdatableInset * owner() const { return owner_; }
        ///
-       void parOwner(Paragraph * par) { par_owner_ = par; }
-       ///
-       Paragraph * parOwner() const { return par_owner_; }
-       ///
        void setBackgroundColor(LColor::color);
        ///
        LColor::color backgroundColor() const;
@@ -232,8 +222,6 @@ public:
                                     bool recursive = false) const;
        ///
        virtual void deleteLyXText(BufferView *, bool = true) const {}
-       ///
-       virtual void resizeLyXText(BufferView *, bool /*force*/= false) const {}
        /// returns the actuall scroll-value
        virtual int scroll(bool recursive=true) const {
                if (!recursive || !owner_)
@@ -338,8 +326,6 @@ protected:
 private:
        ///
        UpdatableInset * owner_;
-       /// the paragraph in which this inset has been inserted
-       Paragraph * par_owner_;
        ///
        string name_;
        ///
@@ -347,35 +333,17 @@ private:
 };
 
 
-inline
-bool InsetOld::insetAllowed(InsetOld * in) const
-{
-       return insetAllowed(in->lyxCode());
-}
-
-
-inline
-bool InsetOld::checkInsertChar(LyXFont &)
-{
-       return false;
-}
-
 /**
  * returns true if pointer argument is valid
  * and points to an editable inset
  */
-inline bool isEditableInset(InsetOld const * i)
-{
-       return i && i->editable();
-}
+bool isEditableInset(InsetOld const * i);
+
 
 /**
  * returns true if pointer argument is valid
  * and points to a highly editable inset
  */
-inline bool isHighlyEditableInset(InsetOld const * i)
-{
-       return i && i->editable() == InsetOld::HIGHLY_EDITABLE;
-}
+bool isHighlyEditableInset(InsetOld const * i);
 
 #endif