FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
dropevent.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2019 by the FIFE team *
3  * http://www.fifengine.net *
4  * This file is part of FIFE. *
5  * *
6  * FIFE is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU Lesser General Public *
8  * License as published by the Free Software Foundation; either *
9  * version 2.1 of the License, or (at your option) any later version. *
10  * *
11  * This library is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * Lesser General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU Lesser General Public *
17  * License along with this library; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20  ***************************************************************************/
21 
22 #ifndef FIFE_EVENTCHANNEL_DROPEVENT_H
23 #define FIFE_EVENTCHANNEL_DROPEVENT_H
24 
25 // Standard C++ library includes
26 //
27 
28 // 3rd party library includes
29 //
30 
31 // FIFE includes
32 // These includes are split up in two parts, separated by one empty line
33 // First block: files included from the FIFE root src directory
34 // Second block: files included from the same folder
35 //
38 
39 namespace FIFE {
40 
43  class DropEvent: public InputEvent {
44  public:
45 
49  InputEvent(),
50  m_path("") {}
51 
54  virtual ~DropEvent() {}
55 
58  const std::string& getPath() const { return m_path; }
59 
62  void setPath(const std::string& path) { m_path = path; }
63 
66  virtual void consume() { InputEvent::consume(); }
67 
70  virtual bool isConsumed() const { return InputEvent::isConsumed(); }
71 
75 
78  virtual bool isConsumedByWidgets() const { return InputEvent::isConsumedByWidgets(); }
79 
82  virtual IEventSource* getSource() const { return InputEvent::getSource(); }
83 
86  virtual void setSource(IEventSource* source) { InputEvent::setSource(source); }
87 
90  virtual int32_t getTimeStamp() const { return InputEvent::getTimeStamp(); }
91 
94  virtual void setTimeStamp(int32_t timestamp ) { InputEvent::setTimeStamp(timestamp); }
95 
98  virtual const std::string& getName() const {
99  const static std::string eventName("DropEvent");
100  return eventName;
101  }
102 
105  virtual std::string getDebugString() const { return InputEvent::getDebugString(); }
106 
107  private:
108  std::string m_path;
109  };
110 
111 } //FIFE
112 
113 #endif
virtual bool isConsumedByWidgets() const
Checks whether event is consumed by widget library.
Definition: inputevent.h:96
DropEvent()
Constructor.
Definition: dropevent.h:48
void setPath(const std::string &path)
Sets the path for the file that is droped.
Definition: dropevent.h:62
virtual IEventSource * getSource() const
Gets the source of the event.
Definition: dropevent.h:82
virtual int32_t getTimeStamp() const
Gets the timestamp of the event.
Definition: dropevent.h:90
Base class for input events (like mouse and keyboard)
Definition: inputevent.h:42
virtual void setSource(IEventSource *source)
Sets the source of the event.
Definition: dropevent.h:86
virtual bool isConsumed() const
Checks whether event is consumed.
Definition: dropevent.h:70
virtual void setTimeStamp(int32_t timestamp)
Sets the timestamp of the event.
Definition: inputevent.h:120
virtual bool isConsumed() const
Checks whether event is consumed.
Definition: inputevent.h:104
virtual bool isConsumedByWidgets() const
Checks whether event is consumed by widget library.
Definition: dropevent.h:78
virtual void consumedByWidgets()
Marks events as consumed by widget library.
Definition: inputevent.h:92
virtual const std::string & getName() const
Gets the name of the event.
Definition: dropevent.h:98
const std::string & getPath() const
Gets the path for the file that is droped.
Definition: dropevent.h:58
virtual std::string getDebugString() const
Gets the debugstring of the event.
Definition: inputevent.h:131
virtual void setTimeStamp(int32_t timestamp)
Sets the timestamp of the event.
Definition: dropevent.h:94
virtual void consumedByWidgets()
Marks events as consumed by widget library.
Definition: dropevent.h:74
virtual int32_t getTimeStamp() const
Gets the timestamp of the event.
Definition: inputevent.h:116
virtual void consume()
Marks events as consumed.
Definition: dropevent.h:66
Class for drop events.
Definition: dropevent.h:43
virtual std::string getDebugString() const
Gets the debugstring of the event.
Definition: dropevent.h:105
std::string m_path
Definition: dropevent.h:108
virtual void setSource(IEventSource *source)
Sets the source of the event.
Definition: inputevent.h:112
virtual void consume()
Marks events as consumed.
Definition: inputevent.h:100
Representation of event source (a thing sending events)
Definition: ieventsource.h:42
virtual ~DropEvent()
Destructor.
Definition: dropevent.h:54
virtual IEventSource * getSource() const
Gets the source of the event.
Definition: inputevent.h:108