class ParIterator;
class Text;
class TocList;
+class EmbeddedFile;
class EmbeddedFiles;
/// compute the size of the object returned in dim
/// \retval true if metrics changed.
- virtual bool metrics(MetricsInfo & mi, Dimension & dim) const = 0;
+ virtual void metrics(MetricsInfo & mi, Dimension & dim) const = 0;
/// draw inset and update (xo, yo)-cache
virtual void draw(PainterInfo & pi, int x, int y) const = 0;
/// draw inset selection if necessary
int yo(BufferView const & bv) const;
/// set x/y drawing position cache if available
virtual void setPosCache(PainterInfo const &, int, int) const;
+ ///
+ void setDimCache(MetricsInfo const &, Dimension const &) const;
/// do we cover screen position x/y?
virtual bool covers(BufferView const & bv, int x, int y) const;
/// get the screen positions of the cursor (see note in Cursor.cpp)
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 &) const {};
+ /// use embedded or external file after the embedding status of a file is changed
+ virtual void updateEmbeddedFile(Buffer const &, EmbeddedFile const &) {}
/// Fill keys with BibTeX information
virtual void fillWithBibKeys(Buffer const &,
BiblioInfo &, InsetIterator const &) const { return; }
/// 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 ascent() const { return dim_.asc; }
- /// inset descent.
- int descent() const { return dim_.des; }
+ ///
+ virtual Dimension const dimension(BufferView const &) const;
///
int scroll() const { return 0; }
///
* \sa getStatus
*/
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
-
- /// Cached dimensions of the inset.
- mutable Dimension dim_;
};