1//-------------------------------------------------------------------- 2// 3// PostDispatchInvoker.h 4// 5// Written by: Owen Smith 6// 7//-------------------------------------------------------------------- 8 9/* 10 Copyright 1999, Be Incorporated. All Rights Reserved. 11 This file may be used under the terms of the Be Sample Code License. 12*/ 13 14#ifndef _PostDispatchInvoker_h 15#define _PostDispatchInvoker_h 16 17#include <MessageFilter.h> 18#include <Invoker.h> 19 20//==================================================================== 21// CLASS: PostDispatchInvoker 22// --------------------------- 23// A simple kind of message filter which, when it receives a 24// message of the target type, dispatches it directly to the 25// looper, then posts a message to a specified handler when 26// the dispatch is completed. Two fields are appended to the 27// message before it is delivered: 28// Dispatched Message B_MESSAGE_TYPE 29// Dispatch Target B_POINTER_TYPE (BHandler*) 30// 31// Most message filters are designed to intercept messages 32// before they're delievered; this one allows you to do some 33// handling after they've been delivered. 34 35class PostDispatchInvoker : public BMessageFilter, public BInvoker 36{ 37 //---------------------------------------------------------------- 38 // Constructors, destructors, operators 39 40public: 41 PostDispatchInvoker(uint32 cmdFilter, 42 BMessage* invokeMsg, BHandler* invokeHandler, 43 BLooper* invokeLooper = NULL); 44 45 46 //---------------------------------------------------------------- 47 // Virtual member function overrides 48 49public: 50 filter_result Filter(BMessage* message, BHandler** target); 51}; 52 53#endif /* _PostDispatchInvoker_h */