database_support.h revision e8c8f853
1/*
2 * Copyright 2002-2014 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef _MIME_DATABASE_SUPPORT_H
6#define _MIME_DATABASE_SUPPORT_H
7
8
9#include <Mime.h>
10#include <SupportDefs.h>
11
12
13class BBitmap;
14
15
16namespace BPrivate {
17namespace Storage {
18namespace Mime {
19
20
21class DatabaseLocation;
22
23
24// Attribute Prefixes
25extern const char* kMiniIconAttrPrefix;
26extern const char* kLargeIconAttrPrefix;
27extern const char* kIconAttrPrefix;
28
29// Attribute names
30extern const char* kFileTypeAttr;
31extern const char* kTypeAttr;
32extern const char* kAttrInfoAttr;
33extern const char* kAppHintAttr;
34extern const char* kShortDescriptionAttr;
35extern const char* kLongDescriptionAttr;
36extern const char* kFileExtensionsAttr;
37extern const char* kMiniIconAttr;
38extern const char* kLargeIconAttr;
39extern const char* kIconAttr;
40extern const char* kPreferredAppAttr;
41extern const char* kSnifferRuleAttr;
42extern const char* kSupportedTypesAttr;
43
44// Attribute Datatypes
45extern const int32 kFileTypeType;
46extern const int32 kTypeType;
47extern const int32 kAppHintType;
48extern const int32 kAttrInfoType;
49extern const int32 kShortDescriptionType;
50extern const int32 kLongDescriptionType;
51extern const int32 kFileExtensionsType;
52extern const int32 kMiniIconType;
53extern const int32 kLargeIconType;
54extern const int32 kIconType;
55extern const int32 kPreferredAppType;
56extern const int32 kSnifferRuleType;
57extern const int32 kSupportedTypesType;
58
59// Message fields
60extern const char* kApplicationsField;
61extern const char* kExtensionsField;
62extern const char* kSupertypesField;
63extern const char* kSupportingAppsSubCountField;
64extern const char* kSupportingAppsSuperCountField;
65extern const char* kTypesField;
66
67// Mime types
68extern const char* kGenericFileType;
69extern const char* kDirectoryType;
70extern const char* kSymlinkType;
71extern const char* kMetaMimeType;
72
73// Error codes (to be used only by BPrivate::Storage::Mime members)
74extern const status_t kMimeGuessFailureError;
75
76
77DatabaseLocation* default_database_location();
78
79// Called by BMimeType to get properly formatted icon data ready
80// to be shipped off to SetIcon*() and written to the database
81status_t get_icon_data(const BBitmap* icon, icon_size size, void** data,
82	int32* dataSize);
83
84
85} // namespace Mime
86} // namespace Storage
87} // namespace BPrivate
88
89
90#endif	// _MIME_DATABASE_SUPPORT_H
91