Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations
MessageFilter.h File Reference

Provides BMessageFilter class. More...

Classes

class  BMessageFilter
 Describes a message filter for BLooper and BHandler. More...
 

Typedefs

typedef filter_result(* filter_hook) (BMessage *message, BHandler **target, BMessageFilter *filter)
 Prototype for a custom filter_hook for use in the BMessageFilter class.
 

Enumerations

enum  filter_result {
  B_SKIP_MESSAGE ,
  B_DISPATCH_MESSAGE
}
 
enum  message_delivery {
  B_ANY_DELIVERY ,
  B_DROPPED_DELIVERY ,
  B_PROGRAMMED_DELIVERY
}
 
enum  message_source {
  B_ANY_SOURCE ,
  B_REMOTE_SOURCE ,
  B_LOCAL_SOURCE
}
 

Detailed Description

Provides BMessageFilter class.

Typedef Documentation

◆ filter_hook

filter_result(* filter_hook)(BMessage *message, BHandler **target, BMessageFilter *filter)

Prototype for a custom filter_hook for use in the BMessageFilter class.

This hook can be used when you are constructing a new BMessageFilter object. It is a custom filter function you can use.

This hook should handle the following parameters:

Parameters
[in]messageThe message that needs to be verified.
[out]targetIf your filter hook is conscious about the available handlers, you can set a specific BHandler based on your filters requirements. You do not have to change this field, because there will always be a working default.
[in]filterA pointer to the filter from which this hook is called.
Returns
You should return B_SKIP_MESSAGE in case the message does not conform to the filter criteria, or B_DISPATCH_MESSAGE if the message passes these criteria.
See also
BMessageFilter(uint32, filter_hook)
BMessageFilter(message_delivery, message_source, filter_hook)
BMessageFilter(message_delivery, message_source, uint32, filter_hook)
Since
BeOS R3

Enumeration Type Documentation

◆ filter_result

Enumerator
B_SKIP_MESSAGE 

The message does not pass the filter criteria and should not be handled.

Since
BeOS R3
B_DISPATCH_MESSAGE 

The message passes the filter criteria and should be dispatched to a BHandler.

Since
BeOS R3

◆ message_delivery

Enumerator
B_ANY_DELIVERY 

Accept both delivery methods.

Since
BeOS R3
B_DROPPED_DELIVERY 

Only accept messages that were dropped by the user in the GUI.

Since
BeOS R3
B_PROGRAMMED_DELIVERY 

Only accept messages that were delivered using the BLooper::PostMessage() method.

Since
BeOS R3

◆ message_source

Enumerator
B_ANY_SOURCE 

Accept both local and remote messages.

Since
BeOS R3
B_REMOTE_SOURCE 

Only accept messages from a remote source, so from other applications.

Since
BeOS R3
B_LOCAL_SOURCE 

Only accept messages from your own local application.

Since
BeOS R3