xref: /haiku/src/kits/tracker/VirtualDirectoryPoseView.h (revision 68ea01249e1e2088933cb12f9c28d4e5c5d1c9ef)
1 /*
2  * Copyright 2013 Haiku, Inc. All rights reserved.
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 class VirtualDirectoryEntryList;
20 
21 
22 class VirtualDirectoryPoseView : public BPoseView {
23 public:
24 								VirtualDirectoryPoseView(Model* model);
25 	virtual						~VirtualDirectoryPoseView();
26 
27 	virtual	void				MessageReceived(BMessage* message);
28 
29 protected:
30 	virtual	void				AttachedToWindow();
31 	virtual	void				RestoreState(AttributeStreamNode* node);
32 	virtual	void				RestoreState(const BMessage& message);
33 	virtual	void				SavePoseLocations(BRect* frameIfDesktop = NULL);
34 	virtual	void				SetViewMode(uint32 newMode);
35 	virtual	EntryListBase*		InitDirentIterator(const entry_ref* ref);
36 
37 	virtual	void				StartWatching();
38 	virtual	void				StopWatching();
39 
40 	virtual	bool				FSNotification(const BMessage* message);
41 
42 private:
43 			typedef BPoseView _inherited;
44 
45 private:
46 			bool				_EntryCreated(const BMessage* message);
47 			bool				_EntryRemoved(const BMessage* message);
48 			bool				_EntryMoved(const BMessage* message);
49 			bool				_NodeStatChanged(const BMessage* message);
50 
51 			void				_DispatchEntryCreatedOrRemovedMessage(
52 									int32 opcode, const node_ref& nodeRef,
53 									const entry_ref& entryRef,
54 									const char* path = NULL,
55 									bool dispatchToSuperClass = true);
56 
57 			bool				_GetEntry(const char* name, entry_ref& _ref,
58 									struct stat* _st = NULL);
59 
60 			status_t			_UpdateDirectoryPaths();
61 									// manager must be locked
62 
63 private:
64 			BStringList			fDirectoryPaths;
65 			node_ref			fRootDefinitionFileRef;
66 			bigtime_t			fFileChangeTime;
67 			bool				fIsRoot;
68 };
69 
70 
71 } // namespace BPrivate
72 
73 
74 #endif	// _VIRTUAL_DIRECTORY_POSE_VIEW_H
75