]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlCommand.h
The reference dialog now disconnects from the inset on Apply. Its behaviour
[lyx.git] / src / frontends / controllers / ControlCommand.h
index 996a84d3264ffbac59c0c807d4bba9f9e7bf92c5..709c73fbb18879a485ea7baa18282e8af4fcd3a3 100644 (file)
 #pragma interface
 #endif
 
-#include "ControlDialogs.h"
+#include "ControlInset.h"
 #include "insets/insetcommand.h"
 #include "commandtags.h" // kb_action
 
 /** The Inset dialog controller. Connects/disconnects signals, launches 
     GUI-dependent View and returns the output from this View to the kernel.
  */
-class ControlCommand : public ControlInset<InsetCommand>
+class ControlCommand : public ControlInset<InsetCommand, InsetCommandParams>
 {
 public:
        ///
        ControlCommand(LyXView &, Dialogs &, kb_action=LFUN_NOACTION);
 
-       /// Allow the View access to the local copy.
-       InsetCommandParams & params() const;
-
-protected:
-       /// Slots connected in the daughter classes c-tor.
-       /// Slot launching dialog to (possibly) create a new inset.
-       void createInset(string const &);
-       /// Slot launching dialog to an existing inset.
-       void showInset(InsetCommand *);
-
-       /// Connect signals and launch View.
-       void show(InsetCommandParams const &);
-
-       /// Instantiation of private ControlBase virtual methods.
-       /// Get changed parameters and Dispatch them to the kernel.
-       virtual void apply();
-       /// Disconnect signals and hide View.
-       virtual void hide();
-       /// Update dialog before showing it.
-       virtual void update();
-
-       /// clean-up on hide.
-       virtual void clearParams() {}
-       
-
 private:
-       /** A local copy of the inset's params.
-           Memory is allocated only whilst the dialog is visible.
-       */
-       InsetCommandParams * params_;
+       /// Dispatch the changed parameters to the kernel.
+       virtual void applyParamsToInset();
+       /// 
+       virtual void applyParamsNoInset();
+       /// get the parameters from the string passed to createInset.
+       virtual InsetCommandParams const getParams(string const &);
+       /// get the parameters from the inset passed to showInset.
+       virtual InsetCommandParams const getParams(InsetCommand const &);
+
        /// Controls what is done in LyXFunc::Dispatch()
        kb_action const action_;
 };