]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlCommand.h
John's character.C patch (bug fix).
[lyx.git] / src / frontends / controllers / ControlCommand.h
index 802c422c3eaa7cc2920efa4665c5c646300273e6..709c73fbb18879a485ea7baa18282e8af4fcd3a3 100644 (file)
@@ -4,17 +4,20 @@
  *
  *           LyX, The Document Processor
  *
- *           Copyright 2000 The LyX Team.
+ *           Copyright 2001 The LyX Team.
  *
  * ======================================================
  *
  * \file ControlCommand.h
  * \author Angus Leeming <a.leeming@ic.ac.uk>
  *
- * Defines a Controller class for dialogs that create or modify
+ * ControlCommand is a controller class for dialogs that create or modify
  * an inset derived from InsetCommand.
- * Also defines the abstract base class from which the GUI-dependent Views
- * of this dialog should be derived.
+ *
+ * The class is likely to be changed as other Inset controllers are created
+ * and it becomes clear just what functionality can be moved back into
+ * ControlInset.
+ * 
  */
 
 #ifndef CONTROLCOMMAND_H
 #pragma interface
 #endif
 
-#include "ControlConnections.h"
+#include "ControlInset.h"
 #include "insets/insetcommand.h"
 #include "commandtags.h" // kb_action
 
-class Dialogs;
-class LyXView;
-
 /** The Inset dialog controller. Connects/disconnects signals, launches 
     GUI-dependent View and returns the output from this View to the kernel.
  */
-class ControlCommand : public ControlConnectInset<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();
-
 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_;
 };