2002-08-27 12:26:11 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// This software is part of the OpenBeOS distribution and is covered
|
|
|
|
// by the OpenBeOS license.
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
/*!
|
|
|
|
\file database_access.h
|
2002-09-24 09:36:03 +04:00
|
|
|
Mime database atomic read functions and miscellany declarations
|
2002-08-27 12:26:11 +04:00
|
|
|
*/
|
After implementing the BMimeType::GetInstalled[Super]Types()
functionality, it became apparent that some restructuring was
needed if I wanted to keep things clean and managble.
storage/MimeDatabase.{h,cpp} have been broken into:
storage/mime/database_support.{h,cpp}
+ MIME database constants
+ high-level database access functions like open_type(),
read_mime_attr(), etc.
storage/mime/database_access.{h,cpp}
+ atomic read functions
+ is_installed()
+ get_icon_data()
storage/mime/Database.{h,cpp}
+ Mime::Database class, which is responsible for all write,
non-atomic read, and mime monitor functionality.
storage/mime/InstalledTypes.{h,cpp}
+ Helper class for Mime::Database::GetInstalled[Super]Types()
storage/mime/Supertype.{h,cpp}
+ Helper class for Mime::InstalledTypes
I haven't merged my intial, somewhat cludgy GetInstalled[Super]Types
implementation into the new setup yet. That comes next, and it ought
to be a more graceful implementation now.
I also implemented BMimeType::Get/SetSupportingTypes(), though
they haven't been tested yet (sorry).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@862 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-24 09:04:02 +04:00
|
|
|
|
|
|
|
#ifndef _MIME_DATABASE_ACCESS_H
|
|
|
|
#define _MIME_DATABASE_ACCESS_H
|
|
|
|
|
|
|
|
#include <Mime.h>
|
|
|
|
|
|
|
|
class BNode;
|
|
|
|
class BBitmap;
|
|
|
|
class BMessage;
|
|
|
|
|
|
|
|
namespace BPrivate {
|
|
|
|
namespace Storage {
|
|
|
|
namespace Mime {
|
|
|
|
|
|
|
|
// Get() functions
|
|
|
|
status_t get_app_hint(const char *type, entry_ref *ref);
|
|
|
|
status_t get_attr_info(const char *type, BMessage *info);
|
|
|
|
status_t get_short_description(const char *type, char *description);
|
|
|
|
status_t get_long_description(const char *type, char *description);
|
|
|
|
status_t get_file_extensions(const char *type, BMessage *extensions);
|
|
|
|
status_t get_icon(const char *type, BBitmap *icon, icon_size size);
|
|
|
|
status_t get_icon_for_type(const char *type, const char *fileType, BBitmap *icon,
|
|
|
|
icon_size which);
|
|
|
|
status_t get_preferred_app(const char *type, char *signature, app_verb verb);
|
2002-09-09 12:12:03 +04:00
|
|
|
status_t get_sniffer_rule(const char *type, BString *result);
|
After implementing the BMimeType::GetInstalled[Super]Types()
functionality, it became apparent that some restructuring was
needed if I wanted to keep things clean and managble.
storage/MimeDatabase.{h,cpp} have been broken into:
storage/mime/database_support.{h,cpp}
+ MIME database constants
+ high-level database access functions like open_type(),
read_mime_attr(), etc.
storage/mime/database_access.{h,cpp}
+ atomic read functions
+ is_installed()
+ get_icon_data()
storage/mime/Database.{h,cpp}
+ Mime::Database class, which is responsible for all write,
non-atomic read, and mime monitor functionality.
storage/mime/InstalledTypes.{h,cpp}
+ Helper class for Mime::Database::GetInstalled[Super]Types()
storage/mime/Supertype.{h,cpp}
+ Helper class for Mime::InstalledTypes
I haven't merged my intial, somewhat cludgy GetInstalled[Super]Types
implementation into the new setup yet. That comes next, and it ought
to be a more graceful implementation now.
I also implemented BMimeType::Get/SetSupportingTypes(), though
they haven't been tested yet (sorry).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@862 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-24 09:04:02 +04:00
|
|
|
status_t get_supported_types(const char *type, BMessage *types);
|
|
|
|
|
|
|
|
bool is_installed(const char *type);
|
|
|
|
|
|
|
|
// Called by BMimeType to get properly formatted icon data ready
|
|
|
|
// to be shipped off to SetIcon*() and written to the database
|
|
|
|
status_t get_icon_data(const BBitmap *icon, icon_size size, void **data, int32 *dataSize);
|
|
|
|
|
|
|
|
} // namespace Mime
|
|
|
|
} // namespace Storage
|
|
|
|
} // namespace BPrivate
|
|
|
|
|
|
|
|
#endif // _MIME_DATABASE_H
|