-#include <list>
-#include "LString.h"
-#include <boost/utility.hpp>
-#include <boost/smart_ptr.hpp>
-#include <sigc++/signal_system.h>
-
-class InsetGraphics;
-
-namespace grfx {
-
-class GParams;
-class ModifiedItem;
-
-/// A grfx::GCache item holder.
-class GCacheItem : boost::noncopyable, public SigC::Object {
-public:
- /// the GCacheItem contains data of this type.
- typedef boost::shared_ptr<ModifiedItem> ModifiedItemPtr;
-
- ///
- GCacheItem(InsetGraphics const &, GParams const &);
-
- /// The params have changed (but still refer to this file).
- void modify(InsetGraphics const &, GParams const &);
-
- /// Remove the reference to this inset.
- void remove(InsetGraphics const &);
-
- /// It's in the cache. Now start the loading process.
- void startLoading(InsetGraphics const &);
-
- /// Is the cache item referenced by any insets at all?
- bool empty() const;
-
- /// The name of the original image file.
- string const & filename() const;
-
- /// Is this image file referenced by this inset?
- bool referencedBy(InsetGraphics const &) const;
-
- /** Returns the image referenced by this inset (or an empty container
- * if it's not yet loaded.
- */
- ImagePtr const image(InsetGraphics const &) const;
-
- /// The loading status of the image referenced by this inset.
- ImageStatus status(InsetGraphics const &) const;
-
- /** If (changed_background == true), then the background color of the
- * graphics inset has changed. Update all images.
- * Else, the preferred display type has changed.
- * Update the view of all insets whose display type is DEFAULT.
- */
- void changeDisplay(bool changed_background);
-
- /// Used to ascertain the Bounding Box of non (e)ps files.
- unsigned int raw_width() const;
- ///
- unsigned int raw_height() const;
-
-private:
- /** Start the image conversion process, checking first that it is
- * necessary. If it is necessary, then a conversion task is started.
- * GCacheItem asumes that the conversion is asynchronous and so
- * passes a Signal to the converting routine. When the conversion
- * is finished, this Signal is emitted, returning the converted
- * file to this->imageConverted.
- *
- * If no file conversion is needed, then convertToDisplayFormat() calls
- * loadImage() directly.
- *
- * convertToDisplayFormat() will set the loading status flag as
- * approriate through calls to setStatus().
- */
- void convertToDisplayFormat();
-
- /** Load the image into memory. This is called either from
- * convertToDisplayFormat() direct or from imageConverted().
- */
- void loadImage();
-
- /** Get a notification when the image conversion is done.
- * Connected to a signal on_finish_ which is passed to
- * GConverter::convert.
- */
- void imageConverted(string const & file_to_load);