2 * \file ControlConnections.C
3 * Read the file COPYING
5 * \author Angus Leeming
7 * Full author contact details are available in file CREDITS
13 #pragma implementation
16 #include "ControlConnections.h"
21 #include "BufferView.h"
23 #include "frontends/Dialogs.h"
24 #include "frontends/LyXView.h"
26 #include <boost/bind.hpp>
28 ControlConnectBase::ControlConnectBase(LyXView & lv, Dialogs & d)
33 void ControlConnectBase::connect()
36 connect(boost::bind(&ControlConnectBase::redraw, this));
39 void ControlConnectBase::disconnect()
46 void ControlConnectBase::redraw()
52 bool ControlConnectBase::bufferIsReadonly() const
57 return lv_.buffer()->isReadonly();
61 bool ControlConnectBase::bufferIsAvailable() const
66 return lv_.view()->available();
70 BufferView * ControlConnectBase::bufferview()
72 return lv_.view().get();
76 BufferView const * ControlConnectBase::bufferview() const
78 return lv_.view().get();
82 Buffer * ControlConnectBase::buffer()
88 Buffer const * ControlConnectBase::buffer() const
94 LyXFunc & ControlConnectBase::lyxfunc()
96 return lv_.getLyXFunc();
100 LyXFunc const & ControlConnectBase::lyxfunc() const
102 return lv_.getLyXFunc();
106 ControlConnectBase::DocTypes ControlConnectBase::docType() const
111 if (lv_.buffer()->isLatex())
113 else if (lv_.buffer()->isLiterate())
115 else if (lv_.buffer()->isLinuxDoc())
117 /* else if (lv_.buffer()->isDocBook()) */
122 ControlConnectBI::ControlConnectBI(LyXView & lv, Dialogs & d)
123 : ControlConnectBase(lv, d)
127 void ControlConnectBI::connect()
129 h_ = d_.hideAll.connect(boost::bind(&ControlConnectBI::hide, this));
130 ControlConnectBase::connect();
133 ControlConnectBD::ControlConnectBD(LyXView & lv, Dialogs & d)
134 : ControlConnectBase(lv, d)
138 void ControlConnectBD::connect()
140 u_ = d_.updateBufferDependent.
141 connect(boost::bind(&ControlConnectBD::updateSlot, this, _1));
142 h_ = d_.hideBufferDependent.
143 connect(boost::bind(&ControlConnectBD::hide, this));
144 ControlConnectBase::connect();
147 void ControlConnectBD::disconnect()
150 ControlConnectBase::disconnect();