2003-10-10 21:08:55 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
* \file RenderGraphic.h
|
2003-10-10 21:08:55 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Angus Leeming
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
#ifndef RENDERGRAPHIC_H
|
|
|
|
#define RENDERGRAPHIC_H
|
2003-10-10 21:08:55 +00:00
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
#include "RenderBase.h"
|
2003-10-10 21:08:55 +00:00
|
|
|
|
|
|
|
#include "graphics/GraphicsLoader.h"
|
|
|
|
#include "graphics/GraphicsParams.h"
|
|
|
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
|
2003-10-10 21:08:55 +00:00
|
|
|
class RenderGraphic : public RenderBase
|
|
|
|
{
|
|
|
|
public:
|
2007-04-29 13:39:47 +00:00
|
|
|
RenderGraphic(Inset const *);
|
|
|
|
RenderGraphic(RenderGraphic const &, Inset const *);
|
|
|
|
std::auto_ptr<RenderBase> clone(Inset const *) const;
|
2003-10-10 21:08:55 +00:00
|
|
|
|
|
|
|
/// compute the size of the object returned in dim
|
2006-11-28 15:15:49 +00:00
|
|
|
bool metrics(MetricsInfo & mi, Dimension & dim) const;
|
2003-11-25 16:49:02 +00:00
|
|
|
/// draw inset
|
2003-10-10 21:08:55 +00:00
|
|
|
void draw(PainterInfo & pi, int x, int y) const;
|
|
|
|
|
|
|
|
/// Refresh the info about which file to display and how to display it.
|
2006-10-21 00:16:43 +00:00
|
|
|
void update(graphics::Params const & params);
|
2003-10-10 21:08:55 +00:00
|
|
|
|
2003-10-25 20:09:52 +00:00
|
|
|
/// equivalent to dynamic_cast
|
|
|
|
virtual RenderGraphic * asGraphic() { return this; }
|
|
|
|
|
2003-10-10 21:08:55 +00:00
|
|
|
private:
|
|
|
|
/// Not implemented.
|
|
|
|
RenderGraphic & operator=(RenderGraphic const &);
|
|
|
|
|
|
|
|
/// The stored data.
|
2006-10-21 00:16:43 +00:00
|
|
|
graphics::Loader loader_;
|
|
|
|
graphics::Params params_;
|
2003-10-10 21:08:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
#endif // NOT RENDERGRAPHIC_H
|