2006-11-16 03:12:15 +03:00
|
|
|
/*
|
2010-04-13 13:48:02 +04:00
|
|
|
* Copyright 2002-2010, Haiku, Inc. All Rights Reserved.
|
2006-11-16 03:12:15 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2002-08-12 11:24:02 +04:00
|
|
|
#ifndef _NODE_INFO_H
|
|
|
|
#define _NODE_INFO_H
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2010-04-13 13:48:02 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#include <BeBuild.h>
|
|
|
|
#include <Entry.h>
|
2010-04-13 13:48:02 +04:00
|
|
|
#include <File.h>
|
|
|
|
#include <Message.h>
|
|
|
|
#include <Mime.h>
|
|
|
|
#include <SupportDefs.h>
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
|
|
|
|
class BBitmap;
|
|
|
|
class BResources;
|
|
|
|
|
|
|
|
|
2010-04-13 13:48:02 +04:00
|
|
|
/*! \brief BNodeInfo provides file type information
|
|
|
|
BNodeInfo provides a nice wrapper to all sorts of usefull meta data.
|
2002-08-11 20:16:07 +04:00
|
|
|
Like it's mime type, the files icon and the application which will load
|
|
|
|
the file.
|
2010-04-13 13:48:02 +04:00
|
|
|
*/
|
2002-07-09 16:24:59 +04:00
|
|
|
class BNodeInfo {
|
|
|
|
public:
|
2010-04-13 13:48:02 +04:00
|
|
|
BNodeInfo();
|
|
|
|
BNodeInfo(BNode* node);
|
|
|
|
virtual ~BNodeInfo();
|
|
|
|
|
|
|
|
status_t SetTo(BNode* node);
|
|
|
|
|
|
|
|
status_t InitCheck() const;
|
|
|
|
|
|
|
|
virtual status_t GetType(char* type) const;
|
|
|
|
virtual status_t SetType(const char* type);
|
|
|
|
virtual status_t GetIcon(BBitmap* icon,
|
|
|
|
icon_size size = B_LARGE_ICON) const;
|
|
|
|
virtual status_t SetIcon(const BBitmap* icon,
|
|
|
|
icon_size size = B_LARGE_ICON);
|
|
|
|
status_t GetIcon(uint8** data, size_t* size,
|
|
|
|
type_code* type) const;
|
|
|
|
status_t SetIcon(const uint8* data, size_t size);
|
|
|
|
|
|
|
|
status_t GetPreferredApp(char* signature,
|
|
|
|
app_verb verb = B_OPEN) const;
|
|
|
|
status_t SetPreferredApp(const char* signature,
|
|
|
|
app_verb verb = B_OPEN);
|
|
|
|
status_t GetAppHint(entry_ref* ref) const;
|
|
|
|
status_t SetAppHint(const entry_ref* ref);
|
|
|
|
|
|
|
|
status_t GetTrackerIcon(BBitmap* icon,
|
|
|
|
icon_size size = B_LARGE_ICON) const;
|
|
|
|
static status_t GetTrackerIcon(const entry_ref* ref,
|
|
|
|
BBitmap* icon,
|
|
|
|
icon_size size = B_LARGE_ICON);
|
2002-07-09 16:24:59 +04:00
|
|
|
private:
|
2010-04-13 13:48:02 +04:00
|
|
|
friend class BAppFileInfo;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2010-04-13 13:48:02 +04:00
|
|
|
virtual void _ReservedNodeInfo1();
|
|
|
|
virtual void _ReservedNodeInfo2();
|
|
|
|
virtual void _ReservedNodeInfo3();
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2010-04-13 13:48:02 +04:00
|
|
|
BNodeInfo &operator=(const BNodeInfo& other);
|
|
|
|
BNodeInfo(const BNodeInfo& other);
|
|
|
|
// not implemented
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2010-04-13 13:48:02 +04:00
|
|
|
private:
|
|
|
|
BNode* fNode;
|
|
|
|
uint32 _reserved[2];
|
|
|
|
status_t fCStatus;
|
2002-07-09 16:24:59 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-08-12 11:24:02 +04:00
|
|
|
#endif // _NODE_INFO_H
|