Haiku API Bindings
AppFileInfo
Not logged in

Documentation | StorageKit | AppFileInfo

NAME

AppFileInfo

VERSION

0.01

SYNOPSIS

Perl

use HaikuR1::AppFileInfo;

my $info = HaikuR1::AppFileInfo->new($file);
my $bitmap = $info->GetIcon(B_LARGE_ICON);

Python

from HaikuR1.StorageKit import HaikuR1.AppFileInfo

info = AppFileInfo(file);
bitmap = info.GetIcon(B_LARGE_ICON);

DESCRIPTION

Exposes the BAppFileInfo object.

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

METHODS

Constructor

Creates an AppFileInfo.

Perl

HaikuR1::AppFileInfo->new($filename, $openMode);
HaikuR1::AppFileInfo->new();

Python

AppFileInfo(file, openMode)
AppFileInfo()

Application flags

GetAppFlags

SetAppFlags

RemoveAppFlags

Gets or sets the application flags.

Perl

$appfileinfo->GetAppFlags();
$appfileinfo->SetAppFlags($flags);
$appfileinfo->RemoveAppFlags();

Python

appfileinfo.GetAppFlags()
appfileinfo.SetAppFlags(flags)
appfileinfo.RemoveAppFlags()

Catalog entry

GetCatalogEntry

SetCatalogEntry

Gets or sets the catalog entry, which is a colon-separated list of the following elements:

For example: x-vnd.Be-TRAK:System name:Tracker

Perl

$appfileinfo->GetCatalogEntry();
$appfileinfo->SetCatalogEntry($catalogEntry);

Python

appfileinfo.GetCatalogEntry()
appfileinfo.SetCatalogEntry(catalogEntry)

Icons

GetIcon

SetIcon

GetIconForType

SetIconForType

Gets the application's icon. If you pass a size, then it returns a Bitmap; otherwise, it the raw icon data.

The Type versions work on the icon that the application will use for the given type.

Perl

$mimetype->GetIcon($size, $colorSpace);
$mimetype->GetIcon();
$mimetype->SetIcon($icon, $updateMimeDB);
$mimetype->SetIcon($data, $updateMimeDB);
$mimetype->GetIconForType($type, $size, $colorSpace);
$mimetype->GetIconForType();
$mimetype->SetIconForType($type, $icon, $updateMimeDB);
$mimetype->SetIconForType($type, $data, $updateMimeDB);

Python

mimetype.GetIcon(size, colorSpace)
mimetype.GetIcon()
mimetype.SetIcon(icon, updateMimeDB)
mimetype.SetIcon(data, updateMimeDB)
mimetype.GetIconForType(type, size)
mimetype.GetIconForType(type, size, colorSpace)
mimetype.SetIconForType(type, icon, updateMimeDB)
mimetype.SetIconForType(type, data, updateMimeDB)

Info location

SetInfoLocation

IsUsingAttributes

IsUsingResources

Gets or sets whether the AppFileInfo stores information in attributes or resources. (It can use both.)

Perl

$appfileinfo->SetInfoLocation($location);
$appfileinfo->IsUsingAttributes();
$appfileinfo->IsUsingResources();

Python

appfileinfo.SetInfoLocation(location)
appfileinfo.IsUsingAttributes()
appfileinfo.IsUsingResources()

SetTo

Points the AppFileInfo at a file.

Perl

$appfileinfo->SetTo($file, $openMode);

Python

appfileinfo.SetTo(file, openMode)

Signature

GetSignature

SetSignature

Gets or sets the application signature.

Perl

$appfileinfo->GetSignature();
$appfileinfo->SetSignature($signature);

Python

appfileinfo.GetSignature()
appfileinfo.SetSignature(signature)

Supported types

GetSupportedTypes

SetSupportedTypes

IsSupportedType

Supports

These methods do what you expect.

Note that IsSupportedType will always return true if the application represented by the AppFileInfo supports the application/octet-stream type (i.e., can support any type by treating it as a string of bytes), but Supports will only return true when the application explicitly supports the type.

Perl

$appfileinfo->GetSupportedTypes($types);
$appfileinfo->SetSupportedTypes($types, $updateMimeDB, $syncAll);
$appfileinfo->IsSupportedType($type);
$appfileinfo->Supports($type);

Python

appfileinfo.GetSupportedTypes(types)
appfileinfo.SetSupportedTypes(types, updateMimeDB, syncAll)
appfileinfo.IsSupportedType(type)
appfileinfo.Supports(type)

Version info

GetVersionInfo

SetVersionInfo

Gets or sets the version info, which is a native map with the following fields:

Perl

$appfileinfo->GetVersionInfo($kind);
$appfileinfo->SetVersionInfo($info, $kind);

Python

appfileinfo.GetVersionInfo(kind)
appfileinfo.SetVersionInfo(info, kind)

CONSTANTS

Location

Perl

use HaikuR1::AppFileInfo qw(:info_location)

Python

Python does not support export tags.

Version kinds

Perl

use HaikuR1::AppFileInfo qw(:version_kind)

Python

Python does not support export tags.

Version varieties

Perl

use HaikuR1::AppFileInfo qw(:info_variety)

Python

Python does not support export tags.