1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 2001 The LyX Team.
8 * ======================================================
10 * \file ControlConnections.C
11 * \author Angus Leeming <a.leeming@ic.ac.uk>
17 #pragma implementation
20 #include "ControlConnections.h"
25 #include "frontends/LyXView.h"
27 #include <boost/bind.hpp>
29 ControlConnectBase::ControlConnectBase(LyXView & lv, Dialogs & d)
34 void ControlConnectBase::connect()
37 connect(boost::bind(&ControlConnectBase::redraw, this));
40 void ControlConnectBase::disconnect()
47 void ControlConnectBase::redraw()
53 bool ControlConnectBase::isReadonly() const
58 return lv_.buffer()->isReadonly();
62 ControlConnectBase::DocTypes ControlConnectBase::docType() const
67 if (lv_.buffer()->isLatex())
69 else if (lv_.buffer()->isLiterate())
71 else if (lv_.buffer()->isLinuxDoc())
73 /* else if (lv_.buffer()->isDocBook()) */
78 ControlConnectBI::ControlConnectBI(LyXView & lv, Dialogs & d)
79 : ControlConnectBase(lv, d)
83 void ControlConnectBI::connect()
85 h_ = d_.hideAll.connect(boost::bind(&ControlConnectBI::hide, this));
86 ControlConnectBase::connect();
89 ControlConnectBD::ControlConnectBD(LyXView & lv, Dialogs & d)
90 : ControlConnectBase(lv, d)
94 void ControlConnectBD::connect()
96 u_ = d_.updateBufferDependent.
97 connect(boost::bind(&ControlConnectBD::updateSlot, this, _1));
98 h_ = d_.hideBufferDependent.
99 connect(boost::bind(&ControlConnectBD::hide, this));
100 ControlConnectBase::connect();
103 void ControlConnectBD::disconnect()
106 ControlConnectBase::disconnect();