#include <npacketlistener.h>
Public Member Functions | |
virtual | ~NPacketListener () |
Destroys this listener. | |
void | unregisterFromAllPackets () |
Unregisters this listener from any packets to which it is currently listening. | |
virtual void | packetWasChanged (NPacket *packet) |
Called when the contents of the packet have been changed. | |
virtual void | packetWasRenamed (NPacket *packet) |
Called when the packet label has been changed. | |
virtual void | packetToBeDestroyed (NPacket *packet) |
Called when the packet is about to be destroyed. | |
virtual void | childWasAdded (NPacket *packet, NPacket *child) |
Called when a child packet has been inserted directly beneath the packet. | |
virtual void | childWasRemoved (NPacket *packet, NPacket *child) |
Called when a child packet has been removed from directly beneath the packet. | |
virtual void | childrenWereReordered (NPacket *packet) |
Called when the child packets directly beneath the packet have been reordered. |
A packet listener can be registered to listen for events on a packet by calling NPacket::listen().
Each time that one of the events listed in this class occurs, the packet will call the appropriate routine for all registered packet listeners.
Note that these events are mutually exclusive, i.e., any event will cause at most one routine to be called for each listener. For instance, if a packet is renamed then packetWasRenamed() will be called but packetWasChanged() will not.
No guarantees are made as to the order in which the different packet listeners are notified of an event.
Note that when a listener is destroyed, it is automatically unregistered from any packets to which it is currently listening. Similarly, when a packet is destroyed all listeners are automatically unregistered.
|
Destroys this listener. This listener will be unregistered from any packets to which it is currently listening. |
|
Called when the child packets directly beneath the packet have been reordered. The default implementation of this routine is to do nothing.
|
|
Called when a child packet has been inserted directly beneath the packet. The default implementation of this routine is to do nothing.
|
|
Called when a child packet has been removed from directly beneath the packet. Note that the child packet may be about to be destroyed (although this destruction will not have happened yet). The default implementation of this routine is to do nothing.
|
|
Called when the packet is about to be destroyed. Note that this event is called before the packet is destroyed, not after. When an entire packet subtree is to be destroyed, child packets will notify their listeners of the impending destruction before parent packets will. The default implementation of this routine is to do nothing.
|
|
Called when the contents of the packet have been changed. The default implementation of this routine is to do nothing.
|
|
Called when the packet label has been changed. The default implementation of this routine is to do nothing.
|
|
Unregisters this listener from any packets to which it is currently listening.
|