NAME

Skype::Any::Handler - Handler interface for Skype::Any

METHODS

$handler->handlers($name, $property)

Get handlers you registered.

$handler->register($name, sub { ... })

Register _ (default) handler.

$handler->register($name, +{$property => sub { ... }, ...});

Register $name handler and you can register named handler below.

Command

Call 'Command' handler when you sent the command.

$handler->register(Command => sub {
    my $command = shift; # Skype::Any::Command
});
Notify

Call 'Notify' handler when you received the notification.

$handler->register(Notify => sub {
    my $notification = shift;
    my $command = Skype::Any::Command->new($notification);
    my ($obj, $id, $property, $value) = $command->split_reply();

    ...
});
Reply

Call 'Reply' handler when you sent the command and reply it.

$handler->register(Reply => sub {
    my $reply = shift; # Skype::Any::Command

    ...
});
Error

Call 'Error' handler when you received error notification or reply.

$handler->register(Error => sub {
    my $error = shift; # Skype::Any::Error
});
$handler->call($name, $property => @args)

Call specified handler.

$handler->clear($name[, $property])

Clear specified handler.

$handler->clear_all($name[, $property])

Clear all of specified handlers.