]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetSpace.h
Restore XHTML output for InsetListings.
[lyx.git] / src / insets / InsetSpace.h
index 7607b0932484663e8a33119932b9d908b865fe6f..5aed4d50e7d346886e46f692b43125670a007009 100644 (file)
@@ -6,8 +6,8 @@
  *
  * \author Asger Alstrup Nielsen
  * \author Jean-Marc Lasgouttes
- * \author Lars Gullik Bjønnes
- * \author Jürgen Spitzmüller
+ * \author Lars Gullik Bjønnes
+ * \author Jürgen Spitzmüller
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -33,16 +33,24 @@ public:
                PROTECTED,
                /// Thin space ('\,')
                THIN,
+               /// Medium space ('\:')
+               MEDIUM,
+               /// Thick space ('\;')
+               THICK,
                /// \quad (1em)
                QUAD,
                /// \qquad (2em)
                QQUAD,
-               /// \enspace (0.5em unbreakable)
+               /// \enskip (0.5em unbreakable)
                ENSPACE,
                /// \enspace (0.5em breakable)
                ENSKIP,
                /// Negative thin space ('\negthinspace')
                NEGTHIN,
+               /// Negative medium space ('\negmedspace')
+               NEGMEDIUM,
+               /// Negative thick space ('\negthickspace')
+               NEGTHICK,
                /// rubber length
                HFILL,
                /// \hspace*{\fill}
@@ -65,7 +73,7 @@ public:
                CUSTOM_PROTECTED
        };
        ///
-       InsetSpaceParams() : kind(NORMAL), length(Length()) {}
+       InsetSpaceParams(bool m = false) : kind(NORMAL), math(m) {}
        ///
        void write(std::ostream & os) const;
        ///
@@ -73,7 +81,12 @@ public:
        ///
        Kind kind;
        ///
-       Length length;
+       GlueLength length;
+       /**
+        * Whether these params are to be used in mathed.
+        * This determines the set of valid kinds.
+        */
+       bool math;
 };
 
 
@@ -82,7 +95,7 @@ class InsetSpace : public Inset
 {
 public:
        ///
-       InsetSpace() {}
+       InsetSpace() : Inset(0) {}
        ///
        explicit InsetSpace(InsetSpaceParams const & par);
        ///
@@ -97,9 +110,8 @@ public:
        ///
        static std::string params2string(InsetSpaceParams const &);
        ///
-       Length length() const;
+       GlueLength length() const;
 
-private:
        ///
        docstring toolTip(BufferView const & bv, int x, int y) const;
        ///
@@ -116,13 +128,14 @@ private:
        int plaintext(odocstream &, OutputParams const &) const;
        ///
        int docbook(odocstream &, OutputParams const &) const;
+       ///
+       docstring xhtml(XHTMLStream &, OutputParams const &) const;
+       ///
+       void validate(LaTeXFeatures & features) const;
        /// the string that is passed to the TOC
        void tocString(odocstream &) const;
        ///
-       void edit(Cursor & cur, bool front,
-               EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
-       ///
-       EDITABLE editable() const { return IS_EDITABLE; }
+       bool hasSettings() const { return true; }
        ///
        InsetCode lyxCode() const { return SPACE_CODE; }
        /// is this an expandible space (rubber length)?
@@ -137,13 +150,18 @@ private:
        bool isSpace() const { return true; }
        ///
        docstring contextMenu(BufferView const & bv, int x, int y) const;
+protected:
        ///
        Inset * clone() const { return new InsetSpace(*this); }
        ///
        void doDispatch(Cursor & cur, FuncRequest & cmd);
+public:
        ///
        bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
 
+private:
+       ///
+       bool showInsetDialog(BufferView * bv) const;
        ///
        InsetSpaceParams params_;
 };