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 #pragma implementation
17 #include "ControlConnections.h"
22 #include "BufferView.h"
24 #include "frontends/Dialogs.h"
25 #include "frontends/LyXView.h"
27 #include <boost/bind.hpp>
30 ControlConnectBase::ControlConnectBase(LyXView & lv, Dialogs & d)
35 void ControlConnectBase::connect()
38 connect(boost::bind(&ControlConnectBase::redraw, this));
41 void ControlConnectBase::disconnect()
48 void ControlConnectBase::redraw()
54 bool ControlConnectBase::bufferIsReadonly() const
59 return lv_.buffer()->isReadonly();
63 bool ControlConnectBase::bufferIsAvailable() const
68 return lv_.view()->available();
72 BufferView * ControlConnectBase::bufferview()
74 return lv_.view().get();
78 BufferView const * ControlConnectBase::bufferview() const
80 return lv_.view().get();
84 Buffer * ControlConnectBase::buffer()
90 Buffer const * ControlConnectBase::buffer() const
96 LyXFunc & ControlConnectBase::lyxfunc()
98 return lv_.getLyXFunc();
102 LyXFunc const & ControlConnectBase::lyxfunc() const
104 return lv_.getLyXFunc();
108 ControlConnectBase::DocTypes ControlConnectBase::docType() const
113 if (lv_.buffer()->isLatex())
115 else if (lv_.buffer()->isLiterate())
117 else if (lv_.buffer()->isLinuxDoc())
119 /* else if (lv_.buffer()->isDocBook()) */
124 ControlConnectBI::ControlConnectBI(LyXView & lv, Dialogs & d)
125 : ControlConnectBase(lv, d)
129 void ControlConnectBI::connect()
131 h_ = d_.hideAll.connect(boost::bind(&ControlConnectBI::hide, this));
132 ControlConnectBase::connect();
135 ControlConnectBD::ControlConnectBD(LyXView & lv, Dialogs & d)
136 : ControlConnectBase(lv, d)
140 void ControlConnectBD::connect()
142 u_ = d_.updateBufferDependent.
143 connect(boost::bind(&ControlConnectBD::updateSlot, this, _1));
144 h_ = d_.hideBufferDependent.
145 connect(boost::bind(&ControlConnectBD::hide, this));
146 ControlConnectBase::connect();
149 void ControlConnectBD::disconnect()
152 ControlConnectBase::disconnect();