xref: /haiku/headers/os/storage/NodeInfo.h (revision cbe0a0c436162d78cc3f92a305b64918c839d079)
1 /*
2  * Copyright 2002-2010 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 
9 #include <BeBuild.h>
10 #include <Entry.h>
11 #include <File.h>
12 #include <Message.h>
13 #include <Mime.h>
14 #include <SupportDefs.h>
15 
16 
17 class BBitmap;
18 class BResources;
19 
20 
21 class BNodeInfo {
22 public:
23 								BNodeInfo();
24 								BNodeInfo(BNode* node);
25 	virtual						~BNodeInfo();
26 
27 			status_t			SetTo(BNode* node);
28 
29 			status_t			InitCheck() const;
30 
31 	virtual status_t			GetType(char* type) const;
32 	virtual status_t			SetType(const char* type);
33 	virtual status_t			GetIcon(BBitmap* icon,
34 									icon_size which = B_LARGE_ICON) const;
35 	virtual status_t			SetIcon(const BBitmap* icon,
36 									icon_size which = B_LARGE_ICON);
37 			status_t			GetIcon(uint8** data, size_t* size,
38 									type_code* type) const;
39 			status_t			SetIcon(const uint8* data, size_t size);
40 
41 			status_t			GetPreferredApp(char* signature,
42 									app_verb verb = B_OPEN) const;
43 			status_t			SetPreferredApp(const char* signature,
44 									app_verb verb = B_OPEN);
45 			status_t			GetAppHint(entry_ref* ref) const;
46 			status_t			SetAppHint(const entry_ref* ref);
47 
48 			status_t			GetTrackerIcon(BBitmap* icon,
49 									icon_size which = B_LARGE_ICON) const;
50 	static	status_t			GetTrackerIcon(const entry_ref* ref,
51 									BBitmap* icon,
52 									icon_size which = B_LARGE_ICON);
53 private:
54 			friend class BAppFileInfo;
55 
56 	virtual void				_ReservedNodeInfo1();
57 	virtual void				_ReservedNodeInfo2();
58 	virtual void				_ReservedNodeInfo3();
59 
60 								BNodeInfo &operator=(const BNodeInfo& other);
61 								BNodeInfo(const BNodeInfo& other);
62 									// not implemented
63 
64 private:
65 			BNode*				fNode;
66 			uint32				_reserved[2];
67 			status_t			fCStatus;
68 };
69 
70 
71 #endif // _NODE_INFO_H
72