Haiku API Bindings
MessageFilter
Not logged in

Documentation | ApplicationKit | MessageFilter

SYNOPSIS

Perl

use HaikuR1::MessageFilter qw(B_ANY_DELIVERY B_ANY_SOURCE);

my $filter1 = HaikuR1::MessageFilter->new(...);
my $filter2 = HaikuR1::MessageFilter->new($filter1);

$handler->AddFilter($filter1);
$handler->AddFilter($filter2);

Python

from HaikuR1.ApplicationKit import MessageFilter, B_ANY_DELIVERY B_ANY_SOURCE

filter1 = MessageFilter(...)
filter2 = MessageFilter(filter1)

handler->AddFilter(filter1)
handler->AddFilter(filter2)

DESCRIPTION

Exposes the BMessageFilter object.

For more information on MessageFilter, see the Be Book class description, the Be Book overview, and the Haiku Book class description.

METHODS

Constructor

Creates a MessageFilter.

Perl

HaikuR1::MessageFilter->new($copy_from);
HaikuR1::MessageFilter->new(
    delivery => $delivery,
    source   => $source,
    what     => $what,
    hook     => $hook,
);

Python

MessageFilter(copy_from)
MessageFilter(
    delivery = delivery,
    source   = source,
    what     = what,
    hook     = hook,
)

copy

Copies the contents of another object into this object.

Perl

$messagefilter->copy($copy_from);

Python

messagefilter.copy(copy_from)

Command

Returns the command (the what of the message being filtered).

Perl

$messagefilter->Command();

Python

messagefilter.Command()

FiltersAnyCommand

Returns true if no message command was specified for the filter; false if a command was specified.

Perl

$messagefilter->FiltersAnyCommand();

Python

messagefilter.FiltersAnyCommand()

Looper

Returns the Looper whose messages are filtered by this filter, or the empty value if the filter has not been assigned to a Looper. (Note: When a Looper is deleted, or when its SetFilterList has been called to replace or remove the filter list, all filters assigned to it will be deleted.)

Perl

$messagefilter->Looper();

Python

messagefilter.Looper()

MessageDelivery

Returns the delivery method.

Perl

$messagefilter->MessageDelivery();

Python

messagefilter.MessageDelivery()

MessageSource

Returns the source type.

Perl

$messagefilter->MessageSource();

Python

messagefilter.MessageSource()

HOOKS

Filter

Called to filter a Message; should return the new target Handler (which may be the same as the original target), or the empty value if the Message should be skipped.

Perl

$messagefilter->Filter($message, $target);

Python

messagefilter.Filter(message, target)

CONSTANTS

Message delivery methods

Perl

use HaikuR1::Roster qw(:message_delivery)

Python

Python does not support export tags.

Message source types

Perl

use HaikuR1::Roster qw(:message_source)

Python

Python does not support export tags.