2 * \file ControlConnections.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Angus Leeming
8 * Full author contact details are available in file CREDITS
14 #include "ControlConnections.h"
19 #include "BufferView.h"
21 #include "frontends/Dialogs.h"
22 #include "frontends/LyXView.h"
24 #include <boost/bind.hpp>
27 ControlConnectBase::ControlConnectBase(LyXView & lv, Dialogs & d)
32 void ControlConnectBase::connect()
35 connect(boost::bind(&ControlConnectBase::redraw, this));
38 void ControlConnectBase::disconnect()
45 void ControlConnectBase::redraw()
51 bool ControlConnectBase::bufferIsReadonly() const
56 return lv_.buffer()->isReadonly();
60 bool ControlConnectBase::bufferIsAvailable() const
65 return lv_.view()->available();
69 BufferView * ControlConnectBase::bufferview()
71 return lv_.view().get();
75 BufferView const * ControlConnectBase::bufferview() const
77 return lv_.view().get();
81 Buffer * ControlConnectBase::buffer()
87 Buffer const * ControlConnectBase::buffer() const
93 LyXFunc & ControlConnectBase::lyxfunc()
95 return lv_.getLyXFunc();
99 LyXFunc const & ControlConnectBase::lyxfunc() const
101 return lv_.getLyXFunc();
105 ControlConnectBase::DocTypes ControlConnectBase::docType() const
110 if (lv_.buffer()->isLatex())
112 else if (lv_.buffer()->isLiterate())
114 else if (lv_.buffer()->isLinuxDoc())
116 /* else if (lv_.buffer()->isDocBook()) */
121 ControlConnectBI::ControlConnectBI(LyXView & lv, Dialogs & d)
122 : ControlConnectBase(lv, d)
126 void ControlConnectBI::connect()
128 h_ = d_.hideAllSignal.connect(boost::bind(&ControlConnectBI::hide, this));
129 ControlConnectBase::connect();
132 ControlConnectBD::ControlConnectBD(LyXView & lv, Dialogs & d)
133 : ControlConnectBase(lv, d)
137 void ControlConnectBD::connect()
139 u_ = d_.updateBufferDependentSignal.
140 connect(boost::bind(&ControlConnectBD::updateSlot, this, _1));
141 h_ = d_.hideBufferDependentSignal.
142 connect(boost::bind(&ControlConnectBD::hide, this));
143 ControlConnectBase::connect();
146 void ControlConnectBD::disconnect()
149 ControlConnectBase::disconnect();