lyx_mirror/src/frontends/controllers
Jean-Marc Lasgouttes a0d71b53fe move floatlist to textclass
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5124 a592a061-630c-0410-9148-cb99ea01b6c8
2002-08-27 15:51:19 +00:00
..
.cvsignore
biblio.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
biblio.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ButtonController.h compile fixes (move a c'tor out of line, add a virtual destuctor and 2002-08-16 07:00:35 +00:00
ButtonController.tmpl Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ButtonControllerBase.C ws cleanup 2002-03-21 21:21:28 +00:00
ButtonControllerBase.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ButtonPolicies.C ws cleanup 2002-03-21 21:21:28 +00:00
ButtonPolicies.h ws cleanup 2002-03-21 21:21:28 +00:00
ChangeLog move floatlist to textclass 2002-08-27 15:51:19 +00:00
character.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
character.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlAboutlyx.C * Constify Buffer::getLabelList. 2002-08-12 20:17:41 +00:00
ControlAboutlyx.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlBibitem.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlBibitem.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlBibtex.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlBibtex.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlButtons.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlButtons.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlCharacter.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlCharacter.h *duck* 2002-06-18 15:44:30 +00:00
ControlCitation.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlCitation.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlCommand.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlCommand.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlCommandBuffer.C * Constify Buffer::getLabelList. 2002-08-12 20:17:41 +00:00
ControlCommandBuffer.h * Constify Buffer::getLabelList. 2002-08-12 20:17:41 +00:00
ControlConnections.C The dialogs/guiapi re-working. 2002-08-15 17:48:53 +00:00
ControlConnections.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlDialog_impl.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlDialog_impl.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlDialog.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlDialog.tmpl Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlError.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlError.h * Throw out DialogBase.h 2002-08-14 19:19:47 +00:00
ControlERT.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlERT.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlExternal.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlExternal.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlFloat.C move floatlist to textclass 2002-08-27 15:51:19 +00:00
ControlFloat.h * Constify Buffer::getLabelList. 2002-08-12 20:17:41 +00:00
ControlForks.C * Constify Buffer::getLabelList. 2002-08-12 20:17:41 +00:00
ControlForks.h Switch from SigC signals to boost::signals 2002-05-29 16:21:03 +00:00
ControlGraphics.C Rob's patch and some minor cleanup 2002-08-24 22:02:30 +00:00
ControlGraphics.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlInclude.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlInclude.h ws cleanup 2002-03-21 21:21:28 +00:00
ControlIndex.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlIndex.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlInset.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlInset.tmpl Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlLog.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlLog.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlMinipage.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlMinipage.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlParagraph.C The dialogs/guiapi re-working. 2002-08-15 17:48:53 +00:00
ControlParagraph.h Edwin's updateParagraph patch. 2002-08-02 12:28:59 +00:00
ControlPreamble.C * Throw out DialogBase.h 2002-08-14 19:19:47 +00:00
ControlPreamble.h *duck* 2002-06-18 15:44:30 +00:00
ControlPrint.C * Throw out DialogBase.h 2002-08-14 19:19:47 +00:00
ControlPrint.h *duck* 2002-06-18 15:44:30 +00:00
ControlRef.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlRef.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlSearch.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlSearch.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlSendto.C * Constify Buffer::getLabelList. 2002-08-12 20:17:41 +00:00
ControlSendto.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlShowFile.C *duck* 2002-06-18 15:44:30 +00:00
ControlShowFile.h Add LString.h to ControlShowFile.h 2002-03-06 12:06:34 +00:00
ControlSpellchecker.C move half of BufferView_pimpl::dispatch() to LyXText::dispatch() 2002-08-20 13:00:25 +00:00
ControlSpellchecker.h * LyXView: the accessor methods now return a reference to the member 2002-08-13 14:40:38 +00:00
ControlTabularCreate.C * Constify Buffer::getLabelList. 2002-08-12 20:17:41 +00:00
ControlTabularCreate.h ws cleanup 2002-03-21 21:21:28 +00:00
ControlTexinfo.C * Throw out DialogBase.h 2002-08-14 19:19:47 +00:00
ControlTexinfo.h Merge Herbert's bibtex patch; it doesn't introduce any new bugs and 2002-06-20 20:41:00 +00:00
ControlThesaurus.C * Throw out DialogBase.h 2002-08-14 19:19:47 +00:00
ControlThesaurus.h ws cleanup 2002-03-21 21:21:28 +00:00
ControlToc.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlToc.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlUrl.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlUrl.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlVCLog.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
ControlVCLog.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
frnt_lang.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
frnt_lang.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
GUI.h The dialogs/guiapi re-working. 2002-08-15 17:48:53 +00:00
helper_funcs.C Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
helper_funcs.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00
Makefile.am * Throw out DialogBase.h 2002-08-14 19:19:47 +00:00
README Remove some xforms cruft from BufferView.h BufferView_pimpl.h. 2001-04-03 14:30:58 +00:00
tex_helpers.C * Throw out DialogBase.h 2002-08-14 19:19:47 +00:00
tex_helpers.h * Throw out DialogBase.h 2002-08-14 19:19:47 +00:00
ViewBase.h Nothing but a changed email address (trying to factor my tree in in small steps) 2002-08-15 16:02:22 +00:00

This directory provides the controllers that act as an interface between the
LyX kernel and the GUI-specific implementations of each dialog. It also
provides abstract base classes from which GUI-specific implemetations of the
ButtonController and each separate dialog should be derived (see
ButtonControlBase.[Ch] and ViewBase.h respectively).

The Controller connects the GUI-specific dialog to any appropriate signals and
dispatches any changes in the data to the kernel. It has no knowledge of the
actual instantiation of the GUI-dependent View and ButtonController, which
should therefore be created elsewhere. Once created, the Controller will take
care of their initialisation, management and, ultimately, destruction.

This leaves the GUI-specific dialog (and its author!) to worry only about the
data that it has been created to input/modify.

This concept has been instatiated for the Citation dialog only at the moment.
See xforms-new/FormCitation.[Ch] for an xforms-specific View of the dialog.

How the code works.
===================

I'll describe Inset-type dialogs (eg, the Citation dialog). Non-inset-type
(eg the Document dialog) have similar  flow, but the important controller 
functions are to be found in ControlDialogs.h, not ControlInset.h.

Let's use the citation dialog as an example.

The dialog is launched by :
	a) clicking on an existing inset, emitting the showCitation()
