]> Shamusworld >> Repos - architektonas/blob - src/base/rs_commandevent.cpp
724a7a1949d5c8a3d6a55363443df593eabc464f
[architektonas] / src / base / rs_commandevent.cpp
1 // rs_commandevent.cpp
2 //
3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // Portions copyright (C) 2001-2003 RibbonSoft
7 // Copyright (C) 2010 Underground Software
8 // See the README and GPLv2 files for licensing and warranty information
9 //
10 // JLH = James L. Hammons <jlhamm@acm.org>
11 //
12 // Who  When        What
13 // ---  ----------  -----------------------------------------------------------
14 // JLH  06/02/2010  Added this text. :-)
15 // JLH  06/02/2010  Moved implementation from header to here WHERE IT BELONGS.
16 //
17
18 #include "rs_commandevent.h"
19
20 /**
21  * Creates a new command event that is not yet accepted.
22  *
23  * @param cmd the command that was triggered.
24  */
25 RS_CommandEvent::RS_CommandEvent(const QString & cmd)
26 {
27         this->cmd = cmd;
28         accepted = false;
29 }
30
31 /**
32  * @return the command that was triggered, usually by
33  * the user.
34  */
35 QString RS_CommandEvent::getCommand()
36 {
37         return cmd;
38 }
39
40 /**
41  * Sets the event state to accepted.
42  */
43 void RS_CommandEvent::accept()
44 {
45         accepted = true;
46 }
47
48 /**
49  * @return Whether the event was already accepted or not.
50  */
51 bool RS_CommandEvent::isAccepted()
52 {
53         return accepted;
54 }