]> git.lyx.org Git - features.git/blobdiff - src/insets/Inset.h
Allow removing words from the personal dictionary, that weren't previously added.
[features.git] / src / insets / Inset.h
index 4396c9bc2a439caf8aaf62b9f0bad5f798923978..fd55d69215ae05c947582207369500942a0000b6 100644 (file)
@@ -20,6 +20,7 @@
 #include "LayoutEnums.h"
 #include "OutputEnums.h"
 #include "OutputParams.h"
+#include "RowFlags.h"
 
 #include "support/docstring.h"
 #include "support/strfwd.h"
@@ -45,6 +46,7 @@ class InsetArgument;
 class InsetCollapsible;
 class InsetCommand;
 class InsetGraphics;
+class InsetIndex;
 class InsetIterator;
 class InsetLayout;
 class InsetList;
@@ -145,6 +147,8 @@ public:
        virtual InsetCommand const * asInsetCommand() const { return nullptr; }
        /// is this inset based on the InsetArgument class?
        virtual InsetArgument const * asInsetArgument() const { return nullptr; }
+       /// is this inset based on the InsetIndex class?
+       virtual InsetIndex const * asInsetIndex() const { return nullptr; }
        /// is this inset based on the InsetGraphics class?
        virtual InsetGraphics * asInsetGraphics() { return nullptr; }
        /// is this inset based on the InsetGraphics class?
@@ -334,7 +338,7 @@ public:
        /// output, add PLAINTEXT_NEWLINE to the number of chars in the last line
        virtual int plaintext(odocstringstream &, OutputParams const &,
                              size_t max_length = INT_MAX) const = 0;
-       /// docbook output
+       /// DocBook output
        virtual void docbook(XMLStream &, OutputParams const &) const;
        /// XHTML output
        /// the inset is expected to write XHTML to the XMLStream
@@ -350,8 +354,8 @@ public:
        /// Appends a potentially abbreviated version of the inset to
        /// \param str. Intended for use by the TOC.
        virtual void forOutliner(docstring & str,
-                                                        size_t const maxlen = TOC_ENTRY_LENGTH,
-                                                        bool const shorten = true) const;
+                                size_t const maxlen = TOC_ENTRY_LENGTH,
+                                bool const shorten = true) const;
 
        /// Can a cursor be put in there ?
        /// Forced to false for insets that have hidden contents, like
@@ -401,10 +405,10 @@ public:
        /// Returns the completion prefix to filter the suggestions for completion.
        /// This is only called if completionList returned a non-null list.
        virtual docstring completionPrefix(Cursor const &) const;
-       /// Do a completion at the cursor position. Return true on success.
-       /// The completion does not contain the prefix. If finished is true, the
-       /// completion is final. If finished is false, completion might only be
-       /// a partial completion.
+       /// Do a completion at the cursor position. Return true on success. Handles undo.
+       /// The completion does not contain the prefix.
+       /// If finished is true, the completion is final, otherwise it
+       /// might be only partial. (only useful for mathed)
        virtual bool insertCompletion(Cursor & /*cur*/,
                docstring const & /*completion*/, bool /*finished*/)
                { return false; }
@@ -478,26 +482,8 @@ public:
 
        virtual CtObject getCtObject(OutputParams const &) const;
 
-       enum RowFlags {
-               Inline = 0,
-               // break row before this inset
-               BreakBefore = 1 << 0,
-               // break row after this inset
-               BreakAfter = 1 << 1,
-               // it is possible to break after this inset
-               CanBreakAfter = 1 << 2,
-               // force new (maybe empty) row after this inset
-               RowAfter = 1 << 3,
-               // specify an alignment (left, right) for a display inset
-               // (default is center)
-               AlignLeft = 1 << 4,
-               AlignRight = 1 << 5,
-               // A display inset breaks row at both ends
-               Display = BreakBefore | BreakAfter
-       };
-
-       /// How should this inset be displayed in its row?
-       virtual RowFlags rowFlags() const { return Inline; }
+       // properties with respect to row breaking (made of RowFLag enumerators)
+       virtual int rowFlags() const { return Inline; }
        /// indentation before this inset (only needed for displayed hull insets with fleqn option)
        virtual int indent(BufferView const &) const { return 0; }
        ///
@@ -562,9 +548,9 @@ public:
        /// Collect BibTeX information
        virtual void collectBibKeys(InsetIterator const &, support::FileNameList &) const {}
        /// Update the counters of this inset and of its contents.
-       /// The boolean indicates whether we are preparing for output, e.g.,
-       /// of XHTML.
-       virtual void updateBuffer(ParIterator const &, UpdateType, bool const) {}
+       /// \param utype indicates whether we are preparing for output, e.g., of XHTML.
+       /// \param deleted indicates whethe rthe inset is deleted.
+       virtual void updateBuffer(ParIterator const &, UpdateType /*utype*/, bool /*deleted*/) {}
 
        /// Updates the inset's dialog
        virtual Buffer const * updateFrontend() const;
@@ -655,20 +641,6 @@ protected:
 };
 
 
-inline Inset::RowFlags operator|(Inset::RowFlags const d1,
-                                    Inset::RowFlags const d2)
-{
-       return static_cast<Inset::RowFlags>(int(d1) | int(d2));
-}
-
-
-inline Inset::RowFlags operator&(Inset::RowFlags const d1,
-                                    Inset::RowFlags const d2)
-{
-       return static_cast<Inset::RowFlags>(int(d1) & int(d2));
-}
-
-
 } // namespace lyx
 
 #endif