Haiku API Bindings
NodeInfo
Not logged in

Documentation | StorageKit | NodeInfo

NAME

NodeInfo

VERSION

0.01

SYNOPSIS

Perl

Python

use HaikuR1::NodeInfo;

my $info = HaikuR1::NodeInfo->new($node);
my $app = $info->GetPreferredApp();

DESCRIPTION

Exposes the BNodeInfo object.

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

METHODS

Constructor

Creates a NodeInfo.

Perl

Python

HaikuR1::NodeInfo->new($node);
HaikuR1::NodeInfo->new();

App hint

GetAppHint

SetAppHint

Gets or sets the application hint for the node. This is a path on the file system, not an application signature, so this may break if the file is moved.

Perl

Python

$nodeinfo->GetAppHint();
$nodeinfo->SetAppHint($ref);

Icon

GetIcon

SetIcon

Gets the volume's icon. If you pass a size, then it returns a Bitmap; otherwise, it returns two items: the raw icon data and the type.

(Currently the type is always B_VECTOR_ICON_TYPE.)

Perl

Python

$nodeinfo->GetIcon($size, $colorSpace);
$nodeinfo->GetIcon();
$nodeinfo->SetIcon($icon);
$nodeinfo->SetIcon($data);

Preferred App

GetPreferredApp

SetPreferredApp

Gets or sets the preferred application for the node (i.e., the file, folder, or symlink found at the node).

Perl

Python

$nodeinfo->GetPreferredApp($verb);
$nodeinfo->SetPreferredApp($signature, $verb);

SetTo

SetTo Updates the NodeInfo object to refer to the given node. refers to any node.

Perl

Python

$nodeinfo->SetTo($node);

Type

GetType

SetType

Gets or sets the MIME type for the node.

Perl

Python

$nodeinfo->GetType();
$nodeinfo->SetType($type);

CLASS METHODS

GetTrackerIcon

Gets the icon used by Tracker to represent the node.

Perl

Python

HaikuR1::NodeInfo->GetTrackerIcon($ref, $size, $colorSpace);
$nodeinfo->GetTrackerIcon($size, $colorSpace);

Perl

The Perl version functions as both a class method and an instance method, so you call the method on nodeinfo instead of passing it as the first parameter.