xref: /haiku/headers/private/storage/mime/database_support.h (revision e8c8f8536cbe5870d2ab401c8b2e3cb553956b67)
1f6e4cbb9SAxel Dörfler /*
2*e8c8f853SJohn Scipione  * Copyright 2002-2014 Haiku, Inc. All rights reserved.
3f6e4cbb9SAxel Dörfler  * Distributed under the terms of the MIT License.
432f45afcSTyler Dauwalder  */
5e20a514aSTyler Dauwalder #ifndef _MIME_DATABASE_SUPPORT_H
6e20a514aSTyler Dauwalder #define _MIME_DATABASE_SUPPORT_H
7e20a514aSTyler Dauwalder 
8f6e4cbb9SAxel Dörfler 
9b94857b3SIngo Weinhold #include <Mime.h>
10b94857b3SIngo Weinhold #include <SupportDefs.h>
11e20a514aSTyler Dauwalder 
12e20a514aSTyler Dauwalder 
13b94857b3SIngo Weinhold class BBitmap;
14f6e4cbb9SAxel Dörfler 
15e20a514aSTyler Dauwalder 
16e20a514aSTyler Dauwalder namespace BPrivate {
17e20a514aSTyler Dauwalder namespace Storage {
18e20a514aSTyler Dauwalder namespace Mime {
19e20a514aSTyler Dauwalder 
20b94857b3SIngo Weinhold 
21b94857b3SIngo Weinhold class DatabaseLocation;
22b94857b3SIngo Weinhold 
23e20a514aSTyler Dauwalder 
24e20a514aSTyler Dauwalder // Attribute Prefixes
25e20a514aSTyler Dauwalder extern const char* kMiniIconAttrPrefix;
26e20a514aSTyler Dauwalder extern const char* kLargeIconAttrPrefix;
279ecf9d1cSIngo Weinhold extern const char* kIconAttrPrefix;
28e20a514aSTyler Dauwalder 
29e20a514aSTyler Dauwalder // Attribute names
30e20a514aSTyler Dauwalder extern const char* kFileTypeAttr;
31e20a514aSTyler Dauwalder extern const char* kTypeAttr;
32e20a514aSTyler Dauwalder extern const char* kAttrInfoAttr;
33e20a514aSTyler Dauwalder extern const char* kAppHintAttr;
34e20a514aSTyler Dauwalder extern const char* kShortDescriptionAttr;
35e20a514aSTyler Dauwalder extern const char* kLongDescriptionAttr;
36e20a514aSTyler Dauwalder extern const char* kFileExtensionsAttr;
37e20a514aSTyler Dauwalder extern const char* kMiniIconAttr;
38e20a514aSTyler Dauwalder extern const char* kLargeIconAttr;
399ecf9d1cSIngo Weinhold extern const char* kIconAttr;
40e20a514aSTyler Dauwalder extern const char* kPreferredAppAttr;
41e20a514aSTyler Dauwalder extern const char* kSnifferRuleAttr;
42e20a514aSTyler Dauwalder extern const char* kSupportedTypesAttr;
43e20a514aSTyler Dauwalder 
44e20a514aSTyler Dauwalder // Attribute Datatypes
45e20a514aSTyler Dauwalder extern const int32 kFileTypeType;
46e20a514aSTyler Dauwalder extern const int32 kTypeType;
47e20a514aSTyler Dauwalder extern const int32 kAppHintType;
48e20a514aSTyler Dauwalder extern const int32 kAttrInfoType;
49e20a514aSTyler Dauwalder extern const int32 kShortDescriptionType;
50e20a514aSTyler Dauwalder extern const int32 kLongDescriptionType;
51e20a514aSTyler Dauwalder extern const int32 kFileExtensionsType;
52e20a514aSTyler Dauwalder extern const int32 kMiniIconType;
53e20a514aSTyler Dauwalder extern const int32 kLargeIconType;
549ecf9d1cSIngo Weinhold extern const int32 kIconType;
55e20a514aSTyler Dauwalder extern const int32 kPreferredAppType;
56e20a514aSTyler Dauwalder extern const int32 kSnifferRuleType;
57e20a514aSTyler Dauwalder extern const int32 kSupportedTypesType;
58e20a514aSTyler Dauwalder 
5932f45afcSTyler Dauwalder // Message fields
60b86972c2STyler Dauwalder extern const char* kApplicationsField;
611bd963b6STyler Dauwalder extern const char* kExtensionsField;
6232f45afcSTyler Dauwalder extern const char* kSupertypesField;
63b86972c2STyler Dauwalder extern const char* kSupportingAppsSubCountField;
64b86972c2STyler Dauwalder extern const char* kSupportingAppsSuperCountField;
65b86972c2STyler Dauwalder extern const char* kTypesField;
6632f45afcSTyler Dauwalder 
671bd963b6STyler Dauwalder // Mime types
681bd963b6STyler Dauwalder extern const char* kGenericFileType;
691bd963b6STyler Dauwalder extern const char* kDirectoryType;
701bd963b6STyler Dauwalder extern const char* kSymlinkType;
7198977256STyler Dauwalder extern const char* kMetaMimeType;
721bd963b6STyler Dauwalder 
731bd963b6STyler Dauwalder // Error codes (to be used only by BPrivate::Storage::Mime members)
741bd963b6STyler Dauwalder extern const status_t kMimeGuessFailureError;
751bd963b6STyler Dauwalder 
76e20a514aSTyler Dauwalder 
77b94857b3SIngo Weinhold DatabaseLocation* default_database_location();
78e20a514aSTyler Dauwalder 
79b94857b3SIngo Weinhold // Called by BMimeType to get properly formatted icon data ready
80b94857b3SIngo Weinhold // to be shipped off to SetIcon*() and written to the database
81b94857b3SIngo Weinhold status_t get_icon_data(const BBitmap* icon, icon_size size, void** data,
82b94857b3SIngo Weinhold 	int32* dataSize);
83e20a514aSTyler Dauwalder 
84e20a514aSTyler Dauwalder 
85e20a514aSTyler Dauwalder } // namespace Mime
86e20a514aSTyler Dauwalder } // namespace Storage
87e20a514aSTyler Dauwalder } // namespace BPrivate
88e20a514aSTyler Dauwalder 
89b94857b3SIngo Weinhold 
90e20a514aSTyler Dauwalder #endif	// _MIME_DATABASE_SUPPORT_H
91