1 | // |
---|
2 | // AIImageViewWithImagePicker.h |
---|
3 | // Adium |
---|
4 | // |
---|
5 | // Created by Evan Schoenberg on Sun Jun 06 2004. |
---|
6 | // Copyright (c) 2004-2005 The Adium Team. All rights reserved. |
---|
7 | // |
---|
8 | |
---|
9 | @class AIImageViewWithImagePicker; |
---|
10 | @class IKPictureTakerRecentPicture; //Private 10.5 class |
---|
11 | @class NSImage, NSString, NSResponder; |
---|
12 | |
---|
13 | /*! |
---|
14 | * @protocol AIImageViewWithImagePickerDelegate |
---|
15 | * @brief Delegate protocol for <tt>AIImageViewWithImagePicker</tt> |
---|
16 | * |
---|
17 | * Delegate protocol for <tt>AIImageViewWithImagePicker</tt>. Implementation of all methods is optional. |
---|
18 | */ |
---|
19 | @protocol AIImageViewWithImagePickerDelegate |
---|
20 | /*! |
---|
21 | * imageViewWithImagePicker:didChangeToImage: |
---|
22 | * @brief Notifies the delegate of a new image |
---|
23 | * |
---|
24 | * Notifies the delegate of a new image selected by the user (which may have been set in any of the ways explained in the class description). |
---|
25 | * This may not provide information as worthwhile as imageViewWithImagePicker:didChangeToImageData:, which is the recommended method to implement |
---|
26 | * @param picker The <tt>AIImageViewWithImagePicker</tt> which changed |
---|
27 | * @param image An <tt>NSImage</tt> of the new image |
---|
28 | */ |
---|
29 | - (void)imageViewWithImagePicker:(AIImageViewWithImagePicker *)picker didChangeToImage:(NSImage *)image; |
---|
30 | |
---|
31 | /*! |
---|
32 | * imageViewWithImagePicker:didChangeToImageData: |
---|
33 | * @brief Notifies the delegate of a new image |
---|
34 | * |
---|
35 | * Notifies the delegate of a new image selected by the user (which may have been set in any of the ways explained in the class description). |
---|
36 | * @param picker The <tt>AIImageViewWithImagePicker</tt> which changed |
---|
37 | * @param imageData An <tt>NSData</tt> with data for the new image |
---|
38 | */ |
---|
39 | - (void)imageViewWithImagePicker:(AIImageViewWithImagePicker *)picker didChangeToImageData:(NSData *)imageData; |
---|
40 | |
---|
41 | /*! |
---|
42 | * deleteInImageViewWithImagePicker: |
---|
43 | * @brief Notifies the delegate of an attempt to delete the image |
---|
44 | * |
---|
45 | * Notifies the delegate of an attempt to delete the image. This may occur by the user pressing delete with the image selected or by the user performing a Cut operation on it. Recommended behavior is to clear the image view or to replace the image with a default. |
---|
46 | * @param picker The <tt>AIImageViewWithImagePicker</tt> which changed |
---|
47 | */ |
---|
48 | - (void)deleteInImageViewWithImagePicker:(AIImageViewWithImagePicker *)picker; |
---|
49 | |
---|
50 | /*! |
---|
51 | * imageForImageViewWithImagePicker: |
---|
52 | * @brief Requests the image to display in the Image Picker when it is displayed via user action |
---|
53 | * |
---|
54 | * By default, the Image Picker will use the same image as the <tt>AIImageViewWithImagePicker</tt> object does. However, if the delegate wishes to supply a different image to be initially displayed in the Image Picker (for example, if a larger or higher resolution image is available), it may implement this method. If this method returns nil, the imageView's own image will be used just as if the method were not implemented. |
---|
55 | * @param picker The <tt>AIImageViewWithImagePicker</tt> which will display the Image Picker |
---|
56 | * @return An <tt>NSImage</tt> to display in the Image Picker, or nil if the <tt>AIImageViewWithImagePicker</tt>'s own image should be used. |
---|
57 | */ |
---|
58 | - (NSImage *)imageForImageViewWithImagePicker:(AIImageViewWithImagePicker *)picker; |
---|
59 | |
---|
60 | /*! |
---|
61 | * imageForImageViewWithImagePicker: |
---|
62 | * @brief Requests the image to display in the recents popup to mean 'no image' |
---|
63 | */ |
---|
64 | - (NSImage *)emptyPictureImageForImageViewWithImagePicker:(AIImageViewWithImagePicker *)picker; |
---|
65 | |
---|
66 | /*! |
---|
67 | * fileNameForImageInImagePicker |
---|
68 | * @brief Requests the name under which to save a file dragged from the image picker to the Finder or another destination |
---|
69 | * |
---|
70 | * The name should not have an extension and must not contain characters which are illegal in file names. |
---|
71 | * Return nil to have the image picker use a default name. |
---|
72 | */ |
---|
73 | - (NSString *)fileNameForImageInImagePicker:(AIImageViewWithImagePicker *)picker; |
---|
74 | @end |
---|
75 | |
---|
76 | @interface AIImageViewWithImagePicker : NSImageView { |
---|
77 | NSString *title; |
---|
78 | id pictureTaker; |
---|
79 | id activeRecentPicture; |
---|
80 | |
---|
81 | BOOL usePictureTaker; |
---|
82 | BOOL presentPictureTakerAsSheet; |
---|
83 | |
---|
84 | IBOutlet id delegate; |
---|
85 | |
---|
86 | BOOL shouldDrawFocusRing; |
---|
87 | NSResponder *lastResp; |
---|
88 | |
---|
89 | NSPoint mouseDownPos; |
---|
90 | |
---|
91 | NSSize maxSize; |
---|
92 | } |
---|
93 | |
---|
94 | - (void)setDelegate:(id)inDelegate; |
---|
95 | - (id)delegate; |
---|
96 | - (void)setTitle:(NSString *)inTitle; |
---|
97 | - (IBAction)showImagePicker:(id)sender; |
---|
98 | - (void)setUsePictureTaker:(BOOL)inUsePictureTaker; |
---|
99 | - (id)pictureTaker; |
---|
100 | - (void)setPresentPictureTakerAsSheet:(BOOL)inPresentPictureTakerAsSheet; |
---|
101 | - (void)setMaxSize:(NSSize)inMaxSize; |
---|
102 | |
---|
103 | - (void)setRecentPictureAsImageInput:(IKPictureTakerRecentPicture *)recentPicture; |
---|
104 | |
---|
105 | @end |
---|