1/*
2 * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef NOTIFICATIONS_H
6#define NOTIFICATIONS_H
7
8
9#include "Transaction.h"
10
11
12class Directory;
13
14
15class EntryCreatedNotification : public PostCommitNotification {
16public:
17								EntryCreatedNotification(Directory* directory,
18									const char* name, Node* node);
19
20	virtual	void				NotifyPostCommit() const;
21
22private:
23			Directory*			fDirectory;
24			const char*			fName;
25			Node*				fNode;
26};
27
28
29class EntryRemovedNotification : public PostCommitNotification {
30public:
31								EntryRemovedNotification(Directory* directory,
32									const char* name, Node* node);
33
34	virtual	void				NotifyPostCommit() const;
35
36private:
37			Directory*			fDirectory;
38			const char*			fName;
39			Node*				fNode;
40};
41
42
43class EntryMovedNotification : public PostCommitNotification {
44public:
45								EntryMovedNotification(Directory* fromDirectory,
46									const char* fromName,
47									Directory* toDirectory, const char* toName,
48									Node* node);
49
50	virtual	void				NotifyPostCommit() const;
51
52private:
53			Directory*			fFromDirectory;
54			const char*			fFromName;
55			Directory*			fToDirectory;
56			const char*			fToName;
57			Node*				fNode;
58};
59
60
61class StatChangedNotification : public PostCommitNotification {
62public:
63								StatChangedNotification(Node* node,
64									uint32 statFields);
65
66	virtual	void				NotifyPostCommit() const;
67
68private:
69			Node*				fNode;
70			uint32				fStatFields;
71};
72
73
74class AttributeChangedNotification : public PostCommitNotification {
75public:
76								AttributeChangedNotification(Node* node,
77									const char* attribute, int32 cause);
78
79	virtual	void				NotifyPostCommit() const;
80
81private:
82			Node*				fNode;
83			const char*			fAttribute;
84			int32				fCause;
85};
86
87
88#endif	// NOTIFICATIONS_H
89