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