]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlCommand.h
Move the external dialog to the new scheme.
[lyx.git] / src / frontends / controllers / ControlCommand.h
index 0d6deb933956ea09377e19eacc689062581ead09..4a87e106855e94ab0ae2ec66567ee196297f873d 100644 (file)
@@ -1,7 +1,8 @@
 // -*- C++ -*-
 /**
  * \file ControlCommand.h
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
  * \author Angus Leeming
  *
  *
  * ControlCommand is a controller class for dialogs that create or modify
  * an inset derived from InsetCommand.
- *
- * 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
 #define CONTROLCOMMAND_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
 
-#include "ControlInset.h"
-#include "insets/insetcommand.h"
-#include "commandtags.h" // kb_action
+#include "Dialog.h"
+#include "insets/insetcommandparams.h"
 
-/** 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, InsetCommandParams>
-{
+
+class ControlCommand : public Dialog::Controller {
 public:
+       /** LFUN_INSET_APPLY requires a name, "citation", "ref" etc so that
+           it knows what to do with the rest of the contents.
+           An empty name indicates that no action will occur on 'Apply'.
+        */
+       ControlCommand(Dialog &, string const & lfun_name = string());
+       ///
+       InsetCommandParams & params() { return params_; }
+       ///
+       InsetCommandParams const & params() const { return params_; }
+       ///
+       virtual void initialiseParams(string const & data);
+       /// clean-up on hide.
+       virtual void clearParams();
+       /// clean-up on hide.
+       virtual void dispatchParams();
        ///
-       ControlCommand(LyXView &, Dialogs &, kb_action=LFUN_NOACTION);
+       virtual bool isBufferDependent() const { return true; }
 
 private:
-       /// 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_;
+       InsetCommandParams params_;
+       /// Flags what action is taken by Kernel::dispatch()
+       string const lfun_name_;
 };