1 """Suite WorldWideWeb suite, as defined in Spyglass spec.:
4 Generated from /Volumes/Sap/Applications (Mac OS 9)/Netscape Communicator\xe2\x84\xa2 Folder/Netscape Communicator\xe2\x84\xa2
5 AETE/AEUT resource version 1/0, language 0, script 0
13 class WorldWideWeb_suite_Events:
21 'progressApp' : 'PROG',
24 def OpenURL(self, _object, _attributes={}, **_arguments):
25 """OpenURL: Opens a URL. Allows for more options than GetURL event
26 Required argument: URL
27 Keyword argument to: file destination
28 Keyword argument toWindow: window iD
29 Keyword argument flags: Binary: any combination of 1, 2 and 4 is allowed: 1 and 2 mean force reload the document. 4 is ignored
30 Keyword argument post_data: Form posting data
31 Keyword argument post_type: MIME type of the posting data. Defaults to application/x-www-form-urlencoded
32 Keyword argument progressApp: Application that will display progress
33 Keyword argument _attributes: AppleEvent attribute dictionary
34 Returns: ID of the loading window
39 aetools.keysubst(_arguments, self._argmap_OpenURL)
40 _arguments['----'] = _object
43 _reply, _arguments, _attributes = self.send(_code, _subcode,
44 _arguments, _attributes)
45 if _arguments.get('errn', 0):
46 raise aetools.Error, aetools.decodeerror(_arguments)
47 # XXXX Optionally decode result
48 if _arguments.has_key('----'):
49 return _arguments['----']
57 def ShowFile(self, _object, _attributes={}, **_arguments):
58 """ShowFile: Similar to OpenDocuments, except that it specifies the parent URL, and MIME type of the file
59 Required argument: File to open
60 Keyword argument MIME_type: MIME type
61 Keyword argument Window_ID: Window to open the file in
62 Keyword argument URL: Use this as a base URL
63 Keyword argument _attributes: AppleEvent attribute dictionary
64 Returns: Window ID of the loaded window. 0 means ShowFile failed, FFFFFFF means that data was not appropriate type to display in the browser.
69 aetools.keysubst(_arguments, self._argmap_ShowFile)
70 _arguments['----'] = _object
73 _reply, _arguments, _attributes = self.send(_code, _subcode,
74 _arguments, _attributes)
75 if _arguments.get('errn', 0):
76 raise aetools.Error, aetools.decodeerror(_arguments)
77 # XXXX Optionally decode result
78 if _arguments.has_key('----'):
79 return _arguments['----']
81 _argmap_cancel_progress = {
85 def cancel_progress(self, _object=None, _attributes={}, **_arguments):
86 """cancel progress: Interrupts the download of the document in the given window
87 Required argument: progress ID, obtained from the progress app
88 Keyword argument in_window: window ID of the progress to cancel
89 Keyword argument _attributes: AppleEvent attribute dictionary
94 aetools.keysubst(_arguments, self._argmap_cancel_progress)
95 _arguments['----'] = _object
98 _reply, _arguments, _attributes = self.send(_code, _subcode,
99 _arguments, _attributes)
100 if _arguments.get('errn', 0):
101 raise aetools.Error, aetools.decodeerror(_arguments)
102 # XXXX Optionally decode result
103 if _arguments.has_key('----'):
104 return _arguments['----']
106 def find_URL(self, _object, _attributes={}, **_arguments):
107 """find URL: If the file was downloaded by Netscape, you can call FindURL to find out the URL used to download the file.
108 Required argument: File spec
109 Keyword argument _attributes: AppleEvent attribute dictionary
115 if _arguments: raise TypeError, 'No optional args expected'
116 _arguments['----'] = _object
119 _reply, _arguments, _attributes = self.send(_code, _subcode,
120 _arguments, _attributes)
121 if _arguments.get('errn', 0):
122 raise aetools.Error, aetools.decodeerror(_arguments)
123 # XXXX Optionally decode result
124 if _arguments.has_key('----'):
125 return _arguments['----']
127 def get_window_info(self, _object=None, _attributes={}, **_arguments):
128 """get window info: Returns the information about the window as a list. Currently the list contains the window title and the URL. You can get the same information using standard Apple Event GetProperty.
129 Required argument: window ID
130 Keyword argument _attributes: AppleEvent attribute dictionary
131 Returns: undocumented, typecode 'list'
136 if _arguments: raise TypeError, 'No optional args expected'
137 _arguments['----'] = _object
140 _reply, _arguments, _attributes = self.send(_code, _subcode,
141 _arguments, _attributes)
142 if _arguments.get('errn', 0):
143 raise aetools.Error, aetools.decodeerror(_arguments)
144 # XXXX Optionally decode result
145 if _arguments.has_key('----'):
146 return _arguments['----']
148 def list_windows(self, _no_object=None, _attributes={}, **_arguments):
149 """list windows: Lists the IDs of all the hypertext windows
150 Keyword argument _attributes: AppleEvent attribute dictionary
151 Returns: List of unique IDs of all the hypertext windows
156 if _arguments: raise TypeError, 'No optional args expected'
157 if _no_object is not None: raise TypeError, 'No direct arg expected'
160 _reply, _arguments, _attributes = self.send(_code, _subcode,
161 _arguments, _attributes)
162 if _arguments.get('errn', 0):
163 raise aetools.Error, aetools.decodeerror(_arguments)
164 # XXXX Optionally decode result
165 if _arguments.has_key('----'):
166 return _arguments['----']
168 _argmap_parse_anchor = {
169 'relative_to' : 'RELA',
172 def parse_anchor(self, _object, _attributes={}, **_arguments):
173 """parse anchor: Resolves the relative URL
174 Required argument: Main URL
175 Keyword argument relative_to: Relative URL
176 Keyword argument _attributes: AppleEvent attribute dictionary
182 aetools.keysubst(_arguments, self._argmap_parse_anchor)
183 _arguments['----'] = _object
186 _reply, _arguments, _attributes = self.send(_code, _subcode,
187 _arguments, _attributes)
188 if _arguments.get('errn', 0):
189 raise aetools.Error, aetools.decodeerror(_arguments)
190 # XXXX Optionally decode result
191 if _arguments.has_key('----'):
192 return _arguments['----']
194 def register_URL_echo(self, _object=None, _attributes={}, **_arguments):
195 """register URL echo: Registers the \xd2echo\xd3 application. Each download from now on will be echoed to this application.
196 Required argument: Application signature
197 Keyword argument _attributes: AppleEvent attribute dictionary
202 if _arguments: raise TypeError, 'No optional args expected'
203 _arguments['----'] = _object
206 _reply, _arguments, _attributes = self.send(_code, _subcode,
207 _arguments, _attributes)
208 if _arguments.get('errn', 0):
209 raise aetools.Error, aetools.decodeerror(_arguments)
210 # XXXX Optionally decode result
211 if _arguments.has_key('----'):
212 return _arguments['----']
214 _argmap_register_protocol = {
215 'for_protocol' : 'PROT',
218 def register_protocol(self, _object=None, _attributes={}, **_arguments):
219 """register protocol: Registers application as a \xd2handler\xd3 for this protocol with a given prefix. The handler will receive \xd2OpenURL\xd3, or if that fails, \xd2GetURL\xd3 event.
220 Required argument: Application sig
221 Keyword argument for_protocol: protocol prefix: \xd2finger:\xd3, \xd2file\xd3,
222 Keyword argument _attributes: AppleEvent attribute dictionary
223 Returns: TRUE if registration has been successful
228 aetools.keysubst(_arguments, self._argmap_register_protocol)
229 _arguments['----'] = _object
232 _reply, _arguments, _attributes = self.send(_code, _subcode,
233 _arguments, _attributes)
234 if _arguments.get('errn', 0):
235 raise aetools.Error, aetools.decodeerror(_arguments)
236 # XXXX Optionally decode result
237 if _arguments.has_key('----'):
238 return _arguments['----']
240 _argmap_register_viewer = {
241 'MIME_type' : 'MIME',
242 'with_file_type' : 'FTYP',
245 def register_viewer(self, _object, _attributes={}, **_arguments):
246 """register viewer: Registers an application as a \xd4special\xd5 viewer for this MIME type. The application will be launched with ViewDoc events
247 Required argument: Application sig
248 Keyword argument MIME_type: MIME type viewer is registering for
249 Keyword argument with_file_type: Mac file type for the downloaded files
250 Keyword argument _attributes: AppleEvent attribute dictionary
251 Returns: TRUE if registration has been successful
256 aetools.keysubst(_arguments, self._argmap_register_viewer)
257 _arguments['----'] = _object
260 _reply, _arguments, _attributes = self.send(_code, _subcode,
261 _arguments, _attributes)
262 if _arguments.get('errn', 0):
263 raise aetools.Error, aetools.decodeerror(_arguments)
264 # XXXX Optionally decode result
265 if _arguments.has_key('----'):
266 return _arguments['----']
268 _argmap_register_window_close = {
269 'for_window' : 'WIND',
272 def register_window_close(self, _object=None, _attributes={}, **_arguments):
273 """register window close: Netscape will notify registered application when this window closes
274 Required argument: Application signature
275 Keyword argument for_window: window ID
276 Keyword argument _attributes: AppleEvent attribute dictionary
277 Returns: true if successful
282 aetools.keysubst(_arguments, self._argmap_register_window_close)
283 _arguments['----'] = _object
286 _reply, _arguments, _attributes = self.send(_code, _subcode,
287 _arguments, _attributes)
288 if _arguments.get('errn', 0):
289 raise aetools.Error, aetools.decodeerror(_arguments)
290 # XXXX Optionally decode result
291 if _arguments.has_key('----'):
292 return _arguments['----']
294 def unregister_URL_echo(self, _object, _attributes={}, **_arguments):
295 """unregister URL echo: cancels URL echo
296 Required argument: application signature
297 Keyword argument _attributes: AppleEvent attribute dictionary
302 if _arguments: raise TypeError, 'No optional args expected'
303 _arguments['----'] = _object
306 _reply, _arguments, _attributes = self.send(_code, _subcode,
307 _arguments, _attributes)
308 if _arguments.get('errn', 0):
309 raise aetools.Error, aetools.decodeerror(_arguments)
310 # XXXX Optionally decode result
311 if _arguments.has_key('----'):
312 return _arguments['----']
314 _argmap_unregister_protocol = {
315 'for_protocol' : 'PROT',
318 def unregister_protocol(self, _object=None, _attributes={}, **_arguments):
319 """unregister protocol: reverses the effects of \xd2register protocol\xd3
320 Required argument: Application sig.
321 Keyword argument for_protocol: protocol prefix. If none, unregister for all protocols
322 Keyword argument _attributes: AppleEvent attribute dictionary
323 Returns: TRUE if successful
328 aetools.keysubst(_arguments, self._argmap_unregister_protocol)
329 _arguments['----'] = _object
332 _reply, _arguments, _attributes = self.send(_code, _subcode,
333 _arguments, _attributes)
334 if _arguments.get('errn', 0):
335 raise aetools.Error, aetools.decodeerror(_arguments)
336 # XXXX Optionally decode result
337 if _arguments.has_key('----'):
338 return _arguments['----']
340 _argmap_unregister_viewer = {
341 'MIME_type' : 'MIME',
344 def unregister_viewer(self, _object, _attributes={}, **_arguments):
345 """unregister viewer: Revert to the old way of handling this MIME type
346 Required argument: Application sig
347 Keyword argument MIME_type: MIME type to be unregistered
348 Keyword argument _attributes: AppleEvent attribute dictionary
349 Returns: TRUE if the event was successful
354 aetools.keysubst(_arguments, self._argmap_unregister_viewer)
355 _arguments['----'] = _object
358 _reply, _arguments, _attributes = self.send(_code, _subcode,
359 _arguments, _attributes)
360 if _arguments.get('errn', 0):
361 raise aetools.Error, aetools.decodeerror(_arguments)
362 # XXXX Optionally decode result
363 if _arguments.has_key('----'):
364 return _arguments['----']
366 _argmap_unregister_window_close = {
367 'for_window' : 'WIND',
370 def unregister_window_close(self, _object=None, _attributes={}, **_arguments):
371 """unregister window close: Undo for register window close
372 Required argument: Application signature
373 Keyword argument for_window: window ID
374 Keyword argument _attributes: AppleEvent attribute dictionary
375 Returns: true if successful
380 aetools.keysubst(_arguments, self._argmap_unregister_window_close)
381 _arguments['----'] = _object
384 _reply, _arguments, _attributes = self.send(_code, _subcode,
385 _arguments, _attributes)
386 if _arguments.get('errn', 0):
387 raise aetools.Error, aetools.decodeerror(_arguments)
388 # XXXX Optionally decode result
389 if _arguments.has_key('----'):
390 return _arguments['----']
392 def webActivate(self, _object=None, _attributes={}, **_arguments):
393 """webActivate: Makes Netscape the frontmost application, and selects a given window. This event is here for suite completeness/ cross-platform compatibility only, you should use standard AppleEvents instead.
394 Required argument: window to bring to front
395 Keyword argument _attributes: AppleEvent attribute dictionary
400 if _arguments: raise TypeError, 'No optional args expected'
401 _arguments['----'] = _object
404 _reply, _arguments, _attributes = self.send(_code, _subcode,
405 _arguments, _attributes)
406 if _arguments.get('errn', 0):
407 raise aetools.Error, aetools.decodeerror(_arguments)
408 # XXXX Optionally decode result
409 if _arguments.has_key('----'):
410 return _arguments['----']
414 # Indices of types declared in this module
416 _classdeclarations = {
419 _propdeclarations = {
422 _compdeclarations = {
425 _enumdeclarations = {