xref: /haiku/headers/os/storage/NodeInfo.h (revision 239222b2369c39dc52df52b0a7cdd6cc0a91bc92)
1 /*
2  * Copyright 2002-2006, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _NODE_INFO_H
6 #define _NODE_INFO_H
7 
8 #ifndef _BE_BUILD_H
9 #include <BeBuild.h>
10 #endif
11 #include <SupportDefs.h>
12 #include <Mime.h>
13 #include <Message.h>
14 #include <File.h>
15 #include <Entry.h>
16 
17 #ifdef USE_OPENBEOS_NAMESPACE
18 namespace OpenBeOS {
19 #endif // USE_OPENBEOS_NAMESPACE
20 
21 class BBitmap;
22 class BResources;
23 
24 
25 //!	BNodeInfo provides file type information
26 /*!	BNodeInfo provides a nice wrapper to all sorts of usefull meta data.
27 	Like it's mime type, the files icon and the application which will load
28 	the file.
29 
30 	\see <a href="http://www.opensource.org/licenses/mit-license.html">MIT</a>
31 	\author <a href='mailto:bonefish@users.sf.net'>Ingo Weinhold</a>
32 	\author <a href="mailto:mrmlk@users.sf.net"> Michael Lloyd Lee </a>
33 	\author Be Inc
34 	\version 0
35  */
36 class BNodeInfo {
37 public:
38 
39 	BNodeInfo();
40 
41 	BNodeInfo(BNode *node);
42 	virtual ~BNodeInfo();
43 
44 	status_t SetTo(BNode *node);
45 
46 	status_t InitCheck() const;
47 
48 	virtual status_t GetType(char *type) const;
49 	virtual status_t SetType(const char *type);
50 	virtual status_t GetIcon(BBitmap *icon, icon_size k = B_LARGE_ICON) const;
51 	virtual status_t SetIcon(const BBitmap *icon, icon_size k = B_LARGE_ICON);
52 			status_t GetIcon(uint8** data, size_t* size, type_code* type) const;
53 			status_t SetIcon(const uint8* data, size_t size);
54 
55 	status_t GetPreferredApp(char *signature,
56 								app_verb verb = B_OPEN) const;
57 	status_t SetPreferredApp(const char *signature,
58 								app_verb verb = B_OPEN);
59 	status_t GetAppHint(entry_ref *ref) const;
60 	status_t SetAppHint(const entry_ref *ref);
61 
62 	status_t GetTrackerIcon(BBitmap *icon,
63 							icon_size k = B_LARGE_ICON) const;
64 	static status_t GetTrackerIcon(const entry_ref *ref,
65 									BBitmap *icon,
66 									icon_size k = B_LARGE_ICON);
67 private:
68 	friend class BAppFileInfo;
69 
70 	virtual void _ReservedNodeInfo1(); //< FBC
71 	virtual void _ReservedNodeInfo2(); //< FBC
72 	virtual void _ReservedNodeInfo3(); //< FBC
73 
74 	BNodeInfo &operator=(const BNodeInfo &);
75 	BNodeInfo(const BNodeInfo &);
76 
77 	BNode *fNode; //< The Node in question
78 	uint32 _reserved[2]; //< FBC
79 	status_t fCStatus; //< The status to return from InitCheck
80 };
81 
82 #ifdef USE_OPENBEOS_NAMESPACE
83 }
84 #endif // USE_OPENBEOS_NAMESPACE
85 
86 #endif // _NODE_INFO_H
87 
88 
89