2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2000 The LyX Team.
9 * ======================================================
11 * \file ControlCommand.h
12 * \author Angus Leeming <a.leeming@ic.ac.uk>
14 * Defines a Controller class for dialogs that create or modify
15 * an inset derived from InsetCommand.
16 * Also defines the abstract base class from which the GUI-dependent Views
17 * of this dialog should be derived.
20 #ifndef CONTROLCOMMAND_H
21 #define CONTROLCOMMAND_H
27 #include "ControlConnections.h"
28 #include "insets/insetcommand.h"
29 #include "commandtags.h" // kb_action
34 /** The Inset dialog controller. Connects/disconnects signals, launches
35 GUI-dependent View and returns the output from this View to the kernel.
37 class ControlCommand : public ControlConnectInset<InsetCommand>
41 ControlCommand(LyXView &, Dialogs &, kb_action=LFUN_NOACTION);
43 /// Allow the View access to the local copy.
44 InsetCommandParams & params() const;
47 /// Slots connected in the daughter classes c-tor.
48 /// Slot launching dialog to (possibly) create a new inset.
49 void createInset(string const &);
50 /// Slot launching dialog to an existing inset.
51 void showInset(InsetCommand *);
53 /// Connect signals and launch View.
54 void show(InsetCommandParams const &);
56 /// Instantiation of private ControlBase virtual methods.
57 /// Get changed parameters and Dispatch them to the kernel.
59 /// Disconnect signals and hide View.
61 /// Update dialog before showing it.
62 virtual void update();
65 /** A local copy of the inset's params.
66 Memory is allocated only whilst the dialog is visible.
68 InsetCommandParams * params_;
69 /// Controls what is done in LyXFunc::Dispatch()
70 kb_action const action_;
74 #endif // CONTROLCOMMAND_H