Documentation | StorageKit | NodeInfo
NAME
NodeInfo
VERSION
0.01
SYNOPSIS
Perl
use HaikuR1::NodeInfo; my $info = HaikuR1::NodeInfo->new($node); my $app = $info->GetPreferredApp();
Python
from HaikuR1.SotrageKit import NodeInfo info = NodeInfo(node) 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
HaikuR1::NodeInfo->new($node); HaikuR1::NodeInfo->new();
Python
NodeInfo(node) NodeInfo()
node
A Node to base the NodeInfo on.
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
$nodeinfo->GetAppHint(); $nodeinfo->SetAppHint($ref);
Python
nodeinfo.GetAppHint() nodeinfo.SetAppHint(ref)
ref
A string, the path to the desired application.
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
$nodeinfo->GetIcon($size, $colorSpace); $nodeinfo->GetIcon(); $nodeinfo->SetIcon($icon); $nodeinfo->SetIcon($data);
Python
nodeinfo.GetIcon(size, colorSpace) nodeinfo.GetIcon() nodeinfo.SetIcon(icon) nodeinfo.SetIcon(data)
size
An integer icon size constant. The version with this parameter returns a Bitmap object; the other version returns a byte string.
colorSpace
An integer color space constant, the color space of the returned Bitmap; defaults to
B_RGBA32
, but also acceptsB_RGBA32
andB_CMAP8
.icon
A Bitmap, the new icon; should be a
32x32
or16x16
image.data
A byte string containing icon 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
$nodeinfo->GetPreferredApp($verb); $nodeinfo->SetPreferredApp($signature, $verb);
Python
nodeinfo.GetPreferredApp(verb) nodeinfo.SetPreferredApp(signature, verb)
verb
An app verb constant; the default is B_OPEN (which is also the only verb currently defined).
signature
An application signature.
SetTo
SetTo
Updates the NodeInfo object to refer to the given node.
refers to any node.
Perl
$nodeinfo->SetTo($node);
Python
nodeinfo.SetTo(node)
node
A Node, the new target of the NodeInfo.
Type
GetType
SetType
Gets or sets the MIME type for the node.
Perl
$nodeinfo->GetType(); $nodeinfo->SetType($type);
Python
nodeinfo.GetType() nodeinfo.SetType(type)
ref
A MIME type string.
CLASS METHODS
GetTrackerIcon
Gets the icon used by Tracker to represent the node.
Perl
HaikuR1::NodeInfo->GetTrackerIcon($ref, $size, $colorSpace); $nodeinfo->GetTrackerIcon($size, $colorSpace);
Python
NodeInfo.GetTrackerIcon(ref, size, colorSpace) NodeInfo.GetTrackerIcon(nodeinfo, size, colorSpace)
ref
A path to the file, folder, or symlink to get an icon for.
nodeinfo
A NodeInfo object to get an icon for.
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.
size
An integer icon size constant. The version with this parameter returns a Bitmap object; the other version returns a byte string.
colorSpace
An integer color space constant, the color space of the returned Bitmap; defaults to
B_RGBA32
.