]> git.lyx.org Git - lyx.git/blobdiff - src/insets/inset.h
ws changes only
[lyx.git] / src / insets / inset.h
index 4ccb05d740b4dc0011dcc1d06e73c7dc6755fa51..5e8cd824bebe4164aba96be15b437dad298c9b1a 100644 (file)
 #ifndef INSETOLD_H
 #define INSETOLD_H
 
-#include "LColor.h"
 #include "insetbase.h"
 #include "dimension.h"
-#include "support/types.h"
+#include "ParagraphList_fwd.h"
 
-#include <vector>
 
-class LyXFont;
 class Buffer;
-class Painter;
+class LColor_color;
+class FuncRequest;
 class LatexRunParams;
-class LyXText;
+class LyXCursor;
+class LyXFont;
 class LyXLex;
+class LyXText;
+class Painter;
 class Paragraph;
-class LyXCursor;
-class FuncRequest;
-class WordLangTuple;
-class ParagraphList;
 class UpdatableInset;
+class WordLangTuple;
 
 namespace lyx {
 namespace graphics {
@@ -133,7 +131,9 @@ public:
                ///
                NEWLINE_CODE,
                ///
-               BRANCH_CODE
+               BRANCH_CODE,
+               ///
+               BOX_CODE
        };
 
        ///
@@ -152,9 +152,6 @@ public:
                HIGHLY_EDITABLE
        };
 
-       ///
-       typedef dispatch_result RESULT;
-
        ///
        InsetOld();
        ///
@@ -166,7 +163,7 @@ public:
        ///
        int width() const;
        /// what appears in the minibuffer when opening
-       virtual string const editMessage() const;
+       virtual std::string const editMessage() const;
        ///
        virtual EDITABLE editable() const;
        ///
@@ -199,17 +196,17 @@ public:
        virtual bool directWrite() const;
 
        ///
-       void setInsetName(string const & s) { name_ = s; }
+       void setInsetName(std::string const & s) { name_ = s; }
        ///
-       string const & getInsetName() const { return name_; }
+       std::string const & getInsetName() const { return name_; }
        ///
        void setOwner(UpdatableInset * inset) { owner_ = inset; }
        ///
        UpdatableInset * owner() const { return owner_; }
        ///
-       void setBackgroundColor(LColor::color);
+       void setBackgroundColor(LColor_color);
        ///
-       LColor::color backgroundColor() const;
+       LColor_color backgroundColor() const;
        ///
        int x() const { return top_x; }
        ///
@@ -300,15 +297,6 @@ public:
         *  defaults to empty.
         */
        virtual void addPreview(lyx::graphics::PreviewLoader &) const {}
-
-       /** Find the PreviewLoader, add a LaTeX snippet to it and
-        *  start the loading process.
-        *
-        *  Most insets have no interest in this capability, so the method
-        *  defaults to empty.
-        */
-       virtual void generatePreview() const {}
-
 protected:
        ///
        mutable int top_x;
@@ -327,9 +315,23 @@ private:
        ///
        UpdatableInset * owner_;
        ///
-       string name_;
-       ///
-       LColor::color background_color_;
+       std::string name_;
+       /** We store the LColor::color value as an int to get LColor.h out
+        *  of the header file.
+        */
+       int background_color_;
+};
+
+
+/** \c InsetOld_code is a wrapper for InsetOld::Code.
+ *  It can be forward-declared and passed as a function argument without
+ *  having to expose inset.h.
+ */
+class InsetOld_code {
+       InsetOld::Code val_;
+public:
+       InsetOld_code(InsetOld::Code val) : val_(val) {}
+       operator InsetOld::Code() const{ return val_; }
 };