haiku/headers/build/private/storage/AddOnMonitorHandler.h
Ingo Weinhold 338b8dc301 Merged changes from branch build_system_redesign at revision 14573.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14574 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-29 16:27:43 +00:00

62 lines
1.6 KiB
C++

#ifndef _ADD_ON_MONITOR_HANDLER_H
#define _ADD_ON_MONITOR_HANDLER_H
#include <list>
#include "NodeMonitorHandler.h"
namespace BPrivate {
namespace Storage {
struct add_on_entry_info {
char name[B_FILE_NAME_LENGTH];
node_ref nref;
node_ref dir_nref;
};
struct add_on_directory_info {
node_ref nref;
std::list<add_on_entry_info> entries;
};
class AddOnMonitorHandler : public NodeMonitorHandler {
private:
typedef NodeMonitorHandler inherited;
public:
AddOnMonitorHandler(const char * name = "AddOnMonitorHandler");
virtual ~AddOnMonitorHandler();
virtual void MessageReceived(BMessage * msg);
// supply the add on directories here, in the order you want them checked
virtual status_t AddDirectory(const node_ref * nref);
protected:
// hooks for subclass
virtual void AddOnCreated(const add_on_entry_info * entry_info);
virtual void AddOnEnabled(const add_on_entry_info * entry_info);
virtual void AddOnDisabled(const add_on_entry_info * entry_info);
virtual void AddOnRemoved(const add_on_entry_info * entry_info);
protected:
virtual void EntryCreated(const char *name, ino_t directory,
dev_t device, ino_t node);
virtual void EntryRemoved(ino_t directory, dev_t device, ino_t node);
virtual void EntryMoved(const char *name, ino_t from_directory,
ino_t to_directory, dev_t device, ino_t node);
private:
void HandlePulse();
std::list<add_on_directory_info> directories;
std::list<add_on_entry_info> pending_entries;
std::list<add_on_entry_info> former_entries;
};
}; // namespace Storage
}; // namespace BPrivate
using namespace BPrivate::Storage;
#endif // _ADD_ON_MONITOR_HANDLER_H