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"
25 /** Base class to control connection/disconnection of signals with the LyX
26 kernel for dialogs NOT used with insets.
27 The Base class will be either ControlConnectBI or ControlConnectBD.
30 class ControlDialog : public Base
34 ControlDialog(LyXView &, Dialogs &);
41 /// Update the dialog.
42 virtual void update();
45 virtual void clearParams() {}
46 /// set the params before show or update
47 virtual void setParams() {}
52 #include "BufferView.h"
55 ControlDialog<Base>::ControlDialog(LyXView & lv, Dialogs & d)
61 void ControlDialog<Base>::show()
63 if (isBufferDependent() && !lv_.view()->available())
68 bc().readOnly(isReadonly());
73 void ControlDialog<Base>::update()
75 if (isBufferDependent() && !lv_.view()->available())
80 bc().readOnly(isReadonly());
85 void ControlDialog<Base>::hide()
93 #endif // CONTROLDIALOGS_H