| 1 | // |
---|
| 2 | // AIFloater.h |
---|
| 3 | // Adium |
---|
| 4 | // |
---|
| 5 | // Created by Evan Schoenberg on Wed Oct 08 2003. |
---|
| 6 | // Copyright (c) 2003-2005 The Adium Team. All rights reserved. |
---|
| 7 | // |
---|
| 8 | |
---|
| 9 | #import <Foundation/Foundation.h> |
---|
| 10 | |
---|
| 11 | /*! |
---|
| 12 | * @class AIFloater |
---|
| 13 | * @brief A programtically movable, fadable <tt>NSImage</tt> display class |
---|
| 14 | * |
---|
| 15 | * <tt>AIFloater</tt> allows for the display of an <tt>NSImage</tt>, including an animating one, anywhere on the screen. The image can be easily moved programatically and will fade into and out of view as requested. |
---|
| 16 | */ |
---|
| 17 | @interface AIFloater : NSObject { |
---|
| 18 | NSImageView *staticView; |
---|
| 19 | NSPanel *panel; |
---|
| 20 | BOOL windowIsVisible; |
---|
| 21 | NSTimer *visibilityTimer; |
---|
| 22 | float maxOpacity; |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | /*! |
---|
| 26 | * @brief Create an <tt>AIFloater</tt>. |
---|
| 27 | * |
---|
| 28 | * It will handle releasing itself when closed; it need not be retained by the caller. |
---|
| 29 | */ |
---|
| 30 | + (id)floaterWithImage:(NSImage *)inImage styleMask:(unsigned int)styleMask; |
---|
| 31 | |
---|
| 32 | /*! |
---|
| 33 | * Position the float at a specified point |
---|
| 34 | */ |
---|
| 35 | - (void)moveFloaterToPoint:(NSPoint)inPoint; |
---|
| 36 | |
---|
| 37 | /*! |
---|
| 38 | * Close the floater. This will also release it. |
---|
| 39 | */ |
---|
| 40 | - (IBAction)close:(id)sender; |
---|
| 41 | |
---|
| 42 | /*! |
---|
| 43 | * @brief Set the image the floater displays. |
---|
| 44 | * |
---|
| 45 | * This <tt>NSImage</tt> will be displayed at its full size, animating if appropriate. |
---|
| 46 | * |
---|
| 47 | * @param inImage The image to display |
---|
| 48 | */ |
---|
| 49 | - (void)setImage:(NSImage *)inImage; |
---|
| 50 | |
---|
| 51 | /*! |
---|
| 52 | * Return the image the floater displays |
---|
| 53 | * |
---|
| 54 | * @result The image |
---|
| 55 | */ |
---|
| 56 | - (NSImage *)image; |
---|
| 57 | |
---|
| 58 | /*! |
---|
| 59 | * @brief Set the visibility of the image, optionally animating in/out of view |
---|
| 60 | * |
---|
| 61 | * @param inVisible YES if the image should be shown on screen; NO if it should not |
---|
| 62 | * @param animate If YES and inVisibile is the opposite of the current visibility, the image will fade into/out of view by changing its opacity over time towards its maximum (to fade in) or towards 0 (to fade out). |
---|
| 63 | */ |
---|
| 64 | - (void)setVisible:(BOOL)inVisible animate:(BOOL)animate; |
---|
| 65 | |
---|
| 66 | /*! |
---|
| 67 | * @brief Set the maximum opacity of the floater |
---|
| 68 | * |
---|
| 69 | * The floater will never exceed this opacity; it will be shown at it when visible and will fade to/from it if animating into/out of view. |
---|
| 70 | * |
---|
| 71 | * @param inMaxOpacity The maximum opacity |
---|
| 72 | */ |
---|
| 73 | - (void)setMaxOpacity:(float)inMaxOpacity; |
---|
| 74 | |
---|
| 75 | //- (void)endFloater; |
---|
| 76 | |
---|
| 77 | @end |
---|