2 /* This file is part of
3 * =================================================
5 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich.
7 * Copyright 1995-2000 The LyX Team.
9 * This file Copyright 2000 Baruch Even
10 * ================================================= */
15 #pragma implementation
18 #include "graphics/GraphicsCache.h"
19 #include "graphics/GraphicsCacheItem.h"
20 #include "graphics/GraphicsCacheItem_pimpl.h"
21 #include "frontends/support/LyXImage.h"
24 GraphicsCacheItem::GraphicsCacheItem()
25 : pimpl(new GraphicsCacheItem_pimpl)
31 GraphicsCacheItem::~GraphicsCacheItem()
38 GraphicsCacheItem::setFilename(string const & filename)
41 return pimpl->setFilename(filename);
45 GraphicsCacheItem::GraphicsCacheItem(GraphicsCacheItem const & gci)
48 // copy will set the actual value of the pimpl.
53 GraphicsCacheItem::operator=(GraphicsCacheItem const & gci)
55 // Are we trying to copy the object onto itself.
62 // And then copy new object.
69 GraphicsCacheItem::Clone() const
71 return new GraphicsCacheItem(*this);
75 GraphicsCacheItem::copy(GraphicsCacheItem const & gci)
83 GraphicsCacheItem::destroy()
89 if (pimpl->refCount == 0) {
93 GraphicsCache * gc = GraphicsCache::getInstance();
94 gc->removeFile(filename_);
99 GraphicsCacheItem::ImageStatus
100 GraphicsCacheItem::getImageStatus() const { return pimpl->imageStatus_; }
103 GraphicsCacheItem::getImage() const { return pimpl->getImage(); }