1a33f8fbdSAdrien Destugues/* 2*b885e90eSJohn Scipione * Copyright 2011-2014 Haiku, Inc. All rights reserved. 3820dca4dSJohn Scipione * Distributed under the terms of the MIT License. 4a33f8fbdSAdrien Destugues * 5820dca4dSJohn Scipione * Authors: 6820dca4dSJohn Scipione * John Scipione, jscipione@gmail.com 7820dca4dSJohn Scipione * Ingo Weinhold, bonefish@users.sf.net 8820dca4dSJohn Scipione * 9a33f8fbdSAdrien Destugues * Corresponds to: 10*b885e90eSJohn Scipione * headers/os/storage/AppFileInfo.h hrev47402 11*b885e90eSJohn Scipione * src/kits/storage/AppFileInfo.cpp hrev47402 12a33f8fbdSAdrien Destugues */ 13a33f8fbdSAdrien Destugues 14a33f8fbdSAdrien Destugues 15a33f8fbdSAdrien Destugues/*! 16a33f8fbdSAdrien Destugues \file AppFileInfo.h 17820dca4dSJohn Scipione \ingroup storage 18820dca4dSJohn Scipione \ingroup libbe 19a33f8fbdSAdrien Destugues \brief Provides the BAppFileInfo class. 20a33f8fbdSAdrien Destugues*/ 21a33f8fbdSAdrien Destugues 22a33f8fbdSAdrien Destugues 23a33f8fbdSAdrien Destugues/*! 24a33f8fbdSAdrien Destugues \class BAppFileInfo 25a33f8fbdSAdrien Destugues \ingroup storage 26820dca4dSJohn Scipione \ingroup libbe 27a33f8fbdSAdrien Destugues \brief Provides access to the metadata associated with executables, 28a33f8fbdSAdrien Destugues libraries and add-ons. 29a33f8fbdSAdrien Destugues 30a33f8fbdSAdrien Destugues The BAppFileInfo class allows for information about an executable or 31a33f8fbdSAdrien Destugues add-on to be accessed or set. Information about an executable that can be 32a33f8fbdSAdrien Destugues accessed include the signature, catalog entry, supported MIME types, 33a33f8fbdSAdrien Destugues application flags, icon(s), and version info. 34a33f8fbdSAdrien Destugues 35a33f8fbdSAdrien Destugues You should initialize the BAppFileInfo with a BFile object that represents 36a33f8fbdSAdrien Destugues the executable or add-on that you want to access. If you only want to read 37a33f8fbdSAdrien Destugues metadata from the file you do not have to open it for reading. However, if 38a33f8fbdSAdrien Destugues you also want to write metadata then you should open the BFile for writing. 39a33f8fbdSAdrien Destugues 40a33f8fbdSAdrien Destugues To associate a BFile with a BAppFileInfo object you can either pass the 41a33f8fbdSAdrien Destugues BFile object into the constructor or you can use the empty constructor and 42a33f8fbdSAdrien Destugues then use the SetTo() method to set the BFile to the BAppFileInfo object. 43a33f8fbdSAdrien Destugues 44a33f8fbdSAdrien Destugues When accessing information from a BFileInfo object it will first look in the 45a33f8fbdSAdrien Destugues attributes of the BFile. If the information is not found then the BFileInfo 46a33f8fbdSAdrien Destugues object will next look at the resource of the BFile. You can tell the 47a33f8fbdSAdrien Destugues BFileInfo object to look only in the attributes or resources with the 48a33f8fbdSAdrien Destugues SetInfoLocation() method. 49*b885e90eSJohn Scipione 50*b885e90eSJohn Scipione \since BeOS R3 51a33f8fbdSAdrien Destugues*/ 52a33f8fbdSAdrien Destugues 53a33f8fbdSAdrien Destugues 54a33f8fbdSAdrien Destugues/*! 55a33f8fbdSAdrien Destugues \fn BAppFileInfo::BAppFileInfo() 56a33f8fbdSAdrien Destugues \brief Creates an uninitialized BAppFileInfo object. 57*b885e90eSJohn Scipione 58*b885e90eSJohn Scipione \since BeOS R3 59a33f8fbdSAdrien Destugues*/ 60a33f8fbdSAdrien Destugues 61a33f8fbdSAdrien Destugues 62a33f8fbdSAdrien Destugues/*! 63a33f8fbdSAdrien Destugues \fn BAppFileInfo::BAppFileInfo(BFile* file) 64a33f8fbdSAdrien Destugues \brief Creates an BAppFileInfo object and initializes it to the supplied 65a33f8fbdSAdrien Destugues file. 66a33f8fbdSAdrien Destugues 67a33f8fbdSAdrien Destugues The caller retains ownership of the supplied BFile object. It must not 68a33f8fbdSAdrien Destugues be deleted during the life time of the BAppFileInfo. It is not deleted 69a33f8fbdSAdrien Destugues when the BAppFileInfo is destroyed. 70a33f8fbdSAdrien Destugues 71a33f8fbdSAdrien Destugues \param file The BFile object that the BAppFileInfo object shall be 72a33f8fbdSAdrien Destugues initialized to. 73*b885e90eSJohn Scipione 74*b885e90eSJohn Scipione \since BeOS R3 75a33f8fbdSAdrien Destugues*/ 76a33f8fbdSAdrien Destugues 77a33f8fbdSAdrien Destugues 78a33f8fbdSAdrien Destugues/*! 79a33f8fbdSAdrien Destugues \fn BAppFileInfo::~BAppFileInfo() 80a33f8fbdSAdrien Destugues \brief Frees all resources associated with this object. 81a33f8fbdSAdrien Destugues 82a33f8fbdSAdrien Destugues The supplied BFile object is not deleted if one is specified. 83*b885e90eSJohn Scipione 84*b885e90eSJohn Scipione \since BeOS R3 85a33f8fbdSAdrien Destugues*/ 86a33f8fbdSAdrien Destugues 87a33f8fbdSAdrien Destugues 88a33f8fbdSAdrien Destugues/*! 89a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::SetTo(BFile *file) 90a33f8fbdSAdrien Destugues \brief Initializes the BAppFileInfo to the supplied file. 91a33f8fbdSAdrien Destugues 92a33f8fbdSAdrien Destugues The caller retains ownership of the supplied BFile object. It must not 93a33f8fbdSAdrien Destugues be deleted during the life time of the BAppFileInfo. The BFile object 94a33f8fbdSAdrien Destugues is not deleted when the BAppFileInfo is destroyed. 95a33f8fbdSAdrien Destugues 96a33f8fbdSAdrien Destugues \param file The BFile object that the BAppFileInfo object shall be 97a33f8fbdSAdrien Destugues initialized to. 98a33f8fbdSAdrien Destugues 99a33f8fbdSAdrien Destugues \returns an status code. 100a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 101a33f8fbdSAdrien Destugues \retval B_BAD_VALUE \c NULL \a file or \a file is not properly initialized. 102*b885e90eSJohn Scipione 103*b885e90eSJohn Scipione \since BeOS R3 104a33f8fbdSAdrien Destugues*/ 105a33f8fbdSAdrien Destugues 106a33f8fbdSAdrien Destugues 107a33f8fbdSAdrien Destugues/*! 108a33f8fbdSAdrien Destugues \name MIME Type 109a33f8fbdSAdrien Destugues*/ 110a33f8fbdSAdrien Destugues 111a33f8fbdSAdrien Destugues 112a33f8fbdSAdrien Destugues//! @{ 113a33f8fbdSAdrien Destugues 114a33f8fbdSAdrien Destugues 115a33f8fbdSAdrien Destugues/*! 116a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::GetType(char *type) const 117a33f8fbdSAdrien Destugues \brief Gets the MIME type of the associated file. 118a33f8fbdSAdrien Destugues 119a33f8fbdSAdrien Destugues \param type A pointer to a pre-allocated character buffer of size 120a33f8fbdSAdrien Destugues \c B_MIME_TYPE_LENGTH or larger into which the MIME type of the 121a33f8fbdSAdrien Destugues file will be written. 122a33f8fbdSAdrien Destugues 123a33f8fbdSAdrien Destugues \returns A status code. 124a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 125a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 126a33f8fbdSAdrien Destugues \retval B_BAD_VALUE \c NULL \a type or the type string stored in the 127a33f8fbdSAdrien Destugues attribute/resources is longer than \c B_MIME_TYPE_LENGTH. 128a33f8fbdSAdrien Destugues \retval B_BAD_TYPE The attribute/resources the type string is stored in 129a33f8fbdSAdrien Destugues has the wrong type. 130a33f8fbdSAdrien Destugues \retval B_ENTRY_NOT_FOUND No type is set on the file. 131*b885e90eSJohn Scipione 132*b885e90eSJohn Scipione \since BeOS R3 133a33f8fbdSAdrien Destugues*/ 134a33f8fbdSAdrien Destugues 135a33f8fbdSAdrien Destugues 136a33f8fbdSAdrien Destugues/*! 137a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::SetType(const char* type) 138a33f8fbdSAdrien Destugues \brief Sets the MIME type of the associated file. 139a33f8fbdSAdrien Destugues 140a33f8fbdSAdrien Destugues If \a type is \c NULL if the file's MIME type is unset. 141a33f8fbdSAdrien Destugues 142a33f8fbdSAdrien Destugues \param type The MIME type to be assigned to the file. It must not be 143*b885e90eSJohn Scipione longer than \c B_MIME_TYPE_LENGTH (including the terminating \0). 144a33f8fbdSAdrien Destugues The MIME type may be \c NULL. 145a33f8fbdSAdrien Destugues 146a33f8fbdSAdrien Destugues \returns a status code. 147a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 148a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 149a33f8fbdSAdrien Destugues \retval B_BAD_VALUE \a type is longer than \c B_MIME_TYPE_LENGTH. 150*b885e90eSJohn Scipione 151*b885e90eSJohn Scipione \since BeOS R3 152a33f8fbdSAdrien Destugues*/ 153a33f8fbdSAdrien Destugues 154a33f8fbdSAdrien Destugues 155a33f8fbdSAdrien Destugues//! @} 156a33f8fbdSAdrien Destugues 157a33f8fbdSAdrien Destugues 158a33f8fbdSAdrien Destugues/*! 159a33f8fbdSAdrien Destugues \name Signature 160a33f8fbdSAdrien Destugues*/ 161a33f8fbdSAdrien Destugues 162a33f8fbdSAdrien Destugues 163a33f8fbdSAdrien Destugues//! @{ 164a33f8fbdSAdrien Destugues 165a33f8fbdSAdrien Destugues 166a33f8fbdSAdrien Destugues/*! 167a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::GetSignature(char* signature) const 168a33f8fbdSAdrien Destugues \brief Gets the application signature of the associated file. 169a33f8fbdSAdrien Destugues 170a33f8fbdSAdrien Destugues \param signature A pointer to a pre-allocated character buffer of size 171a33f8fbdSAdrien Destugues \c B_MIME_TYPE_LENGTH or larger into which the application 172a33f8fbdSAdrien Destugues signature of the file will be written. 173a33f8fbdSAdrien Destugues 174a33f8fbdSAdrien Destugues \returns a status code. 175a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 176a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 177a33f8fbdSAdrien Destugues \retval B_BAD_VALUE \c NULL \a signature or the signature stored in the 178a33f8fbdSAdrien Destugues attribute/resources is longer than \c B_MIME_TYPE_LENGTH. 179a33f8fbdSAdrien Destugues \retval B_BAD_TYPE The attribute/resources the signature is stored in have 180a33f8fbdSAdrien Destugues the wrong type. 181a33f8fbdSAdrien Destugues \retval B_ENTRY_NOT_FOUND No signature is set on the file. 182*b885e90eSJohn Scipione 183*b885e90eSJohn Scipione \since BeOS R3 184a33f8fbdSAdrien Destugues*/ 185a33f8fbdSAdrien Destugues 186a33f8fbdSAdrien Destugues 187a33f8fbdSAdrien Destugues/*! 188a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::SetSignature(const char* signature) 189a33f8fbdSAdrien Destugues \brief Sets the application signature of the associated file. 190a33f8fbdSAdrien Destugues 191a33f8fbdSAdrien Destugues If \a signature is \c NULL the file's application signature is unset. 192a33f8fbdSAdrien Destugues 193a33f8fbdSAdrien Destugues \param signature The application signature to be assigned to the file. 194a33f8fbdSAdrien Destugues Must not be longer than \c B_MIME_TYPE_LENGTH (including the 195*b885e90eSJohn Scipione terminating \0). The \a signature may be \c NULL. 196a33f8fbdSAdrien Destugues 197a33f8fbdSAdrien Destugues \returns a status code. 198a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 199a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 200a33f8fbdSAdrien Destugues \retval B_BAD_VALUE \a signature is longer than \c B_MIME_TYPE_LENGTH. 201*b885e90eSJohn Scipione 202*b885e90eSJohn Scipione \since BeOS R3 203a33f8fbdSAdrien Destugues*/ 204a33f8fbdSAdrien Destugues 205a33f8fbdSAdrien Destugues 206a33f8fbdSAdrien Destugues//! @} 207a33f8fbdSAdrien Destugues 208a33f8fbdSAdrien Destugues 209a33f8fbdSAdrien Destugues/*! 210a33f8fbdSAdrien Destugues \name Catalog Entry 211a33f8fbdSAdrien Destugues*/ 212a33f8fbdSAdrien Destugues 213a33f8fbdSAdrien Destugues 214a33f8fbdSAdrien Destugues//! @{ 215a33f8fbdSAdrien Destugues 216a33f8fbdSAdrien Destugues 217a33f8fbdSAdrien Destugues/*! 218a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::GetCatalogEntry(char *catalogEntry) const 219a33f8fbdSAdrien Destugues \brief Gets the catalog entry of the associated file used for localization. 220a33f8fbdSAdrien Destugues 221a33f8fbdSAdrien Destugues \param catalogEntry A pointer to a pre-allocated character buffer of size 222a33f8fbdSAdrien Destugues \c B_MIME_TYPE_LENGTH * 3 or larger into which the catalog entry 223a33f8fbdSAdrien Destugues of the file will be written. 224a33f8fbdSAdrien Destugues 225a33f8fbdSAdrien Destugues \returns a status code. 226a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 227a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 228a33f8fbdSAdrien Destugues \retval B_BAD_VALUE \c NULL \a catalogEntry or the entry stored in the 229a33f8fbdSAdrien Destugues attribute/resources is longer than \c B_MIME_TYPE_LENGTH * 3. 230a33f8fbdSAdrien Destugues \retval B_BAD_TYPE The attribute/resources the entry is stored in have 231a33f8fbdSAdrien Destugues the wrong type. 232a33f8fbdSAdrien Destugues \retval B_ENTRY_NOT_FOUND No catalog entry is set on the file. 233*b885e90eSJohn Scipione 234*b885e90eSJohn Scipione \since Haiku R1 235a33f8fbdSAdrien Destugues*/ 236a33f8fbdSAdrien Destugues 237a33f8fbdSAdrien Destugues 238a33f8fbdSAdrien Destugues/*! 239a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::SetCatalogEntry(const char* catalogEntry) 240a33f8fbdSAdrien Destugues \brief Sets the catalog entry of the associated file used for localization. 241a33f8fbdSAdrien Destugues 242a33f8fbdSAdrien Destugues If \a catalogEntry is \c NULL the file's catalog entry is unset. 243a33f8fbdSAdrien Destugues 244a33f8fbdSAdrien Destugues \param catalogEntry The catalog entry to be assigned to the file. 245a33f8fbdSAdrien Destugues Of the form "x-vnd.Haiku-app:context:name". Must not be longer than 246*b885e90eSJohn Scipione \c B_MIME_TYPE_LENGTH * 3 (including the terminating \0). 247a33f8fbdSAdrien Destugues The \a catalogEntry may be \c NULL. 248a33f8fbdSAdrien Destugues 249a33f8fbdSAdrien Destugues \returns a status code. 250a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 251a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 252a33f8fbdSAdrien Destugues \retval B_BAD_VALUE \a catalogEntry is longer than 253a33f8fbdSAdrien Destugues \c B_MIME_TYPE_LENGTH * 3. 254*b885e90eSJohn Scipione 255*b885e90eSJohn Scipione \since Haiku R1 256a33f8fbdSAdrien Destugues*/ 257a33f8fbdSAdrien Destugues 258a33f8fbdSAdrien Destugues 259a33f8fbdSAdrien Destugues//! @} 260a33f8fbdSAdrien Destugues 261a33f8fbdSAdrien Destugues 262a33f8fbdSAdrien Destugues/*! 263a33f8fbdSAdrien Destugues \name Application Flags 264a33f8fbdSAdrien Destugues*/ 265a33f8fbdSAdrien Destugues 266a33f8fbdSAdrien Destugues 267a33f8fbdSAdrien Destugues//! @{ 268a33f8fbdSAdrien Destugues 269a33f8fbdSAdrien Destugues 270a33f8fbdSAdrien Destugues/*! 271a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::GetAppFlags(uint32* flags) const 272a33f8fbdSAdrien Destugues \brief Gets the application \a flags of the associated file. 273a33f8fbdSAdrien Destugues 274a33f8fbdSAdrien Destugues \param flags A pointer to a pre-allocated \c uint32 into which the 275a33f8fbdSAdrien Destugues application flags of the file are written. 276a33f8fbdSAdrien Destugues 277a33f8fbdSAdrien Destugues \returns A status code. 278a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 279a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 280a33f8fbdSAdrien Destugues \retval B_BAD_VALUE \c NULL \a flags. 281a33f8fbdSAdrien Destugues \retval B_BAD_TYPE The attribute/resources the flags are stored in have 282a33f8fbdSAdrien Destugues the wrong type. 283a33f8fbdSAdrien Destugues \retval B_ENTRY_NOT_FOUND No application flags are set on the file. 284*b885e90eSJohn Scipione 285*b885e90eSJohn Scipione \since BeOS R3 286a33f8fbdSAdrien Destugues*/ 287a33f8fbdSAdrien Destugues 288a33f8fbdSAdrien Destugues 289a33f8fbdSAdrien Destugues/*! 290a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::SetAppFlags(uint32 flags) 291a33f8fbdSAdrien Destugues \brief Sets the application \a flags of the associated file. 292a33f8fbdSAdrien Destugues 293a33f8fbdSAdrien Destugues \param flags The application \a flags to be assigned to the file. 294a33f8fbdSAdrien Destugues 295a33f8fbdSAdrien Destugues \returns A status code. 296a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 297a33f8fbdSAdrien Destugues \retval B_NO_INIT The object was not properly initialized. 298*b885e90eSJohn Scipione 299*b885e90eSJohn Scipione \since BeOS R3 300a33f8fbdSAdrien Destugues*/ 301a33f8fbdSAdrien Destugues 302a33f8fbdSAdrien Destugues 303a33f8fbdSAdrien Destugues/*! 304a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::RemoveAppFlags() 305a33f8fbdSAdrien Destugues \brief Removes the application flags from the associated file. 306a33f8fbdSAdrien Destugues 307a33f8fbdSAdrien Destugues \returns A status code. 308a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 309a33f8fbdSAdrien Destugues \retval B_NO_INIT The object was not properly initialized. 310*b885e90eSJohn Scipione 311*b885e90eSJohn Scipione \since Haiku R1 312a33f8fbdSAdrien Destugues*/ 313a33f8fbdSAdrien Destugues 314a33f8fbdSAdrien Destugues 315a33f8fbdSAdrien Destugues//! @} 316a33f8fbdSAdrien Destugues 317a33f8fbdSAdrien Destugues 318a33f8fbdSAdrien Destugues/*! 319a33f8fbdSAdrien Destugues \name Supported MIME Types 320a33f8fbdSAdrien Destugues*/ 321a33f8fbdSAdrien Destugues 322a33f8fbdSAdrien Destugues 323a33f8fbdSAdrien Destugues//! @{ 324a33f8fbdSAdrien Destugues 325a33f8fbdSAdrien Destugues 326a33f8fbdSAdrien Destugues/*! 327a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::GetSupportedTypes(BMessage* types) const 328a33f8fbdSAdrien Destugues \brief Gets the MIME types supported by the application. 329a33f8fbdSAdrien Destugues 330a33f8fbdSAdrien Destugues The supported MIME types are added to a field "types" of type 331a33f8fbdSAdrien Destugues \c B_STRING_TYPE in \a types. 332a33f8fbdSAdrien Destugues 333a33f8fbdSAdrien Destugues \param types A pointer to a pre-allocated BMessage into which the 334a33f8fbdSAdrien Destugues MIME types supported by the application will be written. 335a33f8fbdSAdrien Destugues 336a33f8fbdSAdrien Destugues \returns A status code. 337a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 338a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 339a33f8fbdSAdrien Destugues \retval B_BAD_VALUE \c NULL \a types. 340a33f8fbdSAdrien Destugues \retval B_BAD_TYPE The attribute/resources that the supported types 341a33f8fbdSAdrien Destugues are stored in have the wrong type. 342a33f8fbdSAdrien Destugues \retval B_ENTRY_NOT_FOUND No supported types are set on the file. 343*b885e90eSJohn Scipione 344*b885e90eSJohn Scipione \since BeOS R3 345a33f8fbdSAdrien Destugues*/ 346a33f8fbdSAdrien Destugues 347a33f8fbdSAdrien Destugues 348a33f8fbdSAdrien Destugues/*! 349a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::SetSupportedTypes(const BMessage* types, 350c41356faSIngo Weinhold bool updateMimeDB, bool syncAll) 351*b885e90eSJohn Scipione \brief Sets the MIME types that are supported by the application 352*b885e90eSJohn Scipione and allows you to specify whether or not the supported types 353*b885e90eSJohn Scipione in the MIME DB shall be updated as well. 354c41356faSIngo Weinhold 355c41356faSIngo Weinhold If \a types is \c NULL then the application's supported types are unset. 356c41356faSIngo Weinhold 357c41356faSIngo Weinhold The supported MIME types must be stored in a field "types" of type 358c41356faSIngo Weinhold \c B_STRING_TYPE in \a types. 359c41356faSIngo Weinhold 360c41356faSIngo Weinhold If \a updateMimeDB is \c true, the method will inform the registrar about 361c41356faSIngo Weinhold this news. In this case for each supported type the result of 362c41356faSIngo Weinhold BMimeType::GetSupportingApps() will afterward include the signature of this 363c41356faSIngo Weinhold application. That is, the application file needs to have a signature set. 364c41356faSIngo Weinhold 365c41356faSIngo Weinhold \a syncAll specifies whether the no longer supported types shall be 366c41356faSIngo Weinhold updated as well, i.e. whether or not this application shall be removed 367c41356faSIngo Weinhold from the list of supporting applications. Only relevant when \a updateMimeDB 368c41356faSIngo Weinhold is \c true. 369c41356faSIngo Weinhold 370c41356faSIngo Weinhold \param types The supported types to be assigned to the file. 371c41356faSIngo Weinhold May be \c NULL. 372c41356faSIngo Weinhold \param updateMimeDB \c true to update the supported types in the MIME DB, 373c41356faSIngo Weinhold \c false otherwise. 374c41356faSIngo Weinhold \param syncAll \c true to also synchronize the no-longer supported 375c41356faSIngo Weinhold types, \c false otherwise. 376c41356faSIngo Weinhold 377c41356faSIngo Weinhold \returns A status code. 378c41356faSIngo Weinhold \retval B_OK Everything went fine. 379c41356faSIngo Weinhold \retval B_NO_INIT The object is not properly initialized. 380*b885e90eSJohn Scipione 381*b885e90eSJohn Scipione \since BeOS R3 382c41356faSIngo Weinhold*/ 383c41356faSIngo Weinhold 384c41356faSIngo Weinhold 385c41356faSIngo Weinhold/*! 386c41356faSIngo Weinhold \fn status_t BAppFileInfo::SetSupportedTypes(const BMessage* types, 387a33f8fbdSAdrien Destugues bool syncAll) 388a33f8fbdSAdrien Destugues \brief Sets the MIME types that are supported by the application and allows 389a33f8fbdSAdrien Destugues you to specify whether or not the no longer supported types shall be 390a33f8fbdSAdrien Destugues updated as well. 391a33f8fbdSAdrien Destugues 392a33f8fbdSAdrien Destugues If \a types is \c NULL then the application's supported types are unset. 393a33f8fbdSAdrien Destugues 394a33f8fbdSAdrien Destugues The supported MIME types must be stored in a field "types" of type 395a33f8fbdSAdrien Destugues \c B_STRING_TYPE in \a types. 396a33f8fbdSAdrien Destugues 397a33f8fbdSAdrien Destugues The method informs the registrar about this news. 398a33f8fbdSAdrien Destugues For each supported type the result of BMimeType::GetSupportingApps() 399a33f8fbdSAdrien Destugues will afterwards include the signature of this application. That is, 400a33f8fbdSAdrien Destugues the application file needs to have a signature set. 401a33f8fbdSAdrien Destugues 402a33f8fbdSAdrien Destugues \a syncAll specifies whether the no longer supported types shall be 403a33f8fbdSAdrien Destugues updated as well, i.e. whether or not this application shall be removed 404a33f8fbdSAdrien Destugues from the list of supporting applications. 405a33f8fbdSAdrien Destugues 406a33f8fbdSAdrien Destugues \param types The supported types to be assigned to the file. 407a33f8fbdSAdrien Destugues May be \c NULL. 408a33f8fbdSAdrien Destugues \param syncAll \c true to also synchronize the no-longer supported 409a33f8fbdSAdrien Destugues types, \c false otherwise. 410a33f8fbdSAdrien Destugues 411a33f8fbdSAdrien Destugues \returns A status code. 412a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 413a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 414*b885e90eSJohn Scipione 415*b885e90eSJohn Scipione \since BeOS R3 416a33f8fbdSAdrien Destugues*/ 417a33f8fbdSAdrien Destugues 418a33f8fbdSAdrien Destugues 419a33f8fbdSAdrien Destugues/*! 420a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::SetSupportedTypes(const BMessage* types) 421a33f8fbdSAdrien Destugues \brief Sets the MIME types supported by the application. 422a33f8fbdSAdrien Destugues 423a33f8fbdSAdrien Destugues This method is a short-hand for SetSupportedTypes(types, false). 424a33f8fbdSAdrien Destugues \see SetSupportedType(const BMessage*, bool) for detailed information. 425a33f8fbdSAdrien Destugues 426a33f8fbdSAdrien Destugues \param types The supported types to be assigned to the file. 427a33f8fbdSAdrien Destugues May be \c NULL. 428a33f8fbdSAdrien Destugues \returns A status code. 429a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 430a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 431*b885e90eSJohn Scipione 432*b885e90eSJohn Scipione \since BeOS R3 433a33f8fbdSAdrien Destugues*/ 434a33f8fbdSAdrien Destugues 435a33f8fbdSAdrien Destugues 436a33f8fbdSAdrien Destugues/*! 437a33f8fbdSAdrien Destugues \fn bool BAppFileInfo::IsSupportedType(const char* type) const 438a33f8fbdSAdrien Destugues \brief Returns whether the application supports the supplied MIME type. 439a33f8fbdSAdrien Destugues 440a33f8fbdSAdrien Destugues If the application supports the wildcard type "application/octet-stream" 441a33f8fbdSAdrien Destugues then this method returns \c true for any MIME type. 442a33f8fbdSAdrien Destugues 443a33f8fbdSAdrien Destugues \param type The MIME type in question. 444a33f8fbdSAdrien Destugues 445a33f8fbdSAdrien Destugues \returns \c true if \a type is a valid MIME type and it is supported by 446a33f8fbdSAdrien Destugues the application, \c false otherwise. 447*b885e90eSJohn Scipione 448*b885e90eSJohn Scipione \since BeOS R3 449a33f8fbdSAdrien Destugues*/ 450a33f8fbdSAdrien Destugues 451a33f8fbdSAdrien Destugues 452a33f8fbdSAdrien Destugues/*! 453a33f8fbdSAdrien Destugues \fn bool BAppFileInfo::Supports(BMimeType* type) const 454a33f8fbdSAdrien Destugues \brief Returns whether the application supports the supplied MIME type 455a33f8fbdSAdrien Destugues explicitly. 456a33f8fbdSAdrien Destugues 457a33f8fbdSAdrien Destugues Unlike IsSupportedType(), this method returns \c true, only if the type 458a33f8fbdSAdrien Destugues is explicitly supported, regardless of whether it supports 459a33f8fbdSAdrien Destugues "application/octet-stream". 460a33f8fbdSAdrien Destugues 461a33f8fbdSAdrien Destugues \param type The MIME type in question. 462a33f8fbdSAdrien Destugues 463a33f8fbdSAdrien Destugues \returns \c true if \a type is a valid MIME type and it is explicitly 464a33f8fbdSAdrien Destugues supported by the application, \c false otherwise. 465*b885e90eSJohn Scipione 466*b885e90eSJohn Scipione \since BeOS R3 467a33f8fbdSAdrien Destugues*/ 468a33f8fbdSAdrien Destugues 469a33f8fbdSAdrien Destugues 470a33f8fbdSAdrien Destugues//! @} 471a33f8fbdSAdrien Destugues 472a33f8fbdSAdrien Destugues 473a33f8fbdSAdrien Destugues/*! 474a33f8fbdSAdrien Destugues \name Application Icon 475a33f8fbdSAdrien Destugues*/ 476a33f8fbdSAdrien Destugues 477a33f8fbdSAdrien Destugues 478a33f8fbdSAdrien Destugues//! @{ 479a33f8fbdSAdrien Destugues 480a33f8fbdSAdrien Destugues 481a33f8fbdSAdrien Destugues/*! 482a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::GetIcon(BBitmap* icon, icon_size which) const 483*b885e90eSJohn Scipione \brief Gets the icon of the associated file and puts it into a 484*b885e90eSJohn Scipione pre-allocated BBitmap. 485a33f8fbdSAdrien Destugues 486a33f8fbdSAdrien Destugues \param icon A pointer to a pre-allocated BBitmap of the correct dimension 487a33f8fbdSAdrien Destugues to store the requested icon (16x16 for the \c B_MINI_ICON and 32x32 488a33f8fbdSAdrien Destugues for the \c B_LARGE_ICON). 489a33f8fbdSAdrien Destugues \param which Specifies the size of the icon to be retrieved: 490a33f8fbdSAdrien Destugues \c B_MINI_ICON for the mini and \c B_LARGE_ICON for the large icon. 491a33f8fbdSAdrien Destugues For HVIF icons this parameter has no effect. 492a33f8fbdSAdrien Destugues 493a33f8fbdSAdrien Destugues \returns A status code. 494a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 495a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 496a33f8fbdSAdrien Destugues \retval B_BAD_VALUE \c NULL \a icon, unsupported icon size \a which or 497a33f8fbdSAdrien Destugues bitmap dimensions (\a icon) and icon size (\a which) do not match. 498*b885e90eSJohn Scipione 499*b885e90eSJohn Scipione \since BeOS R3 500a33f8fbdSAdrien Destugues*/ 501a33f8fbdSAdrien Destugues 502a33f8fbdSAdrien Destugues 503a33f8fbdSAdrien Destugues/*! 504a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::GetIcon(uint8** data, size_t* size) const 505a33f8fbdSAdrien Destugues \brief Gets the icon of the associated file and puts it into a buffer. 506a33f8fbdSAdrien Destugues 507a33f8fbdSAdrien Destugues \param data The pointer in which the flat icon data will be returned. 508a33f8fbdSAdrien Destugues \param size The pointer in which the size of the data found will be 509a33f8fbdSAdrien Destugues returned. 510a33f8fbdSAdrien Destugues 511a33f8fbdSAdrien Destugues \returns A status code. 512a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 513a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 514a33f8fbdSAdrien Destugues \retval B_BAD_VALUE \c NULL \a data or \c NULL size. 515*b885e90eSJohn Scipione 516*b885e90eSJohn Scipione \since BeOS R3 517a33f8fbdSAdrien Destugues*/ 518a33f8fbdSAdrien Destugues 519a33f8fbdSAdrien Destugues 520a33f8fbdSAdrien Destugues/*! 521c41356faSIngo Weinhold \fn status_t BAppFileInfo::SetIcon(const BBitmap* icon, icon_size which, 522c41356faSIngo Weinhold bool updateMimeDB) 523c41356faSIngo Weinhold \brief Sets the icon of the associated file from a BBitmap. 524c41356faSIngo Weinhold 525c41356faSIngo Weinhold If \a icon is \c NULL then the icon of the file is unset. 526c41356faSIngo Weinhold 527c41356faSIngo Weinhold \param icon A pointer to the BBitmap containing the icon to be set. 528c41356faSIngo Weinhold May be \c NULL to specify no icon. 529c41356faSIngo Weinhold \param which Specifies the size of the icon to be set: \c B_MINI_ICON for 530c41356faSIngo Weinhold 16x16 mini icon and \c B_LARGE_ICON for the 32x32 large icon. 531c41356faSIngo Weinhold For HVIF icons this parameter has no effect. 532c41356faSIngo Weinhold \param updateMimeDB \c true to also set the icon for the application in the 533c41356faSIngo Weinhold MIME DB. \c false otherwise. 534c41356faSIngo Weinhold 535c41356faSIngo Weinhold \returns A status code. 536c41356faSIngo Weinhold \retval B_OK Everything went fine. 537c41356faSIngo Weinhold \retval B_NO_INIT The object is not properly initialized. 538c41356faSIngo Weinhold \retval B_BAD_VALUE Unknown icon size \a which or bitmap dimensions 539c41356faSIngo Weinhold (\a icon) and icon size (\a which) do not match. 540*b885e90eSJohn Scipione 541*b885e90eSJohn Scipione \since Haiku R1 542c41356faSIngo Weinhold*/ 543c41356faSIngo Weinhold 544*b885e90eSJohn Scipione 545c41356faSIngo Weinhold/*! 546a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::SetIcon(const BBitmap* icon, icon_size which) 547a33f8fbdSAdrien Destugues \brief Sets the icon of the associated file from a BBitmap. 548a33f8fbdSAdrien Destugues 549a33f8fbdSAdrien Destugues If \a icon is \c NULL then the icon of the file is unset. 550a33f8fbdSAdrien Destugues 551c41356faSIngo Weinhold Also sets the application's icon in the MIME DB, if the file has a valid 552c41356faSIngo Weinhold application signature. 553c41356faSIngo Weinhold 554a33f8fbdSAdrien Destugues \param icon A pointer to the BBitmap containing the icon to be set. 555a33f8fbdSAdrien Destugues May be \c NULL to specify no icon. 556a33f8fbdSAdrien Destugues \param which Specifies the size of the icon to be set: \c B_MINI_ICON for 557a33f8fbdSAdrien Destugues 16x16 mini icon and \c B_LARGE_ICON for the 32x32 large icon. 558a33f8fbdSAdrien Destugues For HVIF icons this parameter has no effect. 559a33f8fbdSAdrien Destugues 560a33f8fbdSAdrien Destugues \returns A status code. 561a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 562a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 563a33f8fbdSAdrien Destugues \retval B_BAD_VALUE Unknown icon size \a which or bitmap dimensions 564a33f8fbdSAdrien Destugues (\a icon) and icon size (\a which) do not match. 565*b885e90eSJohn Scipione 566*b885e90eSJohn Scipione \since BeOS R3 567a33f8fbdSAdrien Destugues*/ 568a33f8fbdSAdrien Destugues 569a33f8fbdSAdrien Destugues 570a33f8fbdSAdrien Destugues/*! 571c41356faSIngo Weinhold \fn status_t BAppFileInfo::SetIcon(const uint8* data, size_t size, 572c41356faSIngo Weinhold bool updateMimeDB) 573c41356faSIngo Weinhold \brief Sets the icon of the associated file from a buffer. 574c41356faSIngo Weinhold 575c41356faSIngo Weinhold If \a data is \c NULL then the icon of the file is unset. 576c41356faSIngo Weinhold 577c41356faSIngo Weinhold \param data A pointer to the data buffer containing the vector icon 578c41356faSIngo Weinhold to be set. May be \c NULL. 579c41356faSIngo Weinhold \param size Specifies the size of buffer pointed to by \a data. 580c41356faSIngo Weinhold \param updateMimeDB \c true to also set the icon for the application in the 581c41356faSIngo Weinhold MIME DB. \c false otherwise. 582c41356faSIngo Weinhold 583c41356faSIngo Weinhold \returns A status code. 584c41356faSIngo Weinhold \retval B_OK Everything went fine. 585c41356faSIngo Weinhold \retval B_NO_INIT The object is not properly initialized. 586c41356faSIngo Weinhold \retval B_BAD_VALUE \c NULL data. 587*b885e90eSJohn Scipione 588*b885e90eSJohn Scipione \since Haiku R1 589c41356faSIngo Weinhold*/ 590c41356faSIngo Weinhold 591c41356faSIngo Weinhold 592c41356faSIngo Weinhold/*! 593a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::SetIcon(const uint8* data, size_t size) 594a33f8fbdSAdrien Destugues \brief Sets the icon of the associated file from a buffer. 595a33f8fbdSAdrien Destugues 596a33f8fbdSAdrien Destugues If \a data is \c NULL then the icon of the file is unset. 597a33f8fbdSAdrien Destugues 598c41356faSIngo Weinhold Also sets the application's icon in the MIME DB, if the file has a valid 599c41356faSIngo Weinhold application signature. 600c41356faSIngo Weinhold 601a33f8fbdSAdrien Destugues \param data A pointer to the data buffer containing the vector icon 602a33f8fbdSAdrien Destugues to be set. May be \c NULL. 603a33f8fbdSAdrien Destugues \param size Specifies the size of buffer pointed to by \a data. 604a33f8fbdSAdrien Destugues 605a33f8fbdSAdrien Destugues \returns A status code. 606a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 607a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 608a33f8fbdSAdrien Destugues \retval B_BAD_VALUE \c NULL data. 609*b885e90eSJohn Scipione 610*b885e90eSJohn Scipione \since Haiku R1 611a33f8fbdSAdrien Destugues*/ 612a33f8fbdSAdrien Destugues 613a33f8fbdSAdrien Destugues 614a33f8fbdSAdrien Destugues/*! 615a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::GetIconForType(const char* type, BBitmap* icon, 616a33f8fbdSAdrien Destugues icon_size size) const 617a33f8fbdSAdrien Destugues \brief Gets the icon the application provides for a given MIME type and 618a33f8fbdSAdrien Destugues puts it into a BBitmap. 619a33f8fbdSAdrien Destugues 620a33f8fbdSAdrien Destugues \note If \a type is \c NULL, the application's icon is retrieved. 621a33f8fbdSAdrien Destugues 622a33f8fbdSAdrien Destugues \param type The MIME type in question. May be \c NULL. 623a33f8fbdSAdrien Destugues \param icon A pointer to a pre-allocated BBitmap of the correct dimension 624a33f8fbdSAdrien Destugues to store the requested icon (16x16 for the mini and 32x32 for the 625a33f8fbdSAdrien Destugues large icon). 626a33f8fbdSAdrien Destugues \param size Specifies the size of the icon to be retrieved: 627a33f8fbdSAdrien Destugues \c B_MINI_ICON for the mini and \c B_LARGE_ICON for the large icon. 628a33f8fbdSAdrien Destugues 629a33f8fbdSAdrien Destugues \returns A status code. 630a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 631a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 632a33f8fbdSAdrien Destugues \retval B_BAD_VALUE \c NULL \a icon, unsupported icon size 633*b885e90eSJohn Scipione \a which or bitmap dimensions (\a icon) and icon size (\a which) 634*b885e90eSJohn Scipione do not match. 635*b885e90eSJohn Scipione 636*b885e90eSJohn Scipione \since BeOS R3 637a33f8fbdSAdrien Destugues*/ 638a33f8fbdSAdrien Destugues 639a33f8fbdSAdrien Destugues 640a33f8fbdSAdrien Destugues/*! 641a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::GetIconForType(const char* type, uint8** data, 642a33f8fbdSAdrien Destugues size_t* size) const 643a33f8fbdSAdrien Destugues \brief Gets the icon the application provides for a given MIME type and 644a33f8fbdSAdrien Destugues puts it into a buffer. 645a33f8fbdSAdrien Destugues 646a33f8fbdSAdrien Destugues \note If \a type is set to \c NULL the the application's icon is retrieved. 647a33f8fbdSAdrien Destugues 648a33f8fbdSAdrien Destugues \param type The MIME type in question. May be \c NULL. 649a33f8fbdSAdrien Destugues \param data A pointer in which the icon data will be returned. When you 650a33f8fbdSAdrien Destugues are done with the data, you should use free() to deallocate it. 651a33f8fbdSAdrien Destugues \param size A pointer in which the size of the retrieved data is returned. 652a33f8fbdSAdrien Destugues 653a33f8fbdSAdrien Destugues \returns A status code. 654a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 655a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 656a33f8fbdSAdrien Destugues \retval B_BAD_VALUE \c NULL \a data and/or \a size. Or the supplied 657a33f8fbdSAdrien Destugues \a type is not a valid MIME type. 658*b885e90eSJohn Scipione 659*b885e90eSJohn Scipione \since Haiku R1 660a33f8fbdSAdrien Destugues*/ 661a33f8fbdSAdrien Destugues 662a33f8fbdSAdrien Destugues 663a33f8fbdSAdrien Destugues/*! 664a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::SetIconForType(const char* type, 665c41356faSIngo Weinhold const BBitmap* icon, icon_size which, bool updateMimeDB) 666c41356faSIngo Weinhold \brief Sets the icon the application provides for a given MIME type from a 667c41356faSIngo Weinhold BBitmap. 668c41356faSIngo Weinhold 669c41356faSIngo Weinhold \note If \a type is \c NULL then the icon is set. 670c41356faSIngo Weinhold \note If \a icon is \c NULL then the icon is unset. 671c41356faSIngo Weinhold 672c41356faSIngo Weinhold If \a updateMimeDB is \c true and if the file has a signature, then the icon 673c41356faSIngo Weinhold is also set on the MIME type. If the type for the signature has not been 674c41356faSIngo Weinhold installed yet, it is installed before. 675c41356faSIngo Weinhold 676c41356faSIngo Weinhold \param type The MIME type in question. May be \c NULL. 677c41356faSIngo Weinhold \param icon A pointer to the BBitmap containing the icon to be set. 678c41356faSIngo Weinhold May be \c NULL. 679c41356faSIngo Weinhold \param which Specifies the size of the icon to be set: \c B_MINI_ICON 680c41356faSIngo Weinhold for the mini and \c B_LARGE_ICON for the large icon. 681c41356faSIngo Weinhold \param updateMimeDB \c true to also set the icon for the type in the MIME 682c41356faSIngo Weinhold DB. \c false otherwise. 683c41356faSIngo Weinhold 684c41356faSIngo Weinhold \returns A status code. 685c41356faSIngo Weinhold \retval B_OK Everything went fine. 686c41356faSIngo Weinhold \retval B_NO_INIT The object is not properly initialized. 687c41356faSIngo Weinhold \retval B_BAD_VALUE Either the icon size \a which is unknown, 688c41356faSIngo Weinhold the bitmap dimensions (\a icon) and icon size (\a which) do not 689c41356faSIngo Weinhold match, or the provided \a type is not a valid MIME type. 690*b885e90eSJohn Scipione 691*b885e90eSJohn Scipione \since Haiku R1 692c41356faSIngo Weinhold*/ 693c41356faSIngo Weinhold 694c41356faSIngo Weinhold 695c41356faSIngo Weinhold/*! 696c41356faSIngo Weinhold \fn status_t BAppFileInfo::SetIconForType(const char* type, 697a33f8fbdSAdrien Destugues const BBitmap* icon, icon_size which) 698a33f8fbdSAdrien Destugues \brief Sets the icon the application provides for a given MIME type from a 699a33f8fbdSAdrien Destugues BBitmap. 700a33f8fbdSAdrien Destugues 701a33f8fbdSAdrien Destugues \note If \a type is \c NULL then the icon is set. 702a33f8fbdSAdrien Destugues \note If \a icon is \c NULL then the icon is unset. 703a33f8fbdSAdrien Destugues 704a33f8fbdSAdrien Destugues If the file has a signature, then the icon is also set on the MIME type. 705a33f8fbdSAdrien Destugues If the type for the signature has not been installed yet, it is installed 706a33f8fbdSAdrien Destugues before. 707a33f8fbdSAdrien Destugues 708a33f8fbdSAdrien Destugues \param type The MIME type in question. May be \c NULL. 709a33f8fbdSAdrien Destugues \param icon A pointer to the BBitmap containing the icon to be set. 710a33f8fbdSAdrien Destugues May be \c NULL. 711a33f8fbdSAdrien Destugues \param which Specifies the size of the icon to be set: \c B_MINI_ICON 712a33f8fbdSAdrien Destugues for the mini and \c B_LARGE_ICON for the large icon. 713a33f8fbdSAdrien Destugues 714a33f8fbdSAdrien Destugues \returns A status code. 715a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 716a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 717a33f8fbdSAdrien Destugues \retval B_BAD_VALUE Either the icon size \a which is unknown, 718a33f8fbdSAdrien Destugues the bitmap dimensions (\a icon) and icon size (\a which) do not 719a33f8fbdSAdrien Destugues match, or the provided \a type is not a valid MIME type. 720*b885e90eSJohn Scipione 721*b885e90eSJohn Scipione \since BeOS R3 722a33f8fbdSAdrien Destugues*/ 723a33f8fbdSAdrien Destugues 724a33f8fbdSAdrien Destugues 725a33f8fbdSAdrien Destugues/*! 726a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::SetIconForType(const char* type, 727c41356faSIngo Weinhold const uint8* data, size_t size, bool updateMimeDB) 728c41356faSIngo Weinhold \brief Sets the icon the application provides for a given MIME type from a 729c41356faSIngo Weinhold buffer. 730c41356faSIngo Weinhold 731c41356faSIngo Weinhold \note If \a type is \c NULL then the icon is set. 732c41356faSIngo Weinhold \note If \a data is \c NULL then the icon is unset. 733c41356faSIngo Weinhold 734c41356faSIngo Weinhold If \a updateMimeDB is \c true and if the file has a signature, then the icon 735c41356faSIngo Weinhold is also set on the MIME type. If the type for the signature has not been 736c41356faSIngo Weinhold installed yet, it is installed before. 737c41356faSIngo Weinhold 738c41356faSIngo Weinhold \param type The MIME type in question. May be \c NULL. 739c41356faSIngo Weinhold \param data A pointer to the data containing the icon to be set. 740c41356faSIngo Weinhold May be \c NULL. 741c41356faSIngo Weinhold \param size Specifies the size of buffer provided in \a data. 742c41356faSIngo Weinhold \param updateMimeDB \c true to also set the icon for the type in the MIME 743c41356faSIngo Weinhold DB. \c false otherwise. 744c41356faSIngo Weinhold 745c41356faSIngo Weinhold \returns A status code. 746c41356faSIngo Weinhold \retval B_OK Everything went fine. 747c41356faSIngo Weinhold \retval B_NO_INIT The object is not properly initialized. 748c41356faSIngo Weinhold \retval B_BAD_VALUE The provided \a type is not a valid MIME type. 749*b885e90eSJohn Scipione 750*b885e90eSJohn Scipione \since Haiku R1 751c41356faSIngo Weinhold*/ 752c41356faSIngo Weinhold 753c41356faSIngo Weinhold 754c41356faSIngo Weinhold/*! 755c41356faSIngo Weinhold \fn status_t BAppFileInfo::SetIconForType(const char* type, 756a33f8fbdSAdrien Destugues const uint8* data, size_t size) 757a33f8fbdSAdrien Destugues \brief Sets the icon the application provides for a given MIME type from a 758a33f8fbdSAdrien Destugues buffer. 759a33f8fbdSAdrien Destugues 760a33f8fbdSAdrien Destugues \note If \a type is \c NULL then the icon is set. 761a33f8fbdSAdrien Destugues \note If \a data is \c NULL then the icon is unset. 762a33f8fbdSAdrien Destugues 763a33f8fbdSAdrien Destugues If the file has a signature, then the icon is also set on the MIME type. 764a33f8fbdSAdrien Destugues If the type for the signature has not been installed yet, it is 765a33f8fbdSAdrien Destugues installed before. 766a33f8fbdSAdrien Destugues 767a33f8fbdSAdrien Destugues \param type The MIME type in question. May be \c NULL. 768a33f8fbdSAdrien Destugues \param data A pointer to the data containing the icon to be set. 769a33f8fbdSAdrien Destugues May be \c NULL. 770a33f8fbdSAdrien Destugues \param size Specifies the size of buffer provided in \a data. 771a33f8fbdSAdrien Destugues 772a33f8fbdSAdrien Destugues \returns A status code. 773a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 774a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 775a33f8fbdSAdrien Destugues \retval B_BAD_VALUE The provided \a type is not a valid MIME type. 776*b885e90eSJohn Scipione 777*b885e90eSJohn Scipione \since Haiku R1 778a33f8fbdSAdrien Destugues*/ 779a33f8fbdSAdrien Destugues 780a33f8fbdSAdrien Destugues 781a33f8fbdSAdrien Destugues//! @} 782a33f8fbdSAdrien Destugues 783a33f8fbdSAdrien Destugues 784a33f8fbdSAdrien Destugues/*! 785a33f8fbdSAdrien Destugues \name Version Info 786a33f8fbdSAdrien Destugues*/ 787a33f8fbdSAdrien Destugues 788a33f8fbdSAdrien Destugues 789a33f8fbdSAdrien Destugues//! @{ 790a33f8fbdSAdrien Destugues 791a33f8fbdSAdrien Destugues 792a33f8fbdSAdrien Destugues/*! 793a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::GetVersionInfo(version_info* info, 794a33f8fbdSAdrien Destugues version_kind kind) const 795a33f8fbdSAdrien Destugues \brief Gets the version info of the associated file. 796a33f8fbdSAdrien Destugues 797a33f8fbdSAdrien Destugues \param info A pointer to a pre-allocated version_info structure into 798a33f8fbdSAdrien Destugues which the version info should be written. 799a33f8fbdSAdrien Destugues \param kind Specifies the kind of the version info to be retrieved: 800a33f8fbdSAdrien Destugues - \c B_APP_VERSION_KIND for the application's version info and 801a33f8fbdSAdrien Destugues - \c B_SYSTEM_VERSION_KIND for the suite's info the application 802a33f8fbdSAdrien Destugues belongs to. 803a33f8fbdSAdrien Destugues 804a33f8fbdSAdrien Destugues \returns A status code. 805a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 806a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 807a33f8fbdSAdrien Destugues \retval B_BAD_VALUE \c NULL \a info. 808*b885e90eSJohn Scipione 809*b885e90eSJohn Scipione \since BeOS R3 810a33f8fbdSAdrien Destugues*/ 811a33f8fbdSAdrien Destugues 812a33f8fbdSAdrien Destugues 813a33f8fbdSAdrien Destugues/*! 814a33f8fbdSAdrien Destugues \fn status_t BAppFileInfo::SetVersionInfo(const version_info* info, 815a33f8fbdSAdrien Destugues version_kind kind) 816a33f8fbdSAdrien Destugues \brief Sets the version info of the associated file. 817a33f8fbdSAdrien Destugues 818a33f8fbdSAdrien Destugues \note If \a info is set to \c NULL then the file's version info is unset. 819a33f8fbdSAdrien Destugues 820a33f8fbdSAdrien Destugues \param info The version info to be set. May be \c NULL. 821a33f8fbdSAdrien Destugues \param kind Specifies kind of version info to be set: 822a33f8fbdSAdrien Destugues - \c B_APP_VERSION_KIND for the application's version info and 823a33f8fbdSAdrien Destugues - \c B_SYSTEM_VERSION_KIND for the suite's info the application 824a33f8fbdSAdrien Destugues belongs to. 825a33f8fbdSAdrien Destugues 826a33f8fbdSAdrien Destugues \returns A status code. 827a33f8fbdSAdrien Destugues \retval B_OK Everything went fine. 828a33f8fbdSAdrien Destugues \retval B_NO_INIT The object is not properly initialized. 829*b885e90eSJohn Scipione 830*b885e90eSJohn Scipione \since BeOS R3 831a33f8fbdSAdrien Destugues*/ 832a33f8fbdSAdrien Destugues 833a33f8fbdSAdrien Destugues 834a33f8fbdSAdrien Destugues//! @} 835a33f8fbdSAdrien Destugues 836a33f8fbdSAdrien Destugues 837a33f8fbdSAdrien Destugues/*! 838a33f8fbdSAdrien Destugues \name Attributes/Resources 839a33f8fbdSAdrien Destugues*/ 840a33f8fbdSAdrien Destugues 841a33f8fbdSAdrien Destugues 842a33f8fbdSAdrien Destugues//! @{ 843a33f8fbdSAdrien Destugues 844a33f8fbdSAdrien Destugues 845a33f8fbdSAdrien Destugues/*! 846a33f8fbdSAdrien Destugues \fn void BAppFileInfo::SetInfoLocation(info_location location) 847a33f8fbdSAdrien Destugues \brief Specifies the location where the metadata shall be stored. 848a33f8fbdSAdrien Destugues 849a33f8fbdSAdrien Destugues The options for \a location are: 850a33f8fbdSAdrien Destugues - \c B_USE_ATTRIBUTES: Store the data in the attributes. 851a33f8fbdSAdrien Destugues - \c B_USE_RESOURCES: Store the data in the resources. 852a33f8fbdSAdrien Destugues - \c B_USE_BOTH_LOCATIONS: Store the data in attributes and resources. 853a33f8fbdSAdrien Destugues 854a33f8fbdSAdrien Destugues \param location The location where the metadata shall be stored. 855*b885e90eSJohn Scipione 856*b885e90eSJohn Scipione \since BeOS R3 857a33f8fbdSAdrien Destugues*/ 858a33f8fbdSAdrien Destugues 859a33f8fbdSAdrien Destugues 860a33f8fbdSAdrien Destugues/*! 861a33f8fbdSAdrien Destugues \fn bool BAppFileInfo::IsUsingAttributes() const 862a33f8fbdSAdrien Destugues \brief Returns whether the object (also) stores the metadata in the 863a33f8fbdSAdrien Destugues attributes of the associated file. 864a33f8fbdSAdrien Destugues 865a33f8fbdSAdrien Destugues \returns \c true if the metadata are (also) stored in the file's 866a33f8fbdSAdrien Destugues attributes, \c false otherwise. 867*b885e90eSJohn Scipione 868*b885e90eSJohn Scipione \since BeOS R3 869a33f8fbdSAdrien Destugues*/ 870a33f8fbdSAdrien Destugues 871a33f8fbdSAdrien Destugues 872a33f8fbdSAdrien Destugues/*! 873a33f8fbdSAdrien Destugues \fn bool BAppFileInfo::IsUsingResources() const 874a33f8fbdSAdrien Destugues \brief Returns whether the object (also) stores the metadata in the 875a33f8fbdSAdrien Destugues resources of the associated file. 876a33f8fbdSAdrien Destugues 877a33f8fbdSAdrien Destugues \returns \c true if the metadata are (also) stored in the file's 878a33f8fbdSAdrien Destugues resources, \c false otherwise. 879*b885e90eSJohn Scipione 880*b885e90eSJohn Scipione \since BeOS R3 881a33f8fbdSAdrien Destugues*/ 882a33f8fbdSAdrien Destugues 883a33f8fbdSAdrien Destugues 884a33f8fbdSAdrien Destugues//! @} 885