144c3726bSIngo Weinhold //------------------------------------------------------------------------------ 244c3726bSIngo Weinhold // Copyright (c) 2001-2002, OpenBeOS 344c3726bSIngo Weinhold // 444c3726bSIngo Weinhold // Permission is hereby granted, free of charge, to any person obtaining a 544c3726bSIngo Weinhold // copy of this software and associated documentation files (the "Software"), 644c3726bSIngo Weinhold // to deal in the Software without restriction, including without limitation 744c3726bSIngo Weinhold // the rights to use, copy, modify, merge, publish, distribute, sublicense, 844c3726bSIngo Weinhold // and/or sell copies of the Software, and to permit persons to whom the 944c3726bSIngo Weinhold // Software is furnished to do so, subject to the following conditions: 1044c3726bSIngo Weinhold // 1144c3726bSIngo Weinhold // The above copyright notice and this permission notice shall be included in 1244c3726bSIngo Weinhold // all copies or substantial portions of the Software. 1344c3726bSIngo Weinhold // 1444c3726bSIngo Weinhold // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1544c3726bSIngo Weinhold // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1644c3726bSIngo Weinhold // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 1744c3726bSIngo Weinhold // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1844c3726bSIngo Weinhold // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 1944c3726bSIngo Weinhold // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 2044c3726bSIngo Weinhold // DEALINGS IN THE SOFTWARE. 2144c3726bSIngo Weinhold // 2244c3726bSIngo Weinhold // File Name: Event.h 2344c3726bSIngo Weinhold // Author: Ingo Weinhold (bonefish@users.sf.net) 2444c3726bSIngo Weinhold // YellowBites (http://www.yellowbites.com) 2544c3726bSIngo Weinhold // Description: Base class for events as handled by EventQueue. 2644c3726bSIngo Weinhold //------------------------------------------------------------------------------ 2744c3726bSIngo Weinhold 2844c3726bSIngo Weinhold #ifndef EVENT_H 2944c3726bSIngo Weinhold #define EVENT_H 3044c3726bSIngo Weinhold 3144c3726bSIngo Weinhold #include <OS.h> 3244c3726bSIngo Weinhold 33*c2b2c7d9SIngo Weinhold class EventQueue; 34*c2b2c7d9SIngo Weinhold 3544c3726bSIngo Weinhold class Event { 3644c3726bSIngo Weinhold public: 3744c3726bSIngo Weinhold Event(bool autoDelete = true); 3844c3726bSIngo Weinhold Event(bigtime_t time, bool autoDelete = true); 3944c3726bSIngo Weinhold virtual ~Event(); 4044c3726bSIngo Weinhold 4144c3726bSIngo Weinhold void SetTime(bigtime_t time); 4244c3726bSIngo Weinhold bigtime_t Time() const; 4344c3726bSIngo Weinhold 4444c3726bSIngo Weinhold void SetAutoDelete(bool autoDelete); 4544c3726bSIngo Weinhold bool IsAutoDelete() const; 4644c3726bSIngo Weinhold 47*c2b2c7d9SIngo Weinhold virtual bool Do(EventQueue *queue); 4844c3726bSIngo Weinhold 4944c3726bSIngo Weinhold private: 5044c3726bSIngo Weinhold bigtime_t fTime; 5144c3726bSIngo Weinhold bool fAutoDelete; 5244c3726bSIngo Weinhold }; 5344c3726bSIngo Weinhold 5444c3726bSIngo Weinhold #endif // EVENT_H 55