IWebResource.idl 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. * 1. Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * 2. Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. *
  13. * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
  14. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  15. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  16. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
  17. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  18. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  20. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  21. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  23. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. #ifndef DO_NO_IMPORTS
  26. import "oaidl.idl";
  27. import "ocidl.idl";
  28. #endif
  29. /*!
  30. @class WebResource
  31. @discussion A WebResource represents a fully downloaded URL.
  32. It includes the data of the resource as well as the metadata associated with the resource.
  33. @interface WebResource : NSObject <NSCoding, NSCopying>
  34. */
  35. [
  36. object,
  37. oleautomation,
  38. uuid(09567E0E-7859-494a-B0E4-92C13CFE5574),
  39. pointer_default(unique)
  40. ]
  41. interface IWebResource : IUnknown
  42. {
  43. /*!
  44. @method initWithData:URL:MIMEType:textEncodingName:frameName
  45. @abstract The initializer for WebResource.
  46. @param data The data of the resource.
  47. @param URL The URL of the resource.
  48. @param MIMEType The MIME type of the resource.
  49. @param textEncodingName The text encoding name of the resource (can be nil).
  50. @param frameName The frame name of the resource if the resource represents the contents of an entire HTML frame (can be nil).
  51. @result An initialized WebResource.
  52. - (id)initWithData:(NSData *)data URL:(NSURL *)URL MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)textEncodingName frameName:(NSString *)frameName;
  53. */
  54. HRESULT initWithData([in] IStream* data, [in] BSTR url, [in] BSTR mimeType, [in] BSTR textEncodingName, [in] BSTR frameName);
  55. /*!
  56. @method data
  57. @result The data of the resource.
  58. - (NSData *)data;
  59. */
  60. HRESULT data([out, retval] IStream** data);
  61. /*!
  62. @method URL
  63. @result The URL of the resource.
  64. - (NSURL *)URL;
  65. */
  66. HRESULT URL([out, retval] BSTR* url);
  67. /*!
  68. @method MIMEType
  69. @result The MIME type of the resource.
  70. - (NSString *)MIMEType;
  71. */
  72. HRESULT MIMEType([out, retval] BSTR* mime);
  73. /*!
  74. @method textEncodingName
  75. @result The text encoding name of the resource (can be nil).
  76. - (NSString *)textEncodingName;
  77. */
  78. HRESULT textEncodingName([out, retval] BSTR* encodingName);
  79. /*!
  80. @method frameName
  81. @result The frame name of the resource if the resource represents the contents of an entire HTML frame (can be nil).
  82. - (NSString *)frameName;
  83. */
  84. HRESULT frameName([out, retval] BSTR* name);
  85. }