xref: /haiku/src/kits/tracker/VirtualDirectoryPoseView.h (revision 04a0e9c7b68cbe3a43d38e2bca8e860fd80936fb)
1 /*
2  * Copyright 2013, Haiku, Inc.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Ingo Weinhold, ingo_weinhold@gmx.de
7  */
8 #ifndef VIRTUAL_DIRECTORY_POSE_VIEW_H
9 #define VIRTUAL_DIRECTORY_POSE_VIEW_H
10 
11 
12 #include <StringList.h>
13 
14 #include "PoseView.h"
15 
16 
17 namespace BPrivate {
18 
19 
20 class VirtualDirectoryEntryList;
21 
22 
23 class VirtualDirectoryPoseView : public BPoseView {
24 public:
25 								VirtualDirectoryPoseView(Model* model,
26 									BRect frame,
27 									uint32 resizeMask = B_FOLLOW_ALL);
28 	virtual						~VirtualDirectoryPoseView();
29 
30 	virtual	void				MessageReceived(BMessage* message);
31 
32 protected:
33 	virtual	void				AttachedToWindow();
34 	virtual	void				RestoreState(AttributeStreamNode* node);
35 	virtual	void				RestoreState(const BMessage& message);
36 	virtual	void				SavePoseLocations(BRect* frameIfDesktop = NULL);
37 	virtual	void				SetViewMode(uint32 newMode);
38 	virtual	EntryListBase*		InitDirentIterator(const entry_ref* ref);
39 
40 	virtual	void				StartWatching();
41 	virtual	void				StopWatching();
42 
43 	virtual	bool				FSNotification(const BMessage* message);
44 
45 private:
46 			typedef BPoseView _inherited;
47 
48 private:
49 			bool				_EntryCreated(const BMessage* message);
50 			bool				_EntryRemoved(const BMessage* message);
51 			bool				_EntryMoved(const BMessage* message);
52 			bool				_NodeStatChanged(const BMessage* message);
53 
54 			void				_DispatchEntryCreatedOrRemovedMessage(
55 									int32 opcode, const node_ref& nodeRef,
56 									const entry_ref& entryRef,
57 									const char* path = NULL,
58 									bool dispatchToSuperClass = true);
59 
60 			bool				_GetEntry(const char* name, entry_ref& _ref,
61 									struct stat* _st = NULL);
62 
63 			status_t			_UpdateDirectoryPaths();
64 									// manager must be locked
65 
66 private:
67 			BStringList			fDirectoryPaths;
68 			node_ref			fRootDefinitionFileRef;
69 			bigtime_t			fFileChangeTime;
70 			bool				fIsRoot;
71 };
72 
73 
74 } // namespace BPrivate
75 
76 
77 #endif	// VIRTUAL_DIRECTORY_POSE_VIEW_H
78