X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fgraphics%2FGraphicsConverter.h;h=582c3f08d474a3d0f1ca1d7319e49bcbf623781d;hb=3695b631c6c16d1d87c646d25143c416e7358bad;hp=17d5c8a06f6c853536c0ad83b3e4733154c651c1;hpb=6fac1dc98003a6a6e02765f078b3d3426d426508;p=lyx.git diff --git a/src/graphics/GraphicsConverter.h b/src/graphics/GraphicsConverter.h index 17d5c8a06f..582c3f08d4 100644 --- a/src/graphics/GraphicsConverter.h +++ b/src/graphics/GraphicsConverter.h @@ -1,73 +1,77 @@ // -*- C++ -*- /** - * \file GraphicsConverter.h - * Read the file COPYING + * \file GraphicsConverter.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * \author Angus Leeming + * \author Angus Leeming * - * Full author contact details are available in file CREDITS + * Full author contact details are available in file CREDITS. * - * The controller of a conversion process from file AA of format A to - * file BB of format B. - * Once finished, a signal is emitted to inform any listeners (connected - * through the connect() method). + * The controller of a conversion process from file AA of format A to + * file BB of format B. + * Once finished, a signal is emitted to inform any listeners (connected + * through the connect() method). */ #ifndef GRAPHICSCONVERTER_H #define GRAPHICSCONVERTER_H -#ifdef __GNUG__ -#pragma interface -#endif +#include "support/signals.h" -#include "LString.h" -#include -#include -#include +#include -namespace grfx { +namespace lyx { -class Converter : boost::noncopyable { +namespace support { class FileName; } + +namespace graphics { + +class Converter { public: /// Can the conversion be performed? - static bool isReachable(string const & from_format_name, - string const & to_format_name); + static bool isReachable(std::string const & from_format_name, + std::string const & to_format_name); /** One Converter per conversion ensures that the (hidden) signal * is always connected to the expected slot. */ - Converter(string const & from_file, string const & to_file_base, - string const & from_format, string const & to_format); - - /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy. - ~Converter(); + Converter(support::FileName const & doc_fname, + support::FileName const & from_file, std::string const & to_file_base, + std::string const & from_format, std::string const & to_format); /// We are explicit about when we begin the conversion process. void startConversion() const; /** Connect and you'll be informed when the conversion process has * finished. - * If the conversion is succesful, then the listener is passed \c true. + * If the conversion is successful, then the listener is passed \c true. + * The connection is closed when this is destroyed. */ - typedef boost::signal1::slot_type slot_type; + typedef signal sig_type; + typedef sig_type::slot_type slot_type; /// - boost::signals::connection connect(slot_type const &) const; + connection connect(slot_type const &) const; - /** If the conversion is succesful, this returns the name of the + /** If the conversion is successful, this returns the name of the * resulting file. * If conversion fails or has not been completed, however, it * returns an empty string. */ - string const & convertedFile() const; + support::FileName const & convertedFile() const; private: + /// noncopyable + Converter(Converter const &); + void operator=(Converter 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_; + std::shared_ptr const pimpl_; }; -} // namespace grfx +} // namespace graphics +} // namespace lyx #endif // GRAPHICSCONVERTER_H