(Dialogs.h) signal, connected to the showInset() slot
(controllers/ControlInset.h) in theControlCitation c-tor.
	b) request a new inset (eg from the menubar), emitting a
createCitation() signal (Dialogs.h) connected to the createInset()
slot (controllers/ControlInset.h) in theControlCitation c-tor. 

The user presses the Ok, Apply, Cancel or Restore buttons. In xforms
these are connected to the button controller (xforms/FormCitation.C:
build) so: 
	bc().setOK(dialog_->button_ok);
	bc().setApply(dialog_->button_apply);
	bc().setCancel(dialog_->button_cancel);
	bc().setRestore(dialog_->button_restore);
The button controller alters the state of the buttons (active/inactive). 
xforms works by callbacks, so clicking on say the button_ok button
causes a callback event to (see FormBase.C) 

extern "C" void C_FormBaseOKCB(FL_OBJECT * ob, long)
{
	GetForm(ob)->OKButton();
}

GetForm() extracts the actual instance of FormCitation that caused the
event and calls OKButton() (see controllers/ViewBase.h) which in turn
calls the controller's OKButton method. (The ViewBase method exists
only because : 
	/** These shortcuts allow (e.g. xform's) global callback functions
	    access to the buttons without making the whole controller_
	    public. */

So, ultimately, pressing button_ok on the Citation dialog calls
ControlBase::OKButton(). 

void ControlBase::OKButton()
{
	apply();
	hide();
	bc().ok();
}


apply() and hide() are pure virtual methods, instantiated in
ControlInset.h because the Citation dialog is an inset dialog and all
insets are functionally identical. 

template <class Inset, class Params>
void ControlInset<Inset, Params>::apply()
{
	if (lv_.buffer()->isReadonly())
		return;

	view().apply();

	if (inset_ && params() != getParams(*inset_))
		applyParamsToInset();
	else
		applyParamsNoInset();
}

applyParamsToInset() and applyParamsNoInset(); are to be found in
FormCommand.[Ch] because the citation inset is derived from
InsetCommand and this subset of insets have identical internal
structure and so the params can be applied in the same way.