]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlWrap.h
Fixed some lines that were too long. It compiled afterwards.
[lyx.git] / src / frontends / controllers / ControlWrap.h
index df42b3abad1d0e5177ad6c9e87712b328ea140a5..e21b2dba0711c14ead8e21fdb71955fe8ca42c3f 100644 (file)
@@ -6,67 +6,43 @@
  *
  * \author Dekel Tsur
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef CONTROLWRAP_H
 #define CONTROLWRAP_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
+#include "Dialog.h"
+
 
-#include "ControlInset.h"
-#include "lyxlength.h"
+namespace lyx {
 
-// needed to instatiate inset->hideDialog in ControlInset
-#include "insets/insetwrap.h"
+class InsetWrapParams;
 
-class InsetWrap;
+namespace frontend {
 
-///
-struct WrapParams {
+class ControlWrap : public Dialog::Controller  {
+public:
        ///
-       WrapParams();
+       ControlWrap(Dialog &);
        ///
-       WrapParams(InsetWrap const &);
+       virtual bool initialiseParams(std::string const & data);
+       /// clean-up on hide.
+       virtual void clearParams();
+       /// clean-up on hide.
+       virtual void dispatchParams();
        ///
-       LyXLength pageWidth;
+       virtual bool isBufferDependent() const { return true; }
        ///
-       string placement;
-};
-
-
-inline
-bool operator==(WrapParams const & p1, WrapParams const & p2)
-{
-       return p1.pageWidth == p2.pageWidth && p1.placement == p2.placement;
-}
-
-
-inline
-bool operator!=(WrapParams const & p1, WrapParams const & p2)
-{
-       return !(p1 == p2);
-}
-
-
-/** A controller for Minipage dialogs.
- */
-class ControlWrap : public ControlInset<InsetWrap, WrapParams>  {
-public:
+       InsetWrapParams & params() { return *params_.get(); }
        ///
-       ControlWrap(LyXView &, Dialogs &);
+       InsetWrapParams const & params() const { return *params_.get(); }
 private:
-       /// Dispatch the changed parameters to the kernel.
-       virtual void applyParamsToInset();
        ///
-       virtual void applyParamsNoInset();
-       /// get the parameters from the string passed to createInset.
-       virtual WrapParams const getParams(string const &)
-               { return WrapParams(); }
-       /// get the parameters from the inset passed to showInset.
-       virtual WrapParams const getParams(InsetWrap const &);
+       boost::scoped_ptr<InsetWrapParams> params_;
 };
 
+} // namespace frontend
+} // namespace lyx
+
 #endif