2 * Copyright 2015, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef VOLUME_WATCHER_H
6 #define VOLUME_WATCHER_H
10 #include <ObjectList.h>
13 class VolumeListener
{
15 virtual ~VolumeListener();
17 virtual void VolumeMounted(dev_t device
) = 0;
18 virtual void VolumeUnmounted(dev_t device
) = 0;
22 class VolumeWatcher
: public BHandler
{
25 virtual ~VolumeWatcher();
27 void AddListener(VolumeListener
* listener
);
28 void RemoveListener(VolumeListener
* listener
);
29 int32
CountListeners() const;
31 virtual void MessageReceived(BMessage
* message
);
33 static void Register(VolumeListener
* listener
);
34 static void Unregister(VolumeListener
* listener
);
37 BObjectList
<VolumeListener
>
42 #endif // VOLUME_WATCHER_H