source: trunk/macosx/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h @ 8838

Last change on this file since 8838 was 8838, checked in by livings124, 13 years ago

add experimental Growl snapshot

File size: 29.2 KB
Line 
1//
2//  GrowlApplicationBridge.h
3//  Growl
4//
5//  Created by Evan Schoenberg on Wed Jun 16 2004.
6//  Copyright 2004-2006 The Growl Project. All rights reserved.
7//
8
9/*!
10 *      @header         GrowlApplicationBridge.h
11 *      @abstract   Defines the GrowlApplicationBridge class.
12 *      @discussion This header defines the GrowlApplicationBridge class as well as
13 *       the GROWL_PREFPANE_BUNDLE_IDENTIFIER constant.
14 */
15
16#ifndef __GrowlApplicationBridge_h__
17#define __GrowlApplicationBridge_h__
18
19#import <Foundation/Foundation.h>
20#import <AppKit/AppKit.h>
21#import "GrowlDefines.h"
22
23//Forward declarations
24@protocol GrowlApplicationBridgeDelegate;
25
26//Internal notification when the user chooses not to install (to avoid continuing to cache notifications awaiting installation)
27#define GROWL_USER_CHOSE_NOT_TO_INSTALL_NOTIFICATION @"User chose not to install"
28
29//------------------------------------------------------------------------------
30#pragma mark -
31
32/*!
33 *      @class      GrowlApplicationBridge
34 *      @abstract   A class used to interface with Growl.
35 *      @discussion This class provides a means to interface with Growl.
36 *
37 *       Currently it provides a way to detect if Growl is installed and launch the
38 *       GrowlHelperApp if it's not already running.
39 */
40@interface GrowlApplicationBridge : NSObject {
41
42}
43
44/*!
45 *      @method isGrowlInstalled
46 *      @abstract Detects whether Growl is installed.
47 *      @discussion Determines if the Growl prefpane and its helper app are installed.
48 *      @result Returns YES if Growl is installed, NO otherwise.
49 */
50+ (BOOL) isGrowlInstalled;
51
52/*!
53 *      @method isGrowlRunning
54 *      @abstract Detects whether GrowlHelperApp is currently running.
55 *      @discussion Cycles through the process list to find whether GrowlHelperApp is running and returns its findings.
56 *      @result Returns YES if GrowlHelperApp is running, NO otherwise.
57 */
58+ (BOOL) isGrowlRunning;
59
60#pragma mark -
61
62/*!
63 *      @method setGrowlDelegate:
64 *      @abstract Set the object which will be responsible for providing and receiving Growl information.
65 *      @discussion This must be called before using GrowlApplicationBridge.
66 *
67 *       The methods in the GrowlApplicationBridgeDelegate protocol are required
68 *       and return the basic information needed to register with Growl.
69 *
70 *       The methods in the GrowlApplicationBridgeDelegate_InformalProtocol
71 *       informal protocol are individually optional.  They provide a greater
72 *       degree of interaction between the application and growl such as informing
73 *       the application when one of its Growl notifications is clicked by the user.
74 *
75 *       The methods in the GrowlApplicationBridgeDelegate_Installation_InformalProtocol
76 *       informal protocol are individually optional and are only applicable when
77 *       using the Growl-WithInstaller.framework which allows for automated Growl
78 *       installation.
79 *
80 *       When this method is called, data will be collected from inDelegate, Growl
81 *       will be launched if it is not already running, and the application will be
82 *       registered with Growl.
83 *
84 *       If using the Growl-WithInstaller framework, if Growl is already installed
85 *       but this copy of the framework has an updated version of Growl, the user
86 *       will be prompted to update automatically.
87 *
88 *      @param inDelegate The delegate for the GrowlApplicationBridge. It must conform to the GrowlApplicationBridgeDelegate protocol.
89 */
90+ (void) setGrowlDelegate:(NSObject<GrowlApplicationBridgeDelegate> *)inDelegate;
91
92/*!
93 *      @method growlDelegate
94 *      @abstract Return the object responsible for providing and receiving Growl information.
95 *      @discussion See setGrowlDelegate: for details.
96 *      @result The Growl delegate.
97 */
98+ (NSObject<GrowlApplicationBridgeDelegate> *) growlDelegate;
99
100#pragma mark -
101
102/*!
103 *      @method notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:
104 *      @abstract Send a Growl notification.
105 *      @discussion This is the preferred means for sending a Growl notification.
106 *       The notification name and at least one of the title and description are
107 *       required (all three are preferred).  All other parameters may be
108 *       <code>nil</code> (or 0 or NO as appropriate) to accept default values.
109 *
110 *       If using the Growl-WithInstaller framework, if Growl is not installed the
111 *       user will be prompted to install Growl. If the user cancels, this method
112 *       will have no effect until the next application session, at which time when
113 *       it is called the user will be prompted again. The user is also given the
114 *       option to not be prompted again.  If the user does choose to install Growl,
115 *       the requested notification will be displayed once Growl is installed and
116 *       running.
117 *
118 *      @param title            The title of the notification displayed to the user.
119 *      @param description      The full description of the notification displayed to the user.
120 *      @param notifName        The internal name of the notification. Should be human-readable, as it will be displayed in the Growl preference pane.
121 *      @param iconData         <code>NSData</code> object to show with the notification as its icon. If <code>nil</code>, the application's icon will be used instead.
122 *      @param priority         The priority of the notification. The default value is 0; positive values are higher priority and negative values are lower priority. Not all Growl displays support priority.
123 *      @param isSticky         If YES, the notification will remain on screen until clicked. Not all Growl displays support sticky notifications.
124 *      @param clickContext     A context passed back to the Growl delegate if it implements -(void)growlNotificationWasClicked: and the notification is clicked. Not all display plugins support clicking. The clickContext must be plist-encodable (completely of <code>NSString</code>, <code>NSArray</code>, <code>NSNumber</code>, <code>NSDictionary</code>, and <code>NSData</code> types).
125 */
126+ (void) notifyWithTitle:(NSString *)title
127                         description:(NSString *)description
128                notificationName:(NSString *)notifName
129                                iconData:(NSData *)iconData
130                                priority:(signed int)priority
131                                isSticky:(BOOL)isSticky
132                        clickContext:(id)clickContext;
133
134/*!
135 *      @method notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:identifier:
136 *      @abstract Send a Growl notification.
137 *      @discussion This is the preferred means for sending a Growl notification.
138 *       The notification name and at least one of the title and description are
139 *       required (all three are preferred).  All other parameters may be
140 *       <code>nil</code> (or 0 or NO as appropriate) to accept default values.
141 *
142 *       If using the Growl-WithInstaller framework, if Growl is not installed the
143 *       user will be prompted to install Growl. If the user cancels, this method
144 *       will have no effect until the next application session, at which time when
145 *       it is called the user will be prompted again. The user is also given the
146 *       option to not be prompted again.  If the user does choose to install Growl,
147 *       the requested notification will be displayed once Growl is installed and
148 *       running.
149 *
150 *      @param title            The title of the notification displayed to the user.
151 *      @param description      The full description of the notification displayed to the user.
152 *      @param notifName        The internal name of the notification. Should be human-readable, as it will be displayed in the Growl preference pane.
153 *      @param iconData         <code>NSData</code> object to show with the notification as its icon. If <code>nil</code>, the application's icon will be used instead.
154 *      @param priority         The priority of the notification. The default value is 0; positive values are higher priority and negative values are lower priority. Not all Growl displays support priority.
155 *      @param isSticky         If YES, the notification will remain on screen until clicked. Not all Growl displays support sticky notifications.
156 *      @param clickContext     A context passed back to the Growl delegate if it implements -(void)growlNotificationWasClicked: and the notification is clicked. Not all display plugins support clicking. The clickContext must be plist-encodable (completely of <code>NSString</code>, <code>NSArray</code>, <code>NSNumber</code>, <code>NSDictionary</code>, and <code>NSData</code> types).
157 *      @param identifier       An identifier for this notification. Notifications with equal identifiers are coalesced.
158 */
159+ (void) notifyWithTitle:(NSString *)title
160                         description:(NSString *)description
161                notificationName:(NSString *)notifName
162                                iconData:(NSData *)iconData
163                                priority:(signed int)priority
164                                isSticky:(BOOL)isSticky
165                        clickContext:(id)clickContext
166                          identifier:(NSString *)identifier;
167
168/*!
169 *      @method notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:identifier:
170 *      @abstract Send a Growl notification.
171 *      @discussion This is the preferred means for sending a Growl notification.
172 *       The notification name and at least one of the title and description are
173 *       required (all three are preferred).  All other parameters may be
174 *       <code>nil</code> (or 0 or NO as appropriate) to accept default values.
175 *
176 *       If using the Growl-WithInstaller framework, if Growl is not installed the
177 *       user will be prompted to install Growl. If the user cancels, this method
178 *       will have no effect until the next application session, at which time when
179 *       it is called the user will be prompted again. The user is also given the
180 *       option to not be prompted again.  If the user does choose to install Growl,
181 *       the requested notification will be displayed once Growl is installed and
182 *       running.
183 *
184 *      @param title            The title of the notification displayed to the user.
185 *      @param description      The full description of the notification displayed to the user.
186 *      @param notifName        The internal name of the notification. Should be human-readable, as it will be displayed in the Growl preference pane.
187 *      @param iconData         <code>NSData</code> object to show with the notification as its icon. If <code>nil</code>, the application's icon will be used instead.
188 *      @param priority         The priority of the notification. The default value is 0; positive values are higher priority and negative values are lower priority. Not all Growl displays support priority.
189 *      @param isSticky         If YES, the notification will remain on screen until clicked. Not all Growl displays support sticky notifications.
190 *      @param clickContext     A context passed back to the Growl delegate if it implements -(void)growlNotificationWasClicked: and the notification is clicked. Not all display plugins support clicking. The clickContext must be plist-encodable (completely of <code>NSString</code>, <code>NSArray</code>, <code>NSNumber</code>, <code>NSDictionary</code>, and <code>NSData</code> types).
191 *      @param identifier       An identifier for this notification. Notifications with equal identifiers are coalesced.
192 */
193+ (void) notifyWithTitle:(NSString *)title
194                         description:(NSString *)description
195                notificationName:(NSString *)notifName
196                                iconData:(NSData *)iconData
197                                priority:(signed int)priority
198                                isSticky:(BOOL)isSticky
199                        clickContext:(id)clickContext
200                          identifier:(NSString *)identifier;
201
202/*!     @method notifyWithDictionary:
203 *      @abstract       Notifies using a userInfo dictionary suitable for passing to
204 *       <code>NSDistributedNotificationCenter</code>.
205 *      @param  userInfo        The dictionary to notify with.
206 *      @discussion     Before Growl 0.6, your application would have posted
207 *       notifications using <code>NSDistributedNotificationCenter</code> by
208 *       creating a userInfo dictionary with the notification data. This had the
209 *       advantage of allowing you to add other data to the dictionary for programs
210 *       besides Growl that might be listening.
211 *
212 *       This method allows you to use such dictionaries without being restricted
213 *       to using <code>NSDistributedNotificationCenter</code>. The keys for this dictionary
214 *       can be found in GrowlDefines.h.
215 */
216+ (void) notifyWithDictionary:(NSDictionary *)userInfo;
217
218#pragma mark -
219
220/*!     @method registerWithDictionary:
221 *      @abstract       Register your application with Growl without setting a delegate.
222 *      @discussion     When you call this method with a dictionary,
223 *       GrowlApplicationBridge registers your application using that dictionary.
224 *       If you pass <code>nil</code>, GrowlApplicationBridge will ask the delegate
225 *       (if there is one) for a dictionary, and if that doesn't work, it will look
226 *       in your application's bundle for an auto-discoverable plist.
227 *       (XXX refer to more information on that)
228 *
229 *       If you pass a dictionary to this method, it must include the
230 *       <code>GROWL_APP_NAME</code> key, unless a delegate is set.
231 *
232 *       This method is mainly an alternative to the delegate system introduced
233 *       with Growl 0.6. Without a delegate, you cannot receive callbacks such as
234 *       <code>-growlIsReady</code> (since they are sent to the delegate). You can,
235 *       however, set a delegate after registering without one.
236 *
237 *       This method was introduced in Growl.framework 0.7.
238 */
239+ (BOOL) registerWithDictionary:(NSDictionary *)regDict;
240
241/*!     @method reregisterGrowlNotifications
242 *      @abstract       Reregister the notifications for this application.
243 *      @discussion     This method does not normally need to be called.  If your
244 *       application changes what notifications it is registering with Growl, call
245 *       this method to have the Growl delegate's
246 *       <code>-registrationDictionaryForGrowl</code> method called again and the
247 *       Growl registration information updated.
248 *
249 *       This method is now implemented using <code>-registerWithDictionary:</code>.
250 */
251+ (void) reregisterGrowlNotifications;
252
253#pragma mark -
254
255/*!     @method setWillRegisterWhenGrowlIsReady:
256 *      @abstract       Tells GrowlApplicationBridge to register with Growl when Growl
257 *       launches (or not).
258 *      @discussion     When Growl has started listening for notifications, it posts a
259 *       <code>GROWL_IS_READY</code> notification on the Distributed Notification
260 *       Center. GrowlApplicationBridge listens for this notification, using it to
261 *       perform various tasks (such as calling your delegate's
262 *       <code>-growlIsReady</code> method, if it has one). If this method is
263 *       called with <code>YES</code>, one of those tasks will be to reregister
264 *       with Growl (in the manner of <code>-reregisterGrowlNotifications</code>).
265 *
266 *       This attribute is automatically set back to <code>NO</code> (the default)
267 *       after every <code>GROWL_IS_READY</code> notification.
268 *      @param  flag    <code>YES</code> if you want GrowlApplicationBridge to register with
269 *       Growl when next it is ready; <code>NO</code> if not.
270 */
271+ (void) setWillRegisterWhenGrowlIsReady:(BOOL)flag;
272/*!     @method willRegisterWhenGrowlIsReady
273 *      @abstract       Reports whether GrowlApplicationBridge will register with Growl
274 *       when Growl next launches.
275 *      @result <code>YES</code> if GrowlApplicationBridge will register with Growl
276 *       when next it posts GROWL_IS_READY; <code>NO</code> if not.
277 */
278+ (BOOL) willRegisterWhenGrowlIsReady;
279
280#pragma mark -
281
282/*!     @method registrationDictionaryFromDelegate
283 *      @abstract       Asks the delegate for a registration dictionary.
284 *      @discussion     If no delegate is set, or if the delegate's
285 *       <code>-registrationDictionaryForGrowl</code> method returns
286 *       <code>nil</code>, this method returns <code>nil</code>.
287 *
288 *       This method does not attempt to clean up the dictionary in any way - for
289 *       example, if it is missing the <code>GROWL_APP_NAME</code> key, the result
290 *       will be missing it too. Use <code>+[GrowlApplicationBridge
291 *       registrationDictionaryByFillingInDictionary:]</code> or
292 *       <code>+[GrowlApplicationBridge
293 *       registrationDictionaryByFillingInDictionary:restrictToKeys:]</code> to try
294 *       to fill in missing keys.
295 *
296 *       This method was introduced in Growl.framework 0.7.
297 *      @result A registration dictionary.
298 */
299+ (NSDictionary *) registrationDictionaryFromDelegate;
300
301/*!     @method registrationDictionaryFromBundle:
302 *      @abstract       Looks in a bundle for a registration dictionary.
303 *      @discussion     This method looks in a bundle for an auto-discoverable
304 *       registration dictionary file using <code>-[NSBundle
305 *       pathForResource:ofType:]</code>. If it finds one, it loads the file using
306 *       <code>+[NSDictionary dictionaryWithContentsOfFile:]</code> and returns the
307 *       result.
308 *
309 *       If you pass <code>nil</code> as the bundle, the main bundle is examined.
310 *
311 *       This method does not attempt to clean up the dictionary in any way - for
312 *       example, if it is missing the <code>GROWL_APP_NAME</code> key, the result
313 *       will be missing it too. Use <code>+[GrowlApplicationBridge
314 *       registrationDictionaryByFillingInDictionary:]</code> or
315 *       <code>+[GrowlApplicationBridge
316 *       registrationDictionaryByFillingInDictionary:restrictToKeys:]</code> to try
317 *       to fill in missing keys.
318 *
319 *       This method was introduced in Growl.framework 0.7.
320 *      @result A registration dictionary.
321 */
322+ (NSDictionary *) registrationDictionaryFromBundle:(NSBundle *)bundle;
323
324/*!     @method bestRegistrationDictionary
325 *      @abstract       Obtains a registration dictionary, filled out to the best of
326 *       GrowlApplicationBridge's knowledge.
327 *      @discussion     This method creates a registration dictionary as best
328 *       GrowlApplicationBridge knows how.
329 *
330 *       First, GrowlApplicationBridge contacts the Growl delegate (if there is
331 *       one) and gets the registration dictionary from that. If no such dictionary
332 *       was obtained, GrowlApplicationBridge looks in your application's main
333 *       bundle for an auto-discoverable registration dictionary file. If that
334 *       doesn't exist either, this method returns <code>nil</code>.
335 *
336 *       Second, GrowlApplicationBridge calls
337 *       <code>+registrationDictionaryByFillingInDictionary:</code> with whatever
338 *       dictionary was obtained. The result of that method is the result of this
339 *       method.
340 *
341 *       GrowlApplicationBridge uses this method when you call
342 *       <code>+setGrowlDelegate:</code>, or when you call
343 *       <code>+registerWithDictionary:</code> with <code>nil</code>.
344 *
345 *       This method was introduced in Growl.framework 0.7.
346 *      @result A registration dictionary.
347 */
348+ (NSDictionary *) bestRegistrationDictionary;
349
350#pragma mark -
351
352/*!     @method registrationDictionaryByFillingInDictionary:
353 *      @abstract       Tries to fill in missing keys in a registration dictionary.
354 *      @discussion     This method examines the passed-in dictionary for missing keys,
355 *       and tries to work out correct values for them. As of 0.7, it uses:
356 *
357 *       Key                                                                 Value
358 *       ---                                                                 -----
359 *       <code>GROWL_APP_NAME</code>                 <code>CFBundleExecutableName</code>
360 *       <code>GROWL_APP_ICON</code>                 The icon of the application.
361 *       <code>GROWL_APP_LOCATION</code>             The location of the application.
362 *       <code>GROWL_NOTIFICATIONS_DEFAULT</code>    <code>GROWL_NOTIFICATIONS_ALL</code>
363 *
364 *       Keys are only filled in if missing; if a key is present in the dictionary,
365 *       its value will not be changed.
366 *
367 *       This method was introduced in Growl.framework 0.7.
368 *      @param  regDict The dictionary to fill in.
369 *      @result The dictionary with the keys filled in. This is an autoreleased
370 *       copy of <code>regDict</code>.
371 */
372+ (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict;
373/*!     @method registrationDictionaryByFillingInDictionary:restrictToKeys:
374 *      @abstract       Tries to fill in missing keys in a registration dictionary.
375 *      @discussion     This method examines the passed-in dictionary for missing keys,
376 *       and tries to work out correct values for them. As of 0.7, it uses:
377 *
378 *       Key                                                                 Value
379 *       ---                                                                 -----
380 *       <code>GROWL_APP_NAME</code>                 <code>CFBundleExecutableName</code>
381 *       <code>GROWL_APP_ICON</code>                 The icon of the application.
382 *       <code>GROWL_APP_LOCATION</code>             The location of the application.
383 *       <code>GROWL_NOTIFICATIONS_DEFAULT</code>    <code>GROWL_NOTIFICATIONS_ALL</code>
384 *
385 *       Only those keys that are listed in <code>keys</code> will be filled in.
386 *       Other missing keys are ignored. Also, keys are only filled in if missing;
387 *       if a key is present in the dictionary, its value will not be changed.
388 *
389 *       This method was introduced in Growl.framework 0.7.
390 *      @param  regDict The dictionary to fill in.
391 *      @param  keys    The keys to fill in. If <code>nil</code>, any missing keys are filled in.
392 *      @result The dictionary with the keys filled in. This is an autoreleased
393 *       copy of <code>regDict</code>.
394 */
395+ (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict restrictToKeys:(NSSet *)keys;
396
397/*!     @brief  Tries to fill in missing keys in a notification dictionary.
398 *      @param  notifDict       The dictionary to fill in.
399 *      @return The dictionary with the keys filled in. This will be a separate instance from \a notifDict.
400 *      @discussion     This function examines the \a notifDict for missing keys, and
401 *       tries to get them from the last known registration dictionary. As of 1.1,
402 *       the keys that it will look for are:
403 *
404 *       \li <code>GROWL_APP_NAME</code>
405 *       \li <code>GROWL_APP_ICON</code>
406 *
407 *      @since Growl.framework 1.1
408 */
409+ (NSDictionary *) notificationDictionaryByFillingInDictionary:(NSDictionary *)regDict;
410
411+ (NSDictionary *) frameworkInfoDictionary;
412@end
413
414//------------------------------------------------------------------------------
415#pragma mark -
416
417/*!
418 *      @protocol GrowlApplicationBridgeDelegate
419 *      @abstract Required protocol for the Growl delegate.
420 *      @discussion The methods in this protocol are required and are called
421 *       automatically as needed by GrowlApplicationBridge. See
422 *       <code>+[GrowlApplicationBridge setGrowlDelegate:]</code>.
423 *       See also <code>GrowlApplicationBridgeDelegate_InformalProtocol</code>.
424 */
425
426@protocol GrowlApplicationBridgeDelegate
427
428// -registrationDictionaryForGrowl has moved to the informal protocol as of 0.7.
429
430@end
431
432//------------------------------------------------------------------------------
433#pragma mark -
434
435/*!
436 *      @category NSObject(GrowlApplicationBridgeDelegate_InformalProtocol)
437 *      @abstract Methods which may be optionally implemented by the GrowlDelegate.
438 *      @discussion The methods in this informal protocol will only be called if implemented by the delegate.
439 */
440@interface NSObject (GrowlApplicationBridgeDelegate_InformalProtocol)
441
442/*!
443 *      @method registrationDictionaryForGrowl
444 *      @abstract Return the dictionary used to register this application with Growl.
445 *      @discussion The returned dictionary gives Growl the complete list of
446 *       notifications this application will ever send, and it also specifies which
447 *       notifications should be enabled by default.  Each is specified by an array
448 *       of <code>NSString</code> objects.
449 *
450 *       For most applications, these two arrays can be the same (if all sent
451 *       notifications should be displayed by default).
452 *
453 *       The <code>NSString</code> objects of these arrays will correspond to the
454 *       <code>notificationName:</code> parameter passed in
455 *       <code>+[GrowlApplicationBridge
456 *       notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:]</code> calls.
457 *
458 *       The dictionary should have the required key object pairs:
459 *       key: GROWL_NOTIFICATIONS_ALL           object: <code>NSArray</code> of <code>NSString</code> objects
460 *       key: GROWL_NOTIFICATIONS_DEFAULT       object: <code>NSArray</code> of <code>NSString</code> objects
461 *
462 *   The dictionary may have the following key object pairs:
463 *   key: GROWL_NOTIFICATIONS_HUMAN_READABLE_NAMES      object: <code>NSDictionary</code> of key: notification name             object: human-readable notification name
464 *
465 *       You do not need to implement this method if you have an auto-discoverable
466 *       plist file in your app bundle. (XXX refer to more information on that)
467 *
468 *      @result The <code>NSDictionary</code> to use for registration.
469 */
470- (NSDictionary *) registrationDictionaryForGrowl;
471
472/*!
473 *      @method applicationNameForGrowl
474 *      @abstract Return the name of this application which will be used for Growl bookkeeping.
475 *      @discussion This name is used both internally and in the Growl preferences.
476 *
477 *       This should remain stable between different versions and incarnations of
478 *       your application.
479 *       For example, "SurfWriter" is a good app name, whereas "SurfWriter 2.0" and
480 *       "SurfWriter Lite" are not.
481 *
482 *       You do not need to implement this method if you are providing the
483 *       application name elsewhere, meaning in an auto-discoverable plist file in
484 *       your app bundle (XXX refer to more information on that) or in the result
485 *       of -registrationDictionaryForGrowl.
486 *
487 *      @result The name of the application using Growl.
488 */
489- (NSString *) applicationNameForGrowl;
490
491/*!
492 *      @method applicationIconForGrowl
493 *      @abstract Return the <code>NSImage</code> to treat as the application icon.
494 *      @discussion The delegate may optionally return an <code>NSImage</code>
495 *       object to use as the application icon. If this method is not implemented,
496 *       {{{-applicationIconDataForGrowl}}} is tried. If that method is not
497 *       implemented, the application's own icon is used. Neither method is
498 *       generally needed.
499 *      @result The <code>NSImage</code> to treat as the application icon.
500 */
501- (NSImage *) applicationIconForGrowl;
502
503/*!
504 *      @method applicationIconDataForGrowl
505 *      @abstract Return the <code>NSData</code> to treat as the application icon.
506 *      @discussion The delegate may optionally return an <code>NSData</code>
507 *       object to use as the application icon; if this is not implemented, the
508 *       application's own icon is used.  This is not generally needed.
509 *      @result The <code>NSData</code> to treat as the application icon.
510 *      @deprecated In version 1.1, in favor of {{{-applicationIconForGrowl}}}.
511 */
512- (NSData *) applicationIconDataForGrowl;
513
514/*!
515 *      @method growlIsReady
516 *      @abstract Informs the delegate that Growl has launched.
517 *      @discussion Informs the delegate that Growl (specifically, the
518 *       GrowlHelperApp) was launched successfully. The application can take actions
519 *   with the knowledge that Growl is installed and functional.
520 */
521- (void) growlIsReady;
522
523/*!
524 *      @method growlNotificationWasClicked:
525 *      @abstract Informs the delegate that a Growl notification was clicked.
526 *      @discussion Informs the delegate that a Growl notification was clicked.  It
527 *       is only sent for notifications sent with a non-<code>nil</code>
528 *       clickContext, so if you want to receive a message when a notification is
529 *       clicked, clickContext must not be <code>nil</code> when calling
530 *       <code>+[GrowlApplicationBridge notifyWithTitle: description:notificationName:iconData:priority:isSticky:clickContext:]</code>.
531 *      @param clickContext The clickContext passed when displaying the notification originally via +[GrowlApplicationBridge notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:].
532 */
533- (void) growlNotificationWasClicked:(id)clickContext;
534
535/*!
536 *      @method growlNotificationTimedOut:
537 *      @abstract Informs the delegate that a Growl notification timed out.
538 *      @discussion Informs the delegate that a Growl notification timed out. It
539 *       is only sent for notifications sent with a non-<code>nil</code>
540 *       clickContext, so if you want to receive a message when a notification is
541 *       clicked, clickContext must not be <code>nil</code> when calling
542 *       <code>+[GrowlApplicationBridge notifyWithTitle: description:notificationName:iconData:priority:isSticky:clickContext:]</code>.
543 *      @param clickContext The clickContext passed when displaying the notification originally via +[GrowlApplicationBridge notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:].
544 */
545- (void) growlNotificationTimedOut:(id)clickContext;
546
547@end
548
549#pragma mark -
550/*!
551 *      @category NSObject(GrowlApplicationBridgeDelegate_Installation_InformalProtocol)
552 *      @abstract Methods which may be optionally implemented by the Growl delegate when used with Growl-WithInstaller.framework.
553 *      @discussion The methods in this informal protocol will only be called if
554 *       implemented by the delegate.  They allow greater control of the information
555 *       presented to the user when installing or upgrading Growl from within your
556 *       application when using Growl-WithInstaller.framework.
557 */
558@interface NSObject (GrowlApplicationBridgeDelegate_Installation_InformalProtocol)
559
560/*!
561 *      @method growlInstallationWindowTitle
562 *      @abstract Return the title of the installation window.
563 *      @discussion If not implemented, Growl will use a default, localized title.
564 *      @result An NSString object to use as the title.
565 */
566- (NSString *)growlInstallationWindowTitle;
567
568/*!
569 *      @method growlUpdateWindowTitle
570 *      @abstract Return the title of the upgrade window.
571 *      @discussion If not implemented, Growl will use a default, localized title.
572 *      @result An NSString object to use as the title.
573 */
574- (NSString *)growlUpdateWindowTitle;
575
576/*!
577 *      @method growlInstallationInformation
578 *      @abstract Return the information to display when installing.
579 *      @discussion This information may be as long or short as desired (the window
580 *       will be sized to fit it).  It will be displayed to the user as an
581 *       explanation of what Growl is and what it can do in your application.  It
582 *       should probably note that no download is required to install.
583 *
584 *       If this is not implemented, Growl will use a default, localized explanation.
585 *      @result An NSAttributedString object to display.
586 */
587- (NSAttributedString *)growlInstallationInformation;
588
589/*!
590 *      @method growlUpdateInformation
591 *      @abstract Return the information to display when upgrading.
592 *      @discussion This information may be as long or short as desired (the window
593 *       will be sized to fit it).  It will be displayed to the user as an
594 *       explanation that an updated version of Growl is included in your
595 *       application and no download is required.
596 *
597 *       If this is not implemented, Growl will use a default, localized explanation.
598 *      @result An NSAttributedString object to display.
599 */
600- (NSAttributedString *)growlUpdateInformation;
601
602@end
603
604//private
605@interface GrowlApplicationBridge (GrowlInstallationPrompt_private)
606+ (void) _userChoseNotToInstallGrowl;
607@end
608
609#endif /* __GrowlApplicationBridge_h__ */
Note: See TracBrowser for help on using the repository browser.