2 * Copyright 2002-2014, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 #ifndef _APP_FILE_INFO_H
6 #define _APP_FILE_INFO_H
29 B_DEVELOPMENT_VERSION
= 0,
33 B_GOLDEN_MASTER_VERSION
,
38 B_USE_ATTRIBUTES
= 0x1,
39 B_USE_RESOURCES
= 0x2,
40 B_USE_BOTH_LOCATIONS
= 0x3 // == B_USE_ATTRIBUTES | B_USE_RESOURCES
49 class BAppFileInfo
: public BNodeInfo
{
52 BAppFileInfo(BFile
* file
);
53 virtual ~BAppFileInfo();
55 status_t
SetTo(BFile
* file
);
57 virtual status_t
GetType(char* type
) const;
58 virtual status_t
SetType(const char* type
);
60 status_t
GetSignature(char* signature
) const;
61 status_t
SetSignature(const char* signature
);
63 status_t
GetCatalogEntry(char* catalogEntry
) const;
64 status_t
SetCatalogEntry(const char* catalogEntry
);
66 status_t
GetAppFlags(uint32
* flags
) const;
67 status_t
SetAppFlags(uint32 flags
);
68 status_t
RemoveAppFlags();
70 status_t
GetSupportedTypes(BMessage
* types
) const;
71 status_t
SetSupportedTypes(const BMessage
* types
,
72 bool updateMimeDB
, bool syncAll
);
73 status_t
SetSupportedTypes(const BMessage
* types
,
75 status_t
SetSupportedTypes(const BMessage
* types
);
76 bool IsSupportedType(const char* type
) const;
77 bool Supports(BMimeType
* type
) const;
79 virtual status_t
GetIcon(BBitmap
* icon
, icon_size which
) const;
80 status_t
SetIcon(const BBitmap
* icon
, icon_size which
,
82 virtual status_t
SetIcon(const BBitmap
* icon
, icon_size which
);
84 status_t
GetIcon(uint8
** data
, size_t* size
) const;
85 status_t
SetIcon(const uint8
* data
, size_t size
,
87 status_t
SetIcon(const uint8
* data
, size_t size
);
89 status_t
GetVersionInfo(version_info
* info
,
90 version_kind kind
) const;
91 status_t
SetVersionInfo(const version_info
* info
,
94 status_t
GetIconForType(const char* type
, BBitmap
* icon
,
95 icon_size which
) const;
96 status_t
GetIconForType(const char* type
, uint8
** data
,
98 status_t
SetIconForType(const char* type
,
99 const BBitmap
* icon
, icon_size which
,
101 status_t
SetIconForType(const char* type
,
102 const BBitmap
* icon
, icon_size which
);
103 status_t
SetIconForType(const char* type
,
104 const uint8
* data
, size_t size
,
106 status_t
SetIconForType(const char* type
,
107 const uint8
* data
, size_t size
);
109 void SetInfoLocation(info_location location
);
110 bool IsUsingAttributes() const;
111 bool IsUsingResources() const;
114 virtual void _ReservedAppFileInfo1();
115 virtual void _ReservedAppFileInfo2();
116 virtual void _ReservedAppFileInfo3();
118 BAppFileInfo
& operator=(const BAppFileInfo
&);
119 BAppFileInfo(const BAppFileInfo
&);
121 status_t
GetMetaMime(BMimeType
* meta
) const;
123 status_t
_ReadData(const char* name
, int32 id
,
124 type_code type
, void* buffer
,
125 size_t bufferSize
, size_t& bytesRead
,
126 void** allocatedBuffer
= NULL
) const;
127 status_t
_WriteData(const char* name
, int32 id
,
128 type_code type
, const void* buffer
,
129 size_t bufferSize
, bool findID
= false);
130 status_t
_RemoveData(const char* name
, type_code type
);
133 BResources
* fResources
;
134 info_location fWhere
;
139 #endif // _APP_FILE_INFO_H