X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fgraphics%2FGraphicsCacheItem.h;h=481e4b117a6a770f132daa2c4125f46644ccf547;hb=f345feecede25b164502abdacf893a36de9ef4ae;hp=dc981dfff9767d000cc5971055b6066ebdb6222e;hpb=13349032cb4dc8ef44146aa652ff6bbff6698249;p=lyx.git diff --git a/src/graphics/GraphicsCacheItem.h b/src/graphics/GraphicsCacheItem.h index dc981dfff9..481e4b117a 100644 --- a/src/graphics/GraphicsCacheItem.h +++ b/src/graphics/GraphicsCacheItem.h @@ -7,13 +7,13 @@ * \author Baruch Even * \author Angus Leeming * - * Full author contact details are available in file CREDITS + * Full author contact details are available in file CREDITS. * - * The graphics cache is a container of grfx::CacheItems. - * Each grfx::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() == grfx::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,42 +21,40 @@ * file conversion to a loadable format; * file loading. * - * Whether you get that, of course, depends on grfx::Converter and on the - * grfx::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 #define GRAPHICSCACHEITEM_H -#ifdef __GNUG__ -#pragma interface -#endif - #include "GraphicsTypes.h" -#include "LString.h" -#include -#include -#include +#include + -class InsetGraphics; +namespace lyx { -namespace grfx { +namespace support { class FileName; } + +namespace graphics { class Image; class Converter; -/// A grfx::Cache item holder. -class CacheItem : boost::noncopyable { +/// A graphics::Cache item holder. +class CacheItem { public: /// - CacheItem(string const & file); - - /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy. + CacheItem(support::FileName const & file); + /// Needed for the pimpl ~CacheItem(); /// - string const & filename() const; + 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; @@ -68,7 +66,7 @@ public: void startMonitoring() const; /// bool monitoring() const; - /** Returns the check sum of filename() so that, for example, you can + /** Returns the check checksum of filename() so that, for example, you can * ascertain whether to output a new PostScript version of the file * for a LaTeX run. */ @@ -87,18 +85,23 @@ public: /** Connect and you'll be informed when the loading status of the image * changes. */ - typedef boost::signal0::slot_type slot_type; + typedef boost::signal sig_type; + typedef sig_type::slot_type slot_type; /// boost::signals::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 grfx +} // namespace graphics +} // namespace lyx #endif // GRAPHICSCACHEITEM_H