]> Shamusworld >> Repos - architektonas/blob - src/base/rs_commandevent.cpp
Major refactoring of actions: Moved implementation from header files
[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 // (C) 2010 Underground Software
7 //
8 // JLH = James L. Hammons <jlhamm@acm.org>
9 //
10 // Who  When        What
11 // ---  ----------  -----------------------------------------------------------
12 // JLH  06/02/2010  Added this text. :-)
13 // JLH  06/02/2010  Moved implementation from header to here WHERE IT BELONGS.
14 //
15
16 #include "rs_commandevent.h"
17
18 /**
19  * Creates a new command event that is not yet accepted.
20  *
21  * @param cmd the command that was triggered.
22  */
23 RS_CommandEvent::RS_CommandEvent(const QString & cmd)
24 {
25         this->cmd = cmd;
26         accepted = false;
27 }
28
29 /**
30  * @return the command that was triggered, usually by
31  * the user.
32  */
33 QString RS_CommandEvent::getCommand()
34 {
35         return cmd;
36 }
37
38 /**
39  * Sets the event state to accepted.
40  */
41 void RS_CommandEvent::accept()
42 {
43         accepted = true;
44 }
45
46 /**
47  * @return Whether the event was already accepted or not.
48  */
49 bool RS_CommandEvent::isAccepted()
50 {
51         return accepted;
52 }