Provides C and Haiku-only C++ MIME-type handling functions. More...
Enumerations | |
enum | { B_UPDATE_MIME_INFO_NO_FORCE = 0 , B_UPDATE_MIME_INFO_FORCE_KEEP_TYPE = 1 , B_UPDATE_MIME_INFO_FORCE_UPDATE_ALL = 2 } |
enum | icon_size { B_LARGE_ICON = 32 , B_MINI_ICON = 16 } |
Functions | |
status_t | create_app_meta_mime (const char *path, int recursive, int synchronous, int force) |
Creates a MIME database entry for one or more applications. | |
status_t | get_device_icon (const char *device, BBitmap *icon, icon_size which) |
Retrieves an icon associated with a given device into a BBitmap, C++ only. | |
status_t | get_device_icon (const char *device, uint8 **_data, size_t *_size, type_code *_type) |
Try to get the icon by name first, if that fails try to get the vector icon, C++ only. | |
status_t | get_device_icon (const char *device, void *icon, int32 size) |
Retrieves an icon associated with a given device. | |
status_t | get_named_icon (const char *name, BBitmap *icon, icon_size which) |
Get the icon by name, C++ only. | |
status_t | get_named_icon (const char *name, uint8 **_data, size_t *_size, type_code *_type) |
Get the icon by name, C++ only. | |
int | update_mime_info (const char *path, int recursive, int synchronous, int force) |
Updates the MIME information (i.e MIME type) for one or more files. | |
Provides C and Haiku-only C++ MIME-type handling functions.
anonymous enum |
enum icon_size |
status_t create_app_meta_mime | ( | const char * | path, |
int | recursive, | ||
int | synchronous, | ||
int | force | ||
) |
Creates a MIME database entry for one or more applications.
If path points to an application file, a MIME DB entry is create for the application. If it points to a directory and recursive is not NULL
then entries are created for all application files in the given directory tree. If path is NULL
then all files are considered and recursive is ignored.
path | The path to an application file, a directory, or NULL . |
recursive | Trigger recursive behavior if not NULL . |
synchronous | Waits until the operation is finished if not NULL , otherwise it returns immediately and the operation is done asynchronously. |
force | Entries are created even if they do already exist if not NULL . |
B_OK
if everything went fine, an error code otherwise.Retrieves an icon associated with a given device into a BBitmap, C++ only.
device | The path to the device. |
icon | A 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). |
which | The size of the icon to retrieve. Currently 16 (B_MINI_ICON ) and 32 (B_LARGE_ICON ) are supported. |
B_OK
if everything went fine, an error code otherwise. B_OK | Retrieved the icon successfully. |
B_BAD_VALUE | device or icon was NULL . |
Try to get the icon by name first, if that fails try to get the vector icon, C++ only.
device | The path to the device. |
_data | A pointer to a pointer to an array of uint8 pixel data to fill out. |
_size | The size of the icon to fill out. If vector, it is filled in with the width in pixels, if bitmap, one of the following constants:
|
_type | The icon type code to fill out, one of the following:
|
B_OK
if everything went fine, an error code otherwise. B_OK | Retrieved the icon successfully. |
B_BAD_VALUE | device, _data, _size, or _type was NULL . |
Retrieves an icon associated with a given device.
device | The path to the device. |
icon | A pointer to a buffer the icon data shall be written to. |
size | The size of the icon to retrieve. Currently 16 (B_MINI_ICON ) and 32 (B_LARGE_ICON ) are supported. |
B_OK
if everything went fine, an error code otherwise. B_OK | Retrieved the icon successfully. |
B_BAD_VALUE | device or icon was NULL . |
B_NO_MEMORY | Ran out of memory allocating bitmap. |
Get the icon by name, C++ only.
name | The name of the icon to get. |
icon | A 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). |
which | The size of the icon to retrieve. Currently 16 (B_MINI_ICON ) and 32 (B_LARGE_ICON ) are supported. |
B_OK
if everything went fine, an error code otherwise. B_OK | Retrieved the icon successfully. |
B_BAD_VALUE | name or icon was NULL . |
Get the icon by name, C++ only.
name | The name of the icon to get. |
_data | A pointer to a pointer to an array of uint8 pixel data to fill out. |
_size | The size of the icon to fill out. If vector, it is filled in with the width in pixels, if bitmap, one of the following constants:
|
_type | The icon type code to fill out, one of the following:
|
B_OK
if everything went fine, an error code otherwise. B_OK | Retrieved the icon successfully. |
B_BAD_VALUE | name, _data, _size, or _type was NULL . |
int update_mime_info | ( | const char * | path, |
int | recursive, | ||
int | synchronous, | ||
int | force | ||
) |
Updates the MIME information (i.e MIME type) for one or more files.
If path points to a file, the MIME information for this file are updated only. If it points to a directory and recursive is non-null, the information for all the files in the given directory tree are updated. If path is NULL
all files are considered; recursive is ignored in this case.
path | The path to a file or directory, or NULL . |
recursive | Triggers recursive behavior if not NULL . |
synchronous | If not NULL update_mime_info() waits until the operation is finished, otherwise it returns immediately and the update is done asynchronously. |
force | Specifies how to handle files that already have MIME information. See enum definitions for more information:
|
B_OK
if everything went fine, an error code otherwise.