Somehow the vector icon version of GetIconForType() was missing.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19295 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -70,20 +70,6 @@ enum {
|
|||||||
B_META_MIME_DELETED = 'MMDL',
|
B_META_MIME_DELETED = 'MMDL',
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
|
||||||
|
|
||||||
//! File typing functionality.
|
|
||||||
/*! The BMimeType class provides access to the file typing system, which
|
|
||||||
provides the following functionality:
|
|
||||||
- Basic MIME string manipulation
|
|
||||||
- Access to file type information in the MIME database
|
|
||||||
- Ways to receive notifications when parts of the MIME database are updated
|
|
||||||
- Methods to determine/help determine the types of untyped files
|
|
||||||
|
|
||||||
\author <a href='mailto:[email protected]'>Tyler Dauwalder</a>
|
|
||||||
\author <a href='[email protected]'>Ingo Weinhold</a>
|
|
||||||
\version 0.0.0
|
|
||||||
*/
|
|
||||||
class BMimeType {
|
class BMimeType {
|
||||||
public:
|
public:
|
||||||
BMimeType();
|
BMimeType();
|
||||||
@@ -110,7 +96,7 @@ class BMimeType {
|
|||||||
status_t Delete();
|
status_t Delete();
|
||||||
bool IsInstalled() const;
|
bool IsInstalled() const;
|
||||||
status_t GetIcon(BBitmap* icon, icon_size size) const;
|
status_t GetIcon(BBitmap* icon, icon_size size) const;
|
||||||
status_t GetIcon(uint8** data, size_t* size) const;
|
status_t GetIcon(uint8** _data, size_t* _size) const;
|
||||||
status_t GetPreferredApp(char *signature, app_verb verb = B_OPEN) const;
|
status_t GetPreferredApp(char *signature, app_verb verb = B_OPEN) const;
|
||||||
status_t GetAttrInfo(BMessage *info) const;
|
status_t GetAttrInfo(BMessage *info) const;
|
||||||
status_t GetFileExtensions(BMessage *extensions) const;
|
status_t GetFileExtensions(BMessage *extensions) const;
|
||||||
@@ -139,6 +125,8 @@ class BMimeType {
|
|||||||
/* for application signatures only. */
|
/* for application signatures only. */
|
||||||
status_t GetIconForType(const char* type, BBitmap* icon,
|
status_t GetIconForType(const char* type, BBitmap* icon,
|
||||||
icon_size which) const;
|
icon_size which) const;
|
||||||
|
status_t GetIconForType(const char* type, uint8** _data,
|
||||||
|
size_t* _size) const;
|
||||||
status_t SetIconForType(const char* type, const BBitmap* icon,
|
status_t SetIconForType(const char* type, const BBitmap* icon,
|
||||||
icon_size which);
|
icon_size which);
|
||||||
status_t SetIconForType(const char* type, const uint8* data,
|
status_t SetIconForType(const char* type, const uint8* data,
|
||||||
@@ -176,8 +164,8 @@ class BMimeType {
|
|||||||
virtual void _ReservedMimeType2();
|
virtual void _ReservedMimeType2();
|
||||||
virtual void _ReservedMimeType3();
|
virtual void _ReservedMimeType3();
|
||||||
|
|
||||||
BMimeType &operator=(const BMimeType &);
|
BMimeType& operator=(const BMimeType& source);
|
||||||
BMimeType(const BMimeType &);
|
BMimeType(const BMimeType& source);
|
||||||
|
|
||||||
status_t GetSupportedTypes(BMessage* types);
|
status_t GetSupportedTypes(BMessage* types);
|
||||||
status_t SetSupportedTypes(const BMessage* types, bool fullSync = true);
|
status_t SetSupportedTypes(const BMessage* types, bool fullSync = true);
|
||||||
|
|||||||
@@ -444,9 +444,8 @@ BMimeType::GetIcon(BBitmap *icon, icon_size size) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// GetIcon
|
/*! \brief Fetches the vector icon associated with the MIME type
|
||||||
//! Fetches the vector icon associated with the MIME type
|
The icon data is returned in \c data.
|
||||||
/*! The icon data is returned in \c data.
|
|
||||||
|
|
||||||
\param data Pointer in which the allocated icon data is returned. You need to
|
\param data Pointer in which the allocated icon data is returned. You need to
|
||||||
delete the buffer when you are done with it.
|
delete the buffer when you are done with it.
|
||||||
@@ -1247,7 +1246,7 @@ BMimeType::SetAppHint(const entry_ref *ref)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetIconForType
|
|
||||||
/*! \brief Fetches the large or mini icon used by an application of this type for files of the
|
/*! \brief Fetches the large or mini icon used by an application of this type for files of the
|
||||||
given type.
|
given type.
|
||||||
|
|
||||||
@@ -1291,7 +1290,39 @@ BMimeType::GetIconForType(const char *type, BBitmap *icon, icon_size which) cons
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetIconForType
|
|
||||||
|
/*! \brief Fetches the vector icon used by an application of this type for files of
|
||||||
|
the given type.
|
||||||
|
|
||||||
|
The icon data is returned in \c data.
|
||||||
|
See the other GetIconForType() for more information.
|
||||||
|
|
||||||
|
\param type Pointer to a pre-allocated string containing the MIME type whose
|
||||||
|
custom icon you wish to fetch.
|
||||||
|
\param data Pointer in which the allocated icon data is returned. You need to
|
||||||
|
delete the buffer when you are done with it.
|
||||||
|
\param size Pointer in which the size of the allocated icon data is returned.
|
||||||
|
\return
|
||||||
|
- \c B_OK: Success
|
||||||
|
- \c B_ENTRY_NOT_FOUND: No icon of the given size exists for the given type
|
||||||
|
- other error code: Failure
|
||||||
|
|
||||||
|
*/
|
||||||
|
status_t
|
||||||
|
BMimeType::GetIconForType(const char *type, uint8** _data, size_t* _size) const
|
||||||
|
{
|
||||||
|
// If type is NULL, this function works just like GetIcon(), otherwise,
|
||||||
|
// we need to make sure the give type is valid.
|
||||||
|
if (type == NULL)
|
||||||
|
return GetIcon(_data, _size);
|
||||||
|
|
||||||
|
if (!BMimeType::IsValid(type))
|
||||||
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
|
return get_icon_for_type(Type(), type, _data, _size);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*! \brief Sets the large or mini icon used by an application of this type for
|
/*! \brief Sets the large or mini icon used by an application of this type for
|
||||||
files of the given type.
|
files of the given type.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user