xref: /haiku/src/servers/registrar/MessageEvent.h (revision 268f99dd7dc4bd7474a8bd2742d3f1ec1de6752a)
15293aa41SIngo Weinhold //------------------------------------------------------------------------------
2*2ca13760SColdfirex //	Copyright (c) 2001-2002, Haiku
35293aa41SIngo Weinhold //
45293aa41SIngo Weinhold //	Permission is hereby granted, free of charge, to any person obtaining a
55293aa41SIngo Weinhold //	copy of this software and associated documentation files (the "Software"),
65293aa41SIngo Weinhold //	to deal in the Software without restriction, including without limitation
75293aa41SIngo Weinhold //	the rights to use, copy, modify, merge, publish, distribute, sublicense,
85293aa41SIngo Weinhold //	and/or sell copies of the Software, and to permit persons to whom the
95293aa41SIngo Weinhold //	Software is furnished to do so, subject to the following conditions:
105293aa41SIngo Weinhold //
115293aa41SIngo Weinhold //	The above copyright notice and this permission notice shall be included in
125293aa41SIngo Weinhold //	all copies or substantial portions of the Software.
135293aa41SIngo Weinhold //
145293aa41SIngo Weinhold //	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
155293aa41SIngo Weinhold //	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
165293aa41SIngo Weinhold //	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
175293aa41SIngo Weinhold //	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
185293aa41SIngo Weinhold //	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
195293aa41SIngo Weinhold //	FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
205293aa41SIngo Weinhold //	DEALINGS IN THE SOFTWARE.
215293aa41SIngo Weinhold //
225293aa41SIngo Weinhold //	File Name:		MessageEvent.h
235293aa41SIngo Weinhold //	Author:			Ingo Weinhold (bonefish@users.sf.net)
245293aa41SIngo Weinhold //					YellowBites (http://www.yellowbites.com)
255293aa41SIngo Weinhold //	Description:	A special event that sends a message when executed.
265293aa41SIngo Weinhold //------------------------------------------------------------------------------
275293aa41SIngo Weinhold 
285293aa41SIngo Weinhold #ifndef MESSAGE_EVENT_H
295293aa41SIngo Weinhold #define MESSAGE_EVENT_H
305293aa41SIngo Weinhold 
315293aa41SIngo Weinhold #include <Message.h>
325293aa41SIngo Weinhold #include <Messenger.h>
335293aa41SIngo Weinhold 
345293aa41SIngo Weinhold #include "Event.h"
355293aa41SIngo Weinhold 
365293aa41SIngo Weinhold class BHandler;
375293aa41SIngo Weinhold 
385293aa41SIngo Weinhold class MessageEvent : public Event {
395293aa41SIngo Weinhold public:
405293aa41SIngo Weinhold 	MessageEvent(bigtime_t time, BHandler* handler, uint32 command);
415293aa41SIngo Weinhold 	MessageEvent(bigtime_t time, BHandler* handler, const BMessage *message);
425293aa41SIngo Weinhold 	MessageEvent(bigtime_t time, const BMessenger& messenger, uint32 command);
435293aa41SIngo Weinhold 	MessageEvent(bigtime_t time, const BMessenger& messenger,
445293aa41SIngo Weinhold 				 const BMessage *message);
455293aa41SIngo Weinhold 	virtual ~MessageEvent();
465293aa41SIngo Weinhold 
475293aa41SIngo Weinhold 	virtual bool Do(EventQueue *queue);
485293aa41SIngo Weinhold 
49553ea301SIngo Weinhold protected:
505293aa41SIngo Weinhold 	BMessage			fMessage;
515293aa41SIngo Weinhold 	BMessenger			fMessenger;
525293aa41SIngo Weinhold 	BHandler			*fHandler;
535293aa41SIngo Weinhold };
545293aa41SIngo Weinhold 
555293aa41SIngo Weinhold #endif	// MESSAGE_EVENT_H
56