2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef LOCATABLE_FILE_H
6 #define LOCATABLE_FILE_H
8 #include <ObjectList.h>
10 #include "LocatableEntry.h"
13 class LocatableFile
: public LocatableEntry
{
18 LocatableFile(LocatableEntryOwner
* owner
,
19 LocatableDirectory
* directory
,
23 virtual const char* Name() const;
24 void GetPath(BString
& _path
) const;
26 // mutable (requires/does locking)
27 virtual bool GetLocatedPath(BString
& _path
) const;
28 virtual void SetLocatedPath(const BString
& path
,
31 bool AddListener(Listener
* listener
);
32 void RemoveListener(Listener
* listener
);
35 typedef BObjectList
<Listener
> ListenerList
;
38 void _NotifyListeners();
43 ListenerList fListeners
;
47 class LocatableFile::Listener
{
51 virtual void LocatableFileChanged(LocatableFile
* file
) = 0;
52 // called with lock held
56 #endif // LOCATABLE_FILE_H