2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2001 The LyX Team.
9 * ======================================================
11 * \file ControlDialogs.h
12 * \author Angus Leeming <a.leeming@ic.ac.uk>
14 * ControlDialog is to be used as a parent class for dialogs that are not
15 * views onto parameters of insets. (An ugly description I know, but I hope
16 * the meaning is clear! Can anyone do any better?) Examples would be the
17 * Document and Paragraph dialogs.
20 #ifndef CONTROLDIALOGS_H
21 #define CONTROLDIALOGS_H
23 #include "ControlConnections.h"
26 /** Base class to control connection/disconnection of signals with the LyX
27 kernel for dialogs NOT used with insets.
28 The Base class will be either ControlConnectBI or ControlConnectBD.
31 class ControlDialog : public Base
35 ControlDialog(LyXView &, Dialogs &);
42 /// Update the dialog.
43 virtual void update();
46 virtual void clearParams() {}
47 /// set the params before show or update
48 virtual void setParams() {}
51 /// is the dialog built ?
59 ControlDialog<Base>::ControlDialog(LyXView & lv, Dialogs & d)
60 : Base(lv, d), dialog_built_(false)
65 void ControlDialog<Base>::show()
67 if (isBufferDependent() && !lv_.view()->available())
73 if (emergency_exit_) {
83 bc().readOnly(isReadonly());
88 void ControlDialog<Base>::update()
90 if (isBufferDependent() && !lv_.view()->available())
94 if (emergency_exit_) {
99 bc().readOnly(isReadonly());
103 template <class Base>
104 void ControlDialog<Base>::hide()
106 emergency_exit_ = false;
113 #endif // CONTROLDIALOGS_H