2 // GrowlDisplayPlugin.h
5 // Created by Mac-arena the Bored Zo on 2005-06-01.
6 // Copyright 2005-2006 The Growl Project. All rights reserved.
9 #import <Cocoa/Cocoa.h>
10 #import "GrowlPlugin.h"
12 @class GrowlApplicationNotification, GrowlNotificationDisplayBridge;
13 @class GrowlDisplayWindowController;
15 //Info.plist keys for plug-in bundles.
16 extern NSString *GrowlDisplayPluginInfoKeyUsesQueue;
17 extern NSString *GrowlDisplayPluginInfoKeyWindowNibName;
20 * @class GrowlDisplayPlugin
21 * @abstract Base class for all display plugins.
23 @interface GrowlDisplayPlugin : GrowlPlugin {
24 Class windowControllerClass;
27 NSMutableDictionary *coalescableBridges;
29 //for non-queueing displays
30 NSMutableArray *activeBridges; //GrowlNotificationDisplayBridges currently being displayed
32 //for queueing displays
33 GrowlNotificationDisplayBridge *bridge;
34 NSMutableArray *queue; //GrowlNotificationDisplayBridges yet to be displayed
37 /*! @method displayNotification:
38 * @abstract Display a notification to the user.
39 * @param notification The notification to display.
40 * @discussion Unless you have a specific reason to override this method you should not do so.
41 * All the magic should happen in <code>configureBridge:</code>
43 - (void) displayNotification:(GrowlApplicationNotification *)notification;
45 /*! @method configureBridge:
46 * @abstract Configures the chosen bridge before a notificaion is displayed.
47 * @param bridge The bridge to configure.
48 * @discussion This is the place where the magic happens. Override this method and do any
49 * specific configuration here. This is the last port-of-call before a notification is displayed.
50 * The default implementation does nothing so it is important that you override and provide an
53 - (void) configureBridge:(GrowlNotificationDisplayBridge *)theBridge;
55 /*! @method windowNibName
56 * @abstract Returns the name of the display's sole nib file (resulting in
57 * the creation of a window controller for the window in that file).
58 * @discussion When subclassing <code>GrowlDisplayPlugin</code>, override this
59 * method and return the name of the nib (without the ".nib" extension) that
60 * contains the display window. This method is called by
61 * <code>displayNotification:</code> to create a
62 * <code>GrowlNotificationDisplayBridge</code>, which is the File's Owner for
65 * The default implementation returns the value of
66 * <code>GrowlDisplayWindowNibName</code> in the Info.plist of the bundle for
67 * the display plug-in.
68 * @result The name of the window nib.
70 - (NSString *) windowNibName;
73 - (void) displayWindowControllerDidTakeDownWindow:(GrowlDisplayWindowController *)wc;