X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fgraphics%2FGraphicsCacheItem.h;h=a018b3931d7f871c0778eaa830a821d1326a4d53;hb=e0e548217eb7b3c8728a1af17aa42be496b91281;hp=298ef172fa1fa3b96d5be37ff21e7a9032df0602;hpb=8e6e970d7ba017dba14bdb821f4c4489665d947c;p=lyx.git diff --git a/src/graphics/GraphicsCacheItem.h b/src/graphics/GraphicsCacheItem.h index 298ef172fa..a018b3931d 100644 --- a/src/graphics/GraphicsCacheItem.h +++ b/src/graphics/GraphicsCacheItem.h @@ -9,11 +9,11 @@ * * Full author contact details are available in file CREDITS. * - * The graphics cache is a container of lyx::graphics::CacheItems. - * Each lyx::graphics::CacheItem, defined here represents a separate image file. + * The graphics cache is a container of graphics::CacheItems. + * Each graphics::CacheItem, defined here represents a separate image file. * * The routines here can be used to load the graphics file into memory at - * which point (status() == lyx::graphics::Loaded). + * which point (status() == graphics::Loaded). * The user is then free to access image() in order to copy it and to then * transform the copy (rotate, scale, clip) and to generate the pixmap. * @@ -21,8 +21,8 @@ * file conversion to a loadable format; * file loading. * - * Whether you get that, of course, depends on lyx::graphics::Converter and - * on the lyx::graphics::Image-derived image class. + * Whether you get that, of course, depends on graphics::Converter and + * on the graphics::Image-derived image class. */ #ifndef GRAPHICSCACHEITEM_H @@ -30,9 +30,7 @@ #include "GraphicsTypes.h" -#include -#include -#include +#include "support/signals.h" namespace lyx { @@ -42,20 +40,21 @@ namespace support { class FileName; } namespace graphics { class Image; -class Converter; -/// A lyx::graphics::Cache item holder. -class CacheItem : boost::noncopyable { +/// A graphics::Cache item holder. +class CacheItem { public: /// - CacheItem(support::FileName const & file); - - /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy. + CacheItem(support::FileName const & file, support::FileName const & doc_file); + /// Needed for the pimpl ~CacheItem(); /// support::FileName const & filename() const; + /// Try to load a display format. + bool tryDisplayFormat() const; + /// It's in the cache. Now start the loading process. void startLoading() const; @@ -66,11 +65,8 @@ public: void startMonitoring() const; /// bool monitoring() const; - /** Returns the check sum of filename() so that, for example, you can - * ascertain whether to output a new PostScript version of the file - * for a LaTeX run. - */ - unsigned long checksum() const; + /// perform a modification check asynchronously + void checkModifiedAsync() const; /** Get the image associated with filename(). * If the image is not yet loaded, returns 0. @@ -85,17 +81,19 @@ public: /** Connect and you'll be informed when the loading status of the image * changes. */ - typedef boost::signal sig_type; - typedef sig_type::slot_type slot_type; + typedef signal::slot_type slot_type; /// - boost::signals::connection connect(slot_type const &) const; + connection connect(slot_type const &) const; private: + /// noncopyable + CacheItem(CacheItem const &); + void operator=(CacheItem const &); + /// Use the Pimpl idiom to hide the internals. class Impl; - /// The pointer never changes although *pimpl_'s contents may. - boost::scoped_ptr const pimpl_; + Impl * const pimpl_; }; } // namespace graphics