]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/GraphicsConverter.h
Remove obsolete (and false) comment.
[lyx.git] / src / graphics / GraphicsConverter.h
index 17ca2be966c220fc9d0fde681f2a7c8ecba3c748..c038029bd8f99b61559fbfc7b0447e4aab4d9cb0 100644 (file)
@@ -1,72 +1,79 @@
 // -*- C++ -*-
 /**
- *  \file GraphicsConverter.h
- *  Copyright 2002 the LyX Team
- *  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 <a.leeming@ic.ac.uk>
+ * \author Angus Leeming
  *
- *  The controller of a conversion process from file AA of format A to
- *  file BB of format B.
- *  Once finished, the signal finishdConversion is emitted to inform the
- *  instigator where to find file BB.
- *  If the conversion is unsuccessful, then finishedConversion will pass
- *  an empty string.
+ * 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).
  */
 
 #ifndef GRAPHICSCONVERTER_H
 #define GRAPHICSCONVERTER_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
+#include "support/signals.h"
+
 
-#include "LString.h"
-#include <boost/signals/signal1.hpp>
-#include <boost/scoped_ptr.hpp>
-#include <boost/utility.hpp>
+namespace lyx {
 
-namespace grfx {
+namespace support { class FileName; }
 
-class Converter : boost::noncopyable {
+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 finishedConversion
+       /** 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);
+       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);
 
-       /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy.
+       /// Needed for the pimpl
        ~Converter();
 
        /// We are explicit about when we begin the conversion process.
-       void startConversion();
+       void startConversion() const;
 
-       /** At the end of the conversion process inform the outside world
-        *  by emitting a signal.
+       /** Connect and you'll be informed when the conversion process has
+        *  finished.
+        *  If the conversion is successful, then the listener is passed \c true.
+        *  The connection is closed when this is destroyed.
         */
-       typedef boost::signal1<void, bool> SignalType;
+       typedef signals2::signal<void(bool)> sig_type;
+       typedef sig_type::slot_type slot_type;
        ///
-       SignalType finishedConversion;
-       
-       /** If the convsion is succesful (finishedConversion returns \c true),
-        *  this returns the name of the resulting file.
-        *  If conversion fails, however, it returns an empty string.
+       signals2::connection connect(slot_type const &) const;
+
+       /** 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<Impl> const pimpl_;
+       Impl * const pimpl_;
 };
-} // namespace grfx
+
+} // namespace graphics
+} // namespace lyx
 
 #endif // GRAPHICSCONVERTER_H