#include <CoreFoundation/CoreFoundation.h>

//work

/*CFNotificationCenterAddObserver

Registers an observer to receive notifications.

void CFNotificationCenterAddObserver (
   CFNotificationCenterRef center,
   const void *observer,
   CFNotificationCallback callBack,
   CFStringRef name,
   const void *object,
   CFNotificationSuspensionBehavior suspensionBehavior
);
Parameters
center

The notification center to which to add the observer. 
observer

The observer. In Mac OS X v10.3 and later, this parameter may be NULL.

If the notification center is a Darwin notification center, this value must not be NULL.
callBack

The callback function to call when object posts the notification named name. 
name

The name of the notification to observe. If NULL, callback is called for any notification posted by object. 
object

The object to observe. For distributed notifications, object must be a CFString object. If NULL, callback is called when a notification named name is posted by any object.

If the notification center is a Darwin notification center, this value is ignored.
suspensionBehavior

Flag indicating how notifications should be handled when the application is in the background. See “Notification Delivery Suspension Behavior” for the list of available values.

If the notification center is a Darwin notification center, this value is ignored.
Discussion

The first time an observer is registered with a distributed notification center, the notification center creates a connection with the system-wide notification server and places a listening port into the common modes of the current thread’s run loop. When a notification is delivered, it is processed on this initial thread, even if the observer that is receiving the notification registered for the notification on a different thread.

Because loaded frameworks may potentially spawn threads and add their own observers before your code executes, you cannot know for certain which thread will receive distributed notifications. If you need to control which thread processes a notification, your callback function must be able to forward the notification to the proper thread. You can use a CFMessagePort object or a custom CFRunLoopSource object to send notifications to the correct thread’s run loop.
Availability
Available in Mac OS X v10.0 and later.*/

void CFNotificationCenterAddObserver (
   CFNotificationCenterRef center,
   const void *observer,
   CFNotificationCallback callBack,
   CFStringRef name,
   const void *object,
   CFNotificationSuspensionBehavior suspensionBehavior
){};

/*CFNotificationCenterGetDistributedCenter

Returns the application’s distributed notification center.

CFNotificationCenterRef CFNotificationCenterGetDistributedCenter();
Return Value

The application’s distributed notification center. An application has only one distributed notification center, so this function returns the same value each time it is called. 
Discussion

A distributed notification center delivers notifications between applications. A notification object used with a distributed notification center must always be a CFString object and the notification dictionary must contain only property list values.
Availability
Available in Mac OS X v10.0 and later.*/
CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(){};

/*CFNotificationCenterRemoveObserver

Stops an observer from receiving certain notifications.

void CFNotificationCenterRemoveObserver (
   CFNotificationCenterRef center,
   const void *observer,
   CFStringRef name,
   const void *object
);
Parameters
center

The notification center to modify. 
observer

The observer. This value must not be NULL.
name

The name of the notification to stop observing. If NULL, observer stops receiving callbacks for all notifications posted by object. 
object

The object to stop observing. For distributed notifications, object must be a CFString object. If NULL, observer stops receiving callbacks for all objects posting notifications named name.

If the notification center is a Darwin notification center, this value is ignored.
Discussion

If both name and object are NULL, this function unregisters observer from all the notifications for which it had previously registered with center.
Availability
Available in Mac OS X v10.0 and later.*/
void CFNotificationCenterRemoveObserver (
   CFNotificationCenterRef center,
   const void *observer,
   CFStringRef name,
   const void *object
){};

/*CFNotificationCenterRemoveEveryObserver

Stops an observer from receiving any notifications from any object.

void CFNotificationCenterRemoveEveryObserver (
   CFNotificationCenterRef center,
   const void *observer
);
Parameters
center

The notification center from which to remove observers. 
observer

The observer. This value must not be NULL.
Discussion

If you no longer want an observer to receive any notifications, perhaps because the observer is being deallocated, you can call this function to unregister the observer from all the notifications for which it had previously registered.
Availability
Available in Mac OS X v10.0 and later.*/
void CFNotificationCenterRemoveEveryObserver (
   CFNotificationCenterRef center,
   const void *observer
){};

/*CFNotificationCenterPostNotification

Posts a notification for an object.

void CFNotificationCenterPostNotification (
   CFNotificationCenterRef center,
   CFStringRef name,
   const void *object,
   CFDictionaryRef userInfo,
   Boolean deliverImmediately
);
Parameters
center

The notification center to post the notification. 
name

The name of the notification to post. This value must not be NULL. 
object

The object posting the notification. If NULL, the notification is sent only to observers that are observing all objects. In other words, only observers that registered for the notification with a NULL value for object will receive the notification.

If you want to allow your clients to register for notifications using Cocoa APIs (see NSNotificationCenter Class Reference), then object must be a Core Foundation or Cocoa object.

For distributed notifications, object must be a CFString object. 

If the notification center is a Darwin notification center, this value is ignored.
userInfo

A dictionary passed to observers. You populate this dictionary with additional information describing the notification. For distributed notifications, the dictionary must contain only property list objects. This value may be NULL. 

If the notification center is a Darwin notification center, this value is ignored.
deliverImmediately

If true, the notification is delivered to all observers immediately, even if some observers are in suspended (background) applications and they requested different suspension behavior when registering for the notification. If false, each observer’s requested suspension behavior is respected. 

If the notification center is a Darwin notification center, this value is ignored.
Availability
Available in Mac OS X v10.0 and later.*/
void CFNotificationCenterPostNotification (
   CFNotificationCenterRef center,
   CFStringRef name,
   const void *object,
   CFDictionaryRef userInfo,
   Boolean deliverImmediately
){};
