1 | // Note: This is a header file for the private, undocumented NSImagePickerController used in iChat and Address Book |
---|
2 | // Its use requires the target to include the AddressBook framework, and it only on 10.3 and 10.4 (but not 10.5 or greater). |
---|
3 | |
---|
4 | /* |
---|
5 | Â Â * Â Â Derrived from the output of class-dump (version 2.1.5) by Nicko van Someren. |
---|
6 | Â Â * Â Â class-dump is Copyright (C) 1997, 1999, 2000, 2001 by Steve Nygard. |
---|
7 | |
---|
8 | Â Â * Â Â Â Â Â Â Â Â Â Â Â ****** WARNING !!!! ****** |
---|
9 | Â Â * |
---|
10 | Â Â * This set of classes is not documented by Apple, and as such there is |
---|
11 | Â Â * absolutely no guarantee that it will not change! Â There are clear signs |
---|
12 | Â Â * that the API was never expected to be used by third parties in its current |
---|
13 | Â Â * form. |
---|
14 | Â Â * |
---|
15 | Â Â * Â Â Â Â Â Â Â Â ****** USE AT YOUR OWN RISK !!!! ****** |
---|
16 | |
---|
17 | Â Â * Refers to parts of file: /System/Library/Frameworks/AddressBook.framework/AddressBook and |
---|
18 | Â Â * .../AddressBook.framework/ImagePickerQTParts.bundle/Contents/MacOS/ImagePickerQTParts |
---|
19 | Â Â */ |
---|
20 | |
---|
21 | #import <AppKit/AppKit.h> |
---|
22 | |
---|
23 | // This is defined as a protcol for documentation reasons; it's not really necessary to have it so |
---|
24 | @protocol ApparentlyNSImagePickerDelegateProtocol |
---|
25 | |
---|
26 | // This gets called when the user selects OK on a new image |
---|
27 | - (void)imagePicker: (id) sender selectedImage: (NSImage *) image; |
---|
28 | |
---|
29 | // This is called if the user cancels an image selection |
---|
30 | - (void)imagePickerCanceled: (id) sender; |
---|
31 | |
---|
32 | // This is called to provide an image when the delegate is first set and |
---|
33 | // following selectionChanged messages to the controller. |
---|
34 | // The junk on the end seems to be the selector name for the method itself |
---|
35 | - (NSImage *) displayImageInPicker: junk; |
---|
36 | |
---|
37 | // This is called to give a title for the picker. It is called as above. |
---|
38 | // Note that you must not return nil or the window gets upset |
---|
39 | - (NSString *) displayTitleInPicker: junk; |
---|
40 | @end |
---|
41 | |
---|
42 | |
---|
43 | @interface NSIPRecentPicture:NSObject |
---|
44 | { |
---|
45 | NSString *_originalImageName; |
---|
46 | NSImage *_originalImage; |
---|
47 | NSRect _crop; |
---|
48 | NSData *_smallIconData; |
---|
49 | } |
---|
50 | |
---|
51 | + pictureDirPath; |
---|
52 | + (int)maxRecents; |
---|
53 | + _infoFilePath; |
---|
54 | + (char)purgeExtras; |
---|
55 | + (void)_saveChanges; |
---|
56 | + recentPictures; |
---|
57 | + recentSmallIcons; |
---|
58 | + currentPicture; |
---|
59 | + (void)noCurrentPicture; |
---|
60 | + (void)removeAllButCurrent; |
---|
61 | - initWithOriginalImage:fp8 crop:(NSRect)fp12 smallIcon:fp28; |
---|
62 | - initWithOriginalImage:fp8; |
---|
63 | - initWithInfo:fp8; |
---|
64 | - (void)dealloc; |
---|
65 | - _infoToSave; |
---|
66 | - originalImagePath; |
---|
67 | - originalImage; |
---|
68 | - croppedImage; |
---|
69 | - smallIcon; |
---|
70 | - (NSRect)crop; |
---|
71 | - (void)setCrop:(NSRect)fp8 smallIcon:fp24; |
---|
72 | - (void)_removePermanently; |
---|
73 | - (void)setCurrent; |
---|
74 | |
---|
75 | @end |
---|
76 | |
---|
77 | @interface NSImagePickerController:NSWindowController |
---|
78 | { |
---|
79 | @private |
---|
80 | id _imageView; |
---|
81 | id _layerSuperview; |
---|
82 | NSSlider *_slider; |
---|
83 | id _recentMenu; |
---|
84 | NSButton *_cameraButton; |
---|
85 | NSButton *_smallerButton; |
---|
86 | NSButton *_largerButton; |
---|
87 | NSButton *_chooseButton; |
---|
88 | NSButton *_setButton; |
---|
89 | NSImage *_originalImage; |
---|
90 | NSSize _originalSize; |
---|
91 | NSSize _targetSize; |
---|
92 | NSSize _minSize; |
---|
93 | NSSize _maxSize; |
---|
94 | float _defaultSliderPos; |
---|
95 | NSIPRecentPicture *_recentPicture; |
---|
96 | char _changed; |
---|
97 | char _changesAccepted; |
---|
98 | char _takingPicture; |
---|
99 | id _target; |
---|
100 | SEL _action; |
---|
101 | void *_userInfo; |
---|
102 | id _delegate; |
---|
103 | } |
---|
104 | |
---|
105 | // This seems to be the best way to get the Image Picker we should use |
---|
106 | + (NSImagePickerController *) sharedImagePickerControllerCreate: (BOOL) create; |
---|
107 | |
---|
108 | // This is the pop-up for the recently presented pictures |
---|
109 | + recentPicturesPopUp; |
---|
110 | |
---|
111 | // The point given is NOT taken within the context of the window! |
---|
112 | - initAtPoint:(NSPoint) p inWindow: w; |
---|
113 | |
---|
114 | // Don't use this method! Implement delegate imagePicker:selectedImage: and imagePickerCanceled: instead |
---|
115 | // This target here can't work out if the user hit Cancel |
---|
116 | - (void)setTarget: onObject selector:(SEL) aSelector userInfo:(void *) context; |
---|
117 | |
---|
118 | // Get the image back |
---|
119 | - image; |
---|
120 | |
---|
121 | // Get back the image that was there before |
---|
122 | - originalImage; |
---|
123 | |
---|
124 | // Set the delegate |
---|
125 | - (void)setDelegate: anObject; |
---|
126 | |
---|
127 | // Notify the controller that the selection for which we are setting the image |
---|
128 | // has changed. This causes the delegate to be asked for a new image and title |
---|
129 | - (void)selectionChanged; |
---|
130 | |
---|
131 | |
---|
132 | - (void)hideRecentsPopUp; |
---|
133 | |
---|
134 | @end |
---|
135 | |
---|
136 | @interface NSImagePickerController(QTImagePickerBundle) |
---|
137 | // Get information about the inner bundle |
---|
138 | + bundle; |
---|
139 | |
---|
140 | // Get/Set if the user has changed anything in the dialoge |
---|
141 | - (void)setHasChanged: (BOOL) changed; |
---|
142 | - (BOOL)hasChanged; |
---|
143 | |
---|
144 | - (void)handlePictureTakenNotification: (NSNotification *) aNotification; |
---|
145 | |
---|
146 | // You need to call this when you get notification that a cammera has been (un)plugged |
---|
147 | - (void)_updateCameraButton; |
---|
148 | |
---|
149 | // Set the image to be displayed. Â Useful for the initial image, or you can implement delegate displayImageInPicker: |
---|
150 | - (void)setWidgetImage: (NSImage *) anImage; |
---|
151 | |
---|
152 | // Get and set the cropping rectangle |
---|
153 | - (NSRect)crop; |
---|
154 | - (void)setCrop: (NSRect) aRect; |
---|
155 | |
---|
156 | |
---|
157 | // The remaining methods are ones that are not obviously standard methods or actions for the panel |
---|
158 | // but which I've not yet work out |
---|
159 | |
---|
160 | // Fakes OK and Cancel |
---|
161 | - (void)sendChangesToOwner; |
---|
162 | - (void)sendCancelToOwner; |
---|
163 | |
---|
164 | // Handles information pertaining to the recent pictures list |
---|
165 | - (void)setRecentPicture:(NSIPRecentPicture *)ipRecentPicture; |
---|
166 | - (NSIPRecentPicture *)recentPicture; |
---|
167 | |
---|
168 | - (void)setViewImage:(NSSize)fp8; |
---|
169 | |
---|
170 | @end |
---|