]> git.lyx.org Git - lyx.git/blob - src/support/SignalSlot.cpp
fix line endings
[lyx.git] / src / support / SignalSlot.cpp
1 // -*- C++ -*-
2 /**
3  * \file SignalSlot.cpp
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author André Pönitz
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "SignalSlot.h"
15 #include "SignalSlotPrivate.h"
16
17 namespace lyx {
18
19 /////////////////////////////////////////////////////////////////////
20 //
21 // Signal
22 //
23 /////////////////////////////////////////////////////////////////////
24
25 Signal::Signal()
26         : impl(new SignalImpl)
27 {}
28
29
30 Signal::~Signal()
31 {
32         delete impl;
33 }
34
35
36 void Signal::fire()
37 {
38         impl->fire();
39 }
40
41
42 /////////////////////////////////////////////////////////////////////
43 //
44 // Slot
45 //
46 /////////////////////////////////////////////////////////////////////
47
48 void SlotImpl::called()
49 {
50         owner_.called();
51 }
52
53 Slot::Slot()
54         : impl(new SlotImpl(*this))
55 {}
56
57 Slot::~Slot()
58 {
59         delete impl;
60 }
61
62
63 /////////////////////////////////////////////////////////////////////
64 //
65 // Connect
66 //
67 /////////////////////////////////////////////////////////////////////
68
69 void connect(Signal & sig, Slot & slot)
70 {
71         QObject::connect(sig.impl, SIGNAL(fire()), slot.impl, SLOT(called()));
72 }
73
74 } // namespace lyx