]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlFloat.C
Add a buffer_path arg to InsetGraphicsMailer's params2string, string2params.
[lyx.git] / src / frontends / controllers / ControlFloat.C
index 2e8891a3c9adc74f7c4d47c9b703d2d4d0f88ad9..bd7ac6fd7e918de345ba57e689833d659c13bb9b 100644 (file)
@@ -1,70 +1,42 @@
-/* This file is part of
- * ======================================================
+/**
+ * \file ControlFloat.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
- *
- *           Copyright 2001 The LyX Team.
- *
- * ======================================================
+ * \author unknown
  *
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "ControlFloat.h"
-#include "ViewBase.h"
-#include "ButtonControllerBase.h"
-#include "Dialogs.h"
-#include "buffer.h"
-#include "BufferView.h"
-
+#include "funcrequest.h"
 #include "insets/insetfloat.h"
-#include "frontends/LyXView.h"
 
-#include <boost/bind.hpp>
 
-using std::vector;
+ControlFloat::ControlFloat(Dialog & parent)
+       : Dialog::Controller(parent)
+{}
 
 
-ControlFloat::ControlFloat(LyXView & lv, Dialogs & d)
-       : ControlInset<InsetFloat, FloatParams>(lv, d)
+bool ControlFloat::initialiseParams(string const & data)
 {
-       d_.showFloat = boost::bind(&ControlFloat::showInset, this, _1);
-
-       // We could have an extra method updateInset that calls
-       // view().update() rather than view().show(), but I don't see why
-       // it is really needed.
-       //d_.updateFloat.connect(slot(this, &ControlFloat::showInset));
+       InsetFloatParams params;
+       InsetFloatMailer::string2params(data, params);
+       params_.reset(new InsetFloatParams(params));
+       return true;
 }
 
 
-void ControlFloat::applyParamsToInset()
+void ControlFloat::clearParams()
 {
-       inset()->placement(params().placement);
+       params_.reset();
 }
 
 
-void ControlFloat::applyParamsNoInset()
-{}
-
-
-FloatParams const ControlFloat::getParams(InsetFloat const & inset)
+void ControlFloat::dispatchParams()
 {
-       return FloatParams(inset);
+       string const lfun = InsetFloatMailer::params2string(params());
+       kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
 }
-
-
-FloatParams::FloatParams()
-       : placement("htbp"),
-         allow_here_definitely(true)
-{}
-
-
-FloatParams::FloatParams(InsetFloat const & inset)
-       : placement(inset.placement()),
-         allow_here_definitely(!inset.wide())
-{}