* Licence details can be found in the file COPYING.
*
* \author Alejandro Aguilar Sierra
- * \author Jürgen Vigna
- * \author Lars Gullik Bjønnes
+ * \author Jürgen Vigna
+ * \author Lars Gullik Bjønnes
* \author Matthias Ettrich
*
* Full author contact details are available in file CREDITS.
#ifndef INSETBASE_H
#define INSETBASE_H
-#include "Changes.h"
#include "Dimension.h"
#include "support/docstream.h"
-#include <boost/signal.hpp>
-
#include <memory>
#include <vector>
namespace lyx {
+class BiblioInfo;
class Buffer;
class BufferParams;
class BufferView;
-class ParConstIterator;
+class Change;
+class Color_color;
+class Cursor;
class CursorSlice;
class FuncRequest;
class FuncStatus;
+class InsetIterator;
+class InsetLayout;
class InsetMath;
class InsetText;
class LaTeXFeatures;
-class Color_color;
-class Cursor;
class Lexer;
-class Text;
+class MathAtom;
class MetricsInfo;
-class Dimension;
-class PainterInfo;
class OutputParams;
+class PainterInfo;
+class Paragraph;
+class ParConstIterator;
+class ParIterator;
+class Text;
class TocList;
+class EmbeddedFiles;
namespace graphics { class PreviewLoader; }
/// virtual base class destructor
virtual ~Inset() {}
- /// replicate ourselves
- std::auto_ptr<Inset> clone() const;
/// identification as math inset
virtual InsetMath * asInsetMath() { return 0; }
CursorSlice const & sl, bool boundary, int & x, int & y) const;
/// is this an inset that can be moved into?
+ /// FIXME: merge with editable()
virtual bool isActive() const { return nargs() > 0; }
/// Where should we go when we press the up or down cursor key?
virtual bool idxUpDown(Cursor & cur, bool up) const;
///
virtual docstring name() const { return from_ascii("unknown"); }
+ ///
+ virtual InsetLayout const & getLayout(BufferParams const & bp) const;
/// used to toggle insets
/// is the inset open?
/// should this inset be handled like a normal charater
virtual void addPreview(graphics::PreviewLoader &) const {}
/// Add an entry to the TocList
/// pit is the ParConstIterator of the paragraph containing the inset
- virtual void addToToc(TocList &, Buffer const &, ParConstIterator &) const {}
+ virtual void addToToc(TocList &, Buffer const &, ParConstIterator const &) const {}
+ /// report files that can be embedded with the lyx file
+ virtual void registerEmbeddedFiles(Buffer const &, EmbeddedFiles &,
+ ParConstIterator const &) const {};
+ /// Fill keys with BibTeX information
+ virtual void fillWithBibKeys(Buffer const &,
+ BiblioInfo &, InsetIterator const &) const { return; }
+ /// Update the counters of this inset and of its contents
+ virtual void updateLabels(Buffer const &, ParIterator const &) {}
+
public:
/// returns LyX code associated with the inset. Used for TOC, ...)
/// reject the changes within the inset
virtual void rejectChanges(BufferParams const &) {};
+ /// FIXME: move dim_ out of Inset!
+ Dimension const & dimension() { return dim_; }
/// inset width.
int width() const { return dim_.wid; }
/// inset ascent.
///
int scroll() const { return 0; }
///
- void setBackgroundColor(Color_color);
- ///
- Color_color backgroundColor() const;
+ virtual Color_color backgroundColor() const;
///
enum CollapseStatus {
Collapsed,
- Inlined,
Open
};
///
//
enum { TEXT_TO_INSET_OFFSET = 4 };
- /// Signal for inset destruction.
- /** This signal is emitted at the inset destruction for insets that
- * support this.
- */
- virtual boost::signal<void()> * destroyedSignal() { return 0; }
-
protected:
Inset();
+ /// replicate ourselves
+ friend class Paragraph;
+ friend class MathAtom;
+ virtual Inset * clone() const = 0;
+
/** The real dispatcher.
* Gets normally called from Cursor::dispatch(). Cursor::dispatch()
* assumes the common case of 'LFUN handled, need update'.
/// Cached dimensions of the inset.
mutable Dimension dim_;
-private:
- virtual std::auto_ptr<Inset> doClone() const = 0;
- /** We store the Color::color value as an int to get Color.h out
- * of the header file.
- */
- int background_color_;
};
* It can be forward-declared and passed as a function argument without
* having to expose Inset.h.
*/
-
class Inset_code {
Inset::Code val_;
public: