Initial commit of GrowlITTSW. Currently, all settings are hardcoded.
[GrowlITTSW.git] / GrowlDisplayPlugin.h
1 //
2 //      GrowlDisplayPlugin.h
3 //      Growl
4 //
5 //      Created by Mac-arena the Bored Zo on 2005-06-01.
6 //      Copyright 2005-2006 The Growl Project. All rights reserved.
7 //
8
9 #import <Cocoa/Cocoa.h>
10 #import "GrowlPlugin.h"
11
12 @class GrowlApplicationNotification, GrowlNotificationDisplayBridge;
13 @class GrowlDisplayWindowController;
14
15 //Info.plist keys for plug-in bundles.
16 extern NSString *GrowlDisplayPluginInfoKeyUsesQueue;
17 extern NSString *GrowlDisplayPluginInfoKeyWindowNibName;
18
19 /*!
20  * @class GrowlDisplayPlugin
21  * @abstract Base class for all display plugins.
22  */
23 @interface GrowlDisplayPlugin : GrowlPlugin {
24         Class          windowControllerClass;
25         
26         //for all displays
27         NSMutableDictionary *coalescableBridges;
28         
29         //for non-queueing displays
30         NSMutableArray *activeBridges; //GrowlNotificationDisplayBridges currently being displayed
31
32         //for queueing displays
33         GrowlNotificationDisplayBridge *bridge;
34         NSMutableArray *queue;           //GrowlNotificationDisplayBridges yet to be displayed
35 }
36
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>
42  */
43 - (void) displayNotification:(GrowlApplicationNotification *)notification;
44
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
51  *  implementation.
52  */
53 - (void) configureBridge:(GrowlNotificationDisplayBridge *)theBridge;
54
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
63  *       the nib.
64  *
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.
69  */
70 - (NSString *) windowNibName;
71
72 /* */
73 - (void) displayWindowControllerDidTakeDownWindow:(GrowlDisplayWindowController *)wc;
74
75 @end