]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlGraphics.h
Add a buffer_path arg to InsetGraphicsMailer's params2string, string2params.
[lyx.git] / src / frontends / controllers / ControlGraphics.h
index 022e3e9564b97f7c927d9deca1c331c14a99ad40..a7a1fa7bf25e69214c22eec077f5d27d094aec7e 100644 (file)
@@ -1,26 +1,23 @@
 // -*- C++ -*-
-/* This file is part of
- * ====================================================== 
- *
- *           LyX, The Document Processor
- *
- *           Copyright 2001 The LyX Team.
+/**
+ * \file ControlGraphics.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * ======================================================
+ * \author Baruch Even
+ * \author Angus Leeming
+ * \author Herbert Voss
  *
- * \file ControlGraphics.h
- * \author Angus Leeming <a.leeming@ic.ac.uk>
- * \author Herbert Voss <voss@perce.de>
-*/
+ * Full author contact details are available in file CREDITS
+ */
 
 #ifndef CONTROLGRAPHICS_H
 #define CONTROLGRAPHICS_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif 
 
-#include "ControlInset.h"
+#include "Dialog.h"
+#include <utility>
+#include <vector>
 
 class InsetGraphics;
 class InsetGraphicsParams;
@@ -28,11 +25,23 @@ class LyXView;
 
 /** A controller for Graphics dialogs.
  */
-class ControlGraphics
-       : public ControlInset<InsetGraphics, InsetGraphicsParams> {
+
+class ControlGraphics : public Dialog::Controller {
 public:
        ///
-       ControlGraphics(LyXView &, Dialogs &);
+       ControlGraphics(Dialog &);
+       ///
+       virtual bool initialiseParams(string const & data);
+       /// clean-up on hide.
+       virtual void clearParams();
+       /// clean-up on hide.
+       virtual void dispatchParams();
+       ///
+       virtual bool isBufferDependent() const { return true; }
+       ///
+       InsetGraphicsParams & params() { return *params_.get(); }
+       ///
+       InsetGraphicsParams const & params() const { return *params_.get(); }
 
        /// Browse for a file
        string const Browse(string const &);
@@ -40,17 +49,24 @@ public:
        string const readBB(string const & file);
        /// Control the bb
        bool bbChanged;
+       /// test if file exist
+       bool isFilenameValid(string const & fname) const;
 
 private:
-       /// Dispatch the changed parameters to the kernel.
-       virtual void applyParamsToInset();
-       /// 
-       virtual void applyParamsNoInset();
-       /// get the parameters from the string passed to createInset.
-       virtual InsetGraphicsParams const getParams(string const &);
-       /// get the parameters from the inset passed to showInset.
-       virtual InsetGraphicsParams const getParams(InsetGraphics const &);
+       ///
+       boost::scoped_ptr<InsetGraphicsParams> params_;
 };
 
-#endif // CONTROLGRAPHICS_H
+namespace frnt {
 
+/// get the units for the bounding box
+std::vector<string> const getBBUnits();
+
+/// The (tranlated) GUI string and it's LaTeX equivalent.
+typedef std::pair<string, string> RotationOriginPair;
+///
+std::vector<RotationOriginPair> getRotationOriginData();
+
+} // namespace frnt
+
+#endif // CONTROLGRAPHICS_H