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()
nodeA 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)
refA 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)
sizeAn integer icon size constant. The version with this parameter returns a Bitmap object; the other version returns a byte string.
colorSpaceAn integer color space constant, the color space of the returned Bitmap; defaults to
B_RGBA32, but also acceptsB_RGBA32andB_CMAP8.iconA Bitmap, the new icon; should be a
32x32or16x16image.dataA 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)
verbAn app verb constant; the default is B_OPEN (which is also the only verb currently defined).
signatureAn 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)
nodeA 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)
refA 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)
refA path to the file, folder, or symlink to get an icon for.
nodeinfoA 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.
sizeAn integer icon size constant. The version with this parameter returns a Bitmap object; the other version returns a byte string.
colorSpaceAn integer color space constant, the color space of the returned Bitmap; defaults to
B_RGBA32.