Loading...
Searching...
No Matches
Public Member Functions | List of all members
BAppFileInfo Class Reference

Provides access to the metadata associated with executables, libraries and add-ons. More...

Inherits BNodeInfo.

Public Member Functions

 BAppFileInfo ()
 Creates an uninitialized BAppFileInfo object.
 
 BAppFileInfo (BFile *file)
 Creates an BAppFileInfo object and initializes it to the supplied file.
 
virtual ~BAppFileInfo ()
 Frees all resources associated with this object.
 
status_t SetTo (BFile *file)
 Initializes the BAppFileInfo to the supplied file.
 
MIME Type
virtual status_t GetType (char *type) const
 Gets the MIME type of the associated file.
 
virtual status_t SetType (const char *type)
 Sets the MIME type of the associated file.
 
Signature
status_t GetSignature (char *signature) const
 Gets the application signature of the associated file.
 
status_t SetSignature (const char *signature)
 Sets the application signature of the associated file.
 
Catalog Entry
status_t GetCatalogEntry (char *catalogEntry) const
 Gets the catalog entry of the associated file used for localization.
 
status_t SetCatalogEntry (const char *catalogEntry)
 Sets the catalog entry of the associated file used for localization.
 
Application Flags
status_t GetAppFlags (uint32 *flags) const
 Gets the application flags of the associated file.
 
status_t SetAppFlags (uint32 flags)
 Sets the application flags of the associated file.
 
status_t RemoveAppFlags ()
 Removes the application flags from the associated file.
 
Supported MIME Types
status_t GetSupportedTypes (BMessage *types) const
 Gets the MIME types supported by the application.
 
status_t SetSupportedTypes (const BMessage *types, bool updateMimeDB, bool syncAll)
 Sets the MIME types that are supported by the application and allows you to specify whether or not the supported types in the MIME DB shall be updated as well.
 
status_t SetSupportedTypes (const BMessage *types, bool syncAll)
 Sets the MIME types that are supported by the application and allows you to specify whether or not the no longer supported types shall be updated as well.
 
status_t SetSupportedTypes (const BMessage *types)
 Sets the MIME types supported by the application.
 
bool IsSupportedType (const char *type) const
 Returns whether the application supports the supplied MIME type.
 
bool Supports (BMimeType *type) const
 Returns whether the application supports the supplied MIME type explicitly.
 
Application Icon
virtual status_t GetIcon (BBitmap *icon, icon_size which) const
 Gets the icon of the associated file and puts it into a pre-allocated BBitmap.
 
status_t SetIcon (const BBitmap *icon, icon_size which, bool updateMimeDB)
 Sets the icon of the associated file from a BBitmap.
 
virtual status_t SetIcon (const BBitmap *icon, icon_size which)
 Sets the icon of the associated file from a BBitmap.
 
status_t GetIcon (uint8 **data, size_t *size) const
 Gets the icon of the associated file and puts it into a buffer.
 
status_t SetIcon (const uint8 *data, size_t size, bool updateMimeDB)
 Sets the icon of the associated file from a buffer.
 
status_t SetIcon (const uint8 *data, size_t size)
 Sets the icon of the associated file from a buffer.
 
status_t GetIconForType (const char *type, BBitmap *icon, icon_size which) const
 Gets the icon the application provides for a given MIME type and puts it into a BBitmap.
 
status_t GetIconForType (const char *type, uint8 **data, size_t *size) const
 Gets the icon the application provides for a given MIME type and puts it into a buffer.
 
status_t SetIconForType (const char *type, const BBitmap *icon, icon_size which, bool updateMimeDB)
 Sets the icon the application provides for a given MIME type from a BBitmap.
 
status_t SetIconForType (const char *type, const BBitmap *icon, icon_size which)
 Sets the icon the application provides for a given MIME type from a BBitmap.
 
status_t SetIconForType (const char *type, const uint8 *data, size_t size, bool updateMimeDB)
 Sets the icon the application provides for a given MIME type from a buffer.
 
status_t SetIconForType (const char *type, const uint8 *data, size_t size)
 Sets the icon the application provides for a given MIME type from a buffer.
 
Version Info
status_t GetVersionInfo (version_info *info, version_kind kind) const
 Gets the version info of the associated file.
 
status_t SetVersionInfo (const version_info *info, version_kind kind)
 Sets the version info of the associated file.
 
Attributes/Resources
void SetInfoLocation (info_location location)
 Specifies the location where the metadata shall be stored.
 
bool IsUsingAttributes () const
 Returns whether the object (also) stores the metadata in the attributes of the associated file.
 
bool IsUsingResources () const
 Returns whether the object (also) stores the metadata in the resources of the associated file.
 
- Public Member Functions inherited from BNodeInfo
 BNodeInfo ()
 Creates an uninitialized BNodeInfo object.
 
 BNodeInfo (BNode *node)
 Creates a BNodeInfo object and initializes it to the supplied node.
 
virtual ~BNodeInfo ()
 Frees the object and associated resources.
 
status_t SetTo (BNode *node)
 Initializes the BNodeInfo to the supplied node.
 
status_t InitCheck () const
 Checks whether or not the object has been properly initialized.
 
status_t GetPreferredApp (char *signature, app_verb verb=B_OPEN) const
 Gets the preferred application of the node.
 
status_t SetPreferredApp (const char *signature, app_verb verb=B_OPEN)
 Sets the preferred application of the node. If signature is NULL, the BEOS:PREF_APP attribute is removed instead.
 
status_t GetAppHint (entry_ref *ref) const
 Fills out ref with a pointer to a hint about the application that will open this node.
 
status_t SetAppHint (const entry_ref *ref)
 Sets the application that will open the file type of the node. If ref is NULL, the BEOS:PPATH attribute is removed instead.
 
status_t GetIcon (uint8 **data, size_t *size, type_code *type) const
 Gets the icon of the node.
 
status_t SetIcon (const uint8 *data, size_t size)
 Sets the node icon of the node. If data is NULL or size is 0, the BEOS:ICON attribute is removed instead.
 
status_t GetTrackerIcon (BBitmap *icon, icon_size which=B_LARGE_ICON) const
 Gets the icon displayed by Tracker for the icon.
 

Additional Inherited Members

- Static Public Member Functions inherited from BNodeInfo
static status_t GetTrackerIcon (const entry_ref *ref, BBitmap *icon, icon_size which=B_LARGE_ICON)
 Gets the icon displayed by Tracker for the node referred to by ref.
 

Detailed Description

Provides access to the metadata associated with executables, libraries and add-ons.

The BAppFileInfo class allows for information about an executable or add-on to be accessed or set. Information about an executable that can be accessed include the signature, catalog entry, supported MIME types, application flags, icon(s), and version info.

You should initialize the BAppFileInfo with a BFile object that represents the executable or add-on that you want to access. If you only want to read metadata from the file you do not have to open it for reading. However, if you also want to write metadata then you should open the BFile for writing.

To associate a BFile with a BAppFileInfo object you can either pass the BFile object into the constructor or you can use the empty constructor and then use the SetTo() method to set the BFile to the BAppFileInfo object.

When accessing information from a BFileInfo object it will first look in the attributes of the BFile. If the information is not found then the BFileInfo object will next look at the resource of the BFile. You can tell the BFileInfo object to look only in the attributes or resources with the SetInfoLocation() method.

Since
BeOS R3

Constructor & Destructor Documentation

◆ BAppFileInfo() [1/2]

BAppFileInfo::BAppFileInfo ( )

Creates an uninitialized BAppFileInfo object.

Since
BeOS R3

◆ BAppFileInfo() [2/2]

BAppFileInfo::BAppFileInfo ( BFile file)

Creates an BAppFileInfo object and initializes it to the supplied file.

The caller retains ownership of the supplied BFile object. It must not be deleted during the life time of the BAppFileInfo. It is not deleted when the BAppFileInfo is destroyed.

Parameters
fileThe BFile object that the BAppFileInfo object shall be initialized to.
Since
BeOS R3

◆ ~BAppFileInfo()

BAppFileInfo::~BAppFileInfo ( )
virtual

Frees all resources associated with this object.

The supplied BFile object is not deleted if one is specified.

Since
BeOS R3

Member Function Documentation

◆ GetAppFlags()

status_t BAppFileInfo::GetAppFlags ( uint32 flags) const

Gets the application flags of the associated file.

Parameters
flagsA pointer to a pre-allocated uint32 into which the application flags of the file are written.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUENULL flags.
B_BAD_TYPEThe attribute/resources the flags are stored in have the wrong type.
B_ENTRY_NOT_FOUNDNo application flags are set on the file.
Since
BeOS R3

◆ GetCatalogEntry()

status_t BAppFileInfo::GetCatalogEntry ( char *  catalogEntry) const

Gets the catalog entry of the associated file used for localization.

Parameters
catalogEntryA pointer to a pre-allocated character buffer of size B_MIME_TYPE_LENGTH * 3 or larger into which the catalog entry of the file will be written.
Returns
a status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUENULL catalogEntry or the entry stored in the attribute/resources is longer than B_MIME_TYPE_LENGTH * 3.
B_BAD_TYPEThe attribute/resources the entry is stored in have the wrong type.
B_ENTRY_NOT_FOUNDNo catalog entry is set on the file.
Since
Haiku R1

◆ GetIcon() [1/2]

status_t BAppFileInfo::GetIcon ( BBitmap icon,
icon_size  which 
) const
virtual

Gets the icon of the associated file and puts it into a pre-allocated BBitmap.

Parameters
iconA pointer to a pre-allocated BBitmap of the correct dimension to store the requested icon (16x16 for the B_MINI_ICON and 32x32 for the B_LARGE_ICON).
whichSpecifies the size of the icon to be retrieved: B_MINI_ICON for the mini and B_LARGE_ICON for the large icon. For HVIF icons this parameter has no effect.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUENULL icon, unsupported icon size which or bitmap dimensions (icon) and icon size (which) do not match.
Since
BeOS R3

Reimplemented from BNodeInfo.

◆ GetIcon() [2/2]

status_t BAppFileInfo::GetIcon ( uint8 **  data,
size_t *  size 
) const

Gets the icon of the associated file and puts it into a buffer.

Parameters
dataThe pointer in which the flat icon data will be returned.
sizeThe pointer in which the size of the data found will be returned.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUENULL data or NULL size.
Since
BeOS R3

◆ GetIconForType() [1/2]

status_t BAppFileInfo::GetIconForType ( const char *  type,
BBitmap icon,
icon_size  size 
) const

Gets the icon the application provides for a given MIME type and puts it into a BBitmap.

Note
If type is NULL, the application's icon is retrieved.
Parameters
typeThe MIME type in question. May be NULL.
iconA pointer to a pre-allocated BBitmap of the correct dimension to store the requested icon (16x16 for the mini and 32x32 for the large icon).
sizeSpecifies the size of the icon to be retrieved: B_MINI_ICON for the mini and B_LARGE_ICON for the large icon.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUENULL icon, unsupported icon size which or bitmap dimensions (icon) and icon size (which) do not match.
Since
BeOS R3

◆ GetIconForType() [2/2]

status_t BAppFileInfo::GetIconForType ( const char *  type,
uint8 **  data,
size_t *  size 
) const

Gets the icon the application provides for a given MIME type and puts it into a buffer.

Note
If type is set to NULL the the application's icon is retrieved.
Parameters
typeThe MIME type in question. May be NULL.
dataA pointer in which the icon data will be returned. When you are done with the data, you should use free() to deallocate it.
sizeA pointer in which the size of the retrieved data is returned.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUENULL data and/or size. Or the supplied type is not a valid MIME type.
Since
Haiku R1

◆ GetSignature()

status_t BAppFileInfo::GetSignature ( char *  signature) const

Gets the application signature of the associated file.

Parameters
signatureA pointer to a pre-allocated character buffer of size B_MIME_TYPE_LENGTH or larger into which the application signature of the file will be written.
Returns
a status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUENULL signature or the signature stored in the attribute/resources is longer than B_MIME_TYPE_LENGTH.
B_BAD_TYPEThe attribute/resources the signature is stored in have the wrong type.
B_ENTRY_NOT_FOUNDNo signature is set on the file.
Since
BeOS R3

◆ GetSupportedTypes()

status_t BAppFileInfo::GetSupportedTypes ( BMessage types) const

Gets the MIME types supported by the application.

The supported MIME types are added to a field "types" of type B_STRING_TYPE in types.

Parameters
typesA pointer to a pre-allocated BMessage into which the MIME types supported by the application will be written.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUENULL types.
B_BAD_TYPEThe attribute/resources that the supported types are stored in have the wrong type.
B_ENTRY_NOT_FOUNDNo supported types are set on the file.
Since
BeOS R3

◆ GetType()

status_t BAppFileInfo::GetType ( char *  type) const
virtual

Gets the MIME type of the associated file.

Parameters
typeA pointer to a pre-allocated character buffer of size B_MIME_TYPE_LENGTH or larger into which the MIME type of the file will be written.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUENULL type or the type string stored in the attribute/resources is longer than B_MIME_TYPE_LENGTH.
B_BAD_TYPEThe attribute/resources the type string is stored in has the wrong type.
B_ENTRY_NOT_FOUNDNo type is set on the file.
Since
BeOS R3

Reimplemented from BNodeInfo.

◆ GetVersionInfo()

status_t BAppFileInfo::GetVersionInfo ( version_info *  info,
version_kind  kind 
) const

Gets the version info of the associated file.

Parameters
infoA pointer to a pre-allocated version_info structure into which the version info should be written.
kindSpecifies the kind of the version info to be retrieved:
  • B_APP_VERSION_KIND for the application's version info and
  • B_SYSTEM_VERSION_KIND for the suite's info the application belongs to.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUENULL info.
Since
BeOS R3

◆ IsSupportedType()

bool BAppFileInfo::IsSupportedType ( const char *  type) const

Returns whether the application supports the supplied MIME type.

If the application supports the wildcard type "application/octet-stream" then this method returns true for any MIME type.

Parameters
typeThe MIME type in question.
Returns
true if type is a valid MIME type and it is supported by the application, false otherwise.
Since
BeOS R3

◆ IsUsingAttributes()

bool BAppFileInfo::IsUsingAttributes ( ) const

Returns whether the object (also) stores the metadata in the attributes of the associated file.

Returns
true if the metadata are (also) stored in the file's attributes, false otherwise.
Since
BeOS R3

◆ IsUsingResources()

bool BAppFileInfo::IsUsingResources ( ) const

Returns whether the object (also) stores the metadata in the resources of the associated file.

Returns
true if the metadata are (also) stored in the file's resources, false otherwise.
Since
BeOS R3

◆ RemoveAppFlags()

status_t BAppFileInfo::RemoveAppFlags ( )

Removes the application flags from the associated file.

Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object was not properly initialized.
Since
Haiku R1

◆ SetAppFlags()

status_t BAppFileInfo::SetAppFlags ( uint32  flags)

Sets the application flags of the associated file.

Parameters
flagsThe application flags to be assigned to the file.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object was not properly initialized.
Since
BeOS R3

◆ SetCatalogEntry()

status_t BAppFileInfo::SetCatalogEntry ( const char *  catalogEntry)

Sets the catalog entry of the associated file used for localization.

If catalogEntry is NULL the file's catalog entry is unset.

Parameters
catalogEntryThe catalog entry to be assigned to the file. Of the form "x-vnd.Haiku-app:context:name". Must not be longer than B_MIME_TYPE_LENGTH * 3 (including the terminating \0). The catalogEntry may be NULL.
Returns
a status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUEcatalogEntry is longer than B_MIME_TYPE_LENGTH * 3.
Since
Haiku R1

◆ SetIcon() [1/4]

status_t BAppFileInfo::SetIcon ( const BBitmap icon,
icon_size  which 
)
virtual

Sets the icon of the associated file from a BBitmap.

If icon is NULL then the icon of the file is unset.

Also sets the application's icon in the MIME DB, if the file has a valid application signature.

Parameters
iconA pointer to the BBitmap containing the icon to be set. May be NULL to specify no icon.
whichSpecifies the size of the icon to be set: B_MINI_ICON for 16x16 mini icon and B_LARGE_ICON for the 32x32 large icon. For HVIF icons this parameter has no effect.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUEUnknown icon size which or bitmap dimensions (icon) and icon size (which) do not match.
Since
BeOS R3

Reimplemented from BNodeInfo.

◆ SetIcon() [2/4]

status_t BAppFileInfo::SetIcon ( const BBitmap icon,
icon_size  which,
bool  updateMimeDB 
)

Sets the icon of the associated file from a BBitmap.

If icon is NULL then the icon of the file is unset.

Parameters
iconA pointer to the BBitmap containing the icon to be set. May be NULL to specify no icon.
whichSpecifies the size of the icon to be set: B_MINI_ICON for 16x16 mini icon and B_LARGE_ICON for the 32x32 large icon. For HVIF icons this parameter has no effect.
updateMimeDBtrue to also set the icon for the application in the MIME DB. false otherwise.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUEUnknown icon size which or bitmap dimensions (icon) and icon size (which) do not match.
Since
Haiku R1

◆ SetIcon() [3/4]

status_t BAppFileInfo::SetIcon ( const uint8 data,
size_t  size 
)

Sets the icon of the associated file from a buffer.

If data is NULL then the icon of the file is unset.

Also sets the application's icon in the MIME DB, if the file has a valid application signature.

Parameters
dataA pointer to the data buffer containing the vector icon to be set. May be NULL.
sizeSpecifies the size of buffer pointed to by data.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUENULL data.
Since
Haiku R1

◆ SetIcon() [4/4]

status_t BAppFileInfo::SetIcon ( const uint8 data,
size_t  size,
bool  updateMimeDB 
)

Sets the icon of the associated file from a buffer.

If data is NULL then the icon of the file is unset.

Parameters
dataA pointer to the data buffer containing the vector icon to be set. May be NULL.
sizeSpecifies the size of buffer pointed to by data.
updateMimeDBtrue to also set the icon for the application in the MIME DB. false otherwise.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUENULL data.
Since
Haiku R1

◆ SetIconForType() [1/4]

status_t BAppFileInfo::SetIconForType ( const char *  type,
const BBitmap icon,
icon_size  which 
)

Sets the icon the application provides for a given MIME type from a BBitmap.

Note
If type is NULL then the icon is set.
If icon is NULL then the icon is unset.

If the file has a signature, then the icon is also set on the MIME type. If the type for the signature has not been installed yet, it is installed before.

Parameters
typeThe MIME type in question. May be NULL.
iconA pointer to the BBitmap containing the icon to be set. May be NULL.
whichSpecifies the size of the icon to be set: B_MINI_ICON for the mini and B_LARGE_ICON for the large icon.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUEEither the icon size which is unknown, the bitmap dimensions (icon) and icon size (which) do not match, or the provided type is not a valid MIME type.
Since
BeOS R3

◆ SetIconForType() [2/4]

status_t BAppFileInfo::SetIconForType ( const char *  type,
const BBitmap icon,
icon_size  which,
bool  updateMimeDB 
)

Sets the icon the application provides for a given MIME type from a BBitmap.

Note
If type is NULL then the icon is set.
If icon is NULL then the icon is unset.

If updateMimeDB is true and if the file has a signature, then the icon is also set on the MIME type. If the type for the signature has not been installed yet, it is installed before.

Parameters
typeThe MIME type in question. May be NULL.
iconA pointer to the BBitmap containing the icon to be set. May be NULL.
whichSpecifies the size of the icon to be set: B_MINI_ICON for the mini and B_LARGE_ICON for the large icon.
updateMimeDBtrue to also set the icon for the type in the MIME DB. false otherwise.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUEEither the icon size which is unknown, the bitmap dimensions (icon) and icon size (which) do not match, or the provided type is not a valid MIME type.
Since
Haiku R1

◆ SetIconForType() [3/4]

status_t BAppFileInfo::SetIconForType ( const char *  type,
const uint8 data,
size_t  size 
)

Sets the icon the application provides for a given MIME type from a buffer.

Note
If type is NULL then the icon is set.
If data is NULL then the icon is unset.

If the file has a signature, then the icon is also set on the MIME type. If the type for the signature has not been installed yet, it is installed before.

Parameters
typeThe MIME type in question. May be NULL.
dataA pointer to the data containing the icon to be set. May be NULL.
sizeSpecifies the size of buffer provided in data.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUEThe provided type is not a valid MIME type.
Since
Haiku R1

◆ SetIconForType() [4/4]

status_t BAppFileInfo::SetIconForType ( const char *  type,
const uint8 data,
size_t  size,
bool  updateMimeDB 
)

Sets the icon the application provides for a given MIME type from a buffer.

Note
If type is NULL then the icon is set.
If data is NULL then the icon is unset.

If updateMimeDB is true and if the file has a signature, then the icon is also set on the MIME type. If the type for the signature has not been installed yet, it is installed before.

Parameters
typeThe MIME type in question. May be NULL.
dataA pointer to the data containing the icon to be set. May be NULL.
sizeSpecifies the size of buffer provided in data.
updateMimeDBtrue to also set the icon for the type in the MIME DB. false otherwise.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUEThe provided type is not a valid MIME type.
Since
Haiku R1

◆ SetInfoLocation()

void BAppFileInfo::SetInfoLocation ( info_location  location)

Specifies the location where the metadata shall be stored.

The options for location are:

  • B_USE_ATTRIBUTES: Store the data in the attributes.
  • B_USE_RESOURCES: Store the data in the resources.
  • B_USE_BOTH_LOCATIONS: Store the data in attributes and resources.
Parameters
locationThe location where the metadata shall be stored.
Since
BeOS R3

◆ SetSignature()

status_t BAppFileInfo::SetSignature ( const char *  signature)

Sets the application signature of the associated file.

If signature is NULL the file's application signature is unset.

Parameters
signatureThe application signature to be assigned to the file. Must not be longer than B_MIME_TYPE_LENGTH (including the terminating \0). The signature may be NULL.
Returns
a status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUEsignature is longer than B_MIME_TYPE_LENGTH.
Since
BeOS R3

◆ SetSupportedTypes() [1/3]

status_t BAppFileInfo::SetSupportedTypes ( const BMessage types)

Sets the MIME types supported by the application.

This method is a short-hand for SetSupportedTypes(types, false).

See also
SetSupportedType(const BMessage*, bool) for detailed information.
Parameters
typesThe supported types to be assigned to the file. May be NULL.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
Since
BeOS R3

◆ SetSupportedTypes() [2/3]

status_t BAppFileInfo::SetSupportedTypes ( const BMessage types,
bool  syncAll 
)

Sets the MIME types that are supported by the application and allows you to specify whether or not the no longer supported types shall be updated as well.

If types is NULL then the application's supported types are unset.

The supported MIME types must be stored in a field "types" of type B_STRING_TYPE in types.

The method informs the registrar about this news. For each supported type the result of BMimeType::GetSupportingApps() will afterwards include the signature of this application. That is, the application file needs to have a signature set.

syncAll specifies whether the no longer supported types shall be updated as well, i.e. whether or not this application shall be removed from the list of supporting applications.

Parameters
typesThe supported types to be assigned to the file. May be NULL.
syncAlltrue to also synchronize the no-longer supported types, false otherwise.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
Since
BeOS R3

◆ SetSupportedTypes() [3/3]

status_t BAppFileInfo::SetSupportedTypes ( const BMessage types,
bool  updateMimeDB,
bool  syncAll 
)

Sets the MIME types that are supported by the application and allows you to specify whether or not the supported types in the MIME DB shall be updated as well.

If types is NULL then the application's supported types are unset.

The supported MIME types must be stored in a field "types" of type B_STRING_TYPE in types.

If updateMimeDB is true, the method will inform the registrar about this news. In this case for each supported type the result of BMimeType::GetSupportingApps() will afterward include the signature of this application. That is, the application file needs to have a signature set.

syncAll specifies whether the no longer supported types shall be updated as well, i.e. whether or not this application shall be removed from the list of supporting applications. Only relevant when updateMimeDB is true.

Parameters
typesThe supported types to be assigned to the file. May be NULL.
updateMimeDBtrue to update the supported types in the MIME DB, false otherwise.
syncAlltrue to also synchronize the no-longer supported types, false otherwise.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
Since
BeOS R3

◆ SetTo()

status_t BAppFileInfo::SetTo ( BFile file)

Initializes the BAppFileInfo to the supplied file.

The caller retains ownership of the supplied BFile object. It must not be deleted during the life time of the BAppFileInfo. The BFile object is not deleted when the BAppFileInfo is destroyed.

Parameters
fileThe BFile object that the BAppFileInfo object shall be initialized to.
Returns
an status code.
Return values
B_OKEverything went fine.
B_BAD_VALUENULL file or file is not properly initialized.
Since
BeOS R3

◆ SetType()

status_t BAppFileInfo::SetType ( const char *  type)
virtual

Sets the MIME type of the associated file.

If type is NULL if the file's MIME type is unset.

Parameters
typeThe MIME type to be assigned to the file. It must not be longer than B_MIME_TYPE_LENGTH (including the terminating \0). The MIME type may be NULL.
Returns
a status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
B_BAD_VALUEtype is longer than B_MIME_TYPE_LENGTH.
Since
BeOS R3

Reimplemented from BNodeInfo.

◆ SetVersionInfo()

status_t BAppFileInfo::SetVersionInfo ( const version_info *  info,
version_kind  kind 
)

Sets the version info of the associated file.

Note
If info is set to NULL then the file's version info is unset.
Parameters
infoThe version info to be set. May be NULL.
kindSpecifies kind of version info to be set:
  • B_APP_VERSION_KIND for the application's version info and
  • B_SYSTEM_VERSION_KIND for the suite's info the application belongs to.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_INITThe object is not properly initialized.
Since
BeOS R3

◆ Supports()

bool BAppFileInfo::Supports ( BMimeType type) const

Returns whether the application supports the supplied MIME type explicitly.

Unlike IsSupportedType(), this method returns true, only if the type is explicitly supported, regardless of whether it supports "application/octet-stream".

Parameters
typeThe MIME type in question.
Returns
true if type is a valid MIME type and it is explicitly supported by the application, false otherwise.
Since
BeOS R3