IWebArchive.idl 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. import "DOMCore.idl";
  29. import "IWebResource.idl";
  30. #endif
  31. interface IWebResource;
  32. /*!
  33. @class WebArchive
  34. @discussion WebArchive represents a main resource as well as all the subresources and subframes associated with the main resource.
  35. The main resource can be an entire web page, a portion of a web page, or some other kind of data such as an image.
  36. This class can be used for saving standalone web pages, representing portions of a web page on the pasteboard, or any other
  37. application where one class is needed to represent rich web content.
  38. */
  39. [
  40. object,
  41. oleautomation,
  42. uuid(F07D5252-F66E-4a4d-B9DC-33BD11DCC138),
  43. pointer_default(unique)
  44. ]
  45. interface IWebArchive : IUnknown
  46. {
  47. /*!
  48. @method initWithMainResource:subresources:subframeArchives:
  49. @abstract The initializer for WebArchive.
  50. @param mainResource The main resource of the archive.
  51. @param subresources The subresources of the archive (can be nil).
  52. @param subframeArchives The archives representing the subframes of the archive (can be nil).
  53. @result An initialized WebArchive.
  54. - (id)initWithMainResource:(WebResource *)mainResource subresources:(NSArray *)subresources subframeArchives:(NSArray *)subframeArchives;
  55. */
  56. HRESULT initWithMainResource([in] IWebResource* mainResource, [in, size_is(cSubResources)] IWebResource** subResources, [in] int cSubResources, [in, size_is(cSubFrameArchives)] IWebArchive** subFrameArchives, [in] int cSubFrameArchives);
  57. /*!
  58. @method initWithData:
  59. @abstract The initializer for creating a WebArchive from data.
  60. @param data The data representing the archive. This can be obtained using WebArchive's data method.
  61. @result An initialized WebArchive.
  62. - (id)initWithData:(NSData *)data;
  63. */
  64. HRESULT initWithData([in] IStream* data);
  65. /*!
  66. @method initWithData:
  67. @abstract The initializer for creating a WebArchive from data.
  68. @param data The data representing the archive. This can be obtained using WebArchive's data method.
  69. @result An initialized WebArchive.
  70. - (id)initWithData:(NSData *)data;
  71. */
  72. HRESULT initWithNode([in] IDOMNode* node);
  73. /*!
  74. @method mainResource
  75. @result The main resource of the archive.
  76. - (WebResource *)mainResource;
  77. */
  78. HRESULT mainResource([out, retval] IWebResource** resource);
  79. /*!
  80. @method subresources
  81. @result The subresource of the archive (can be nil).
  82. - (NSArray *)subresources;
  83. */
  84. HRESULT subResources([out, retval] IEnumVARIANT** enumResources);
  85. /*!
  86. @method subframeArchives
  87. @result The archives representing the subframes of the archive (can be nil).
  88. - (NSArray *)subframeArchives;
  89. */
  90. HRESULT subframeArchives([out, retval] IEnumVARIANT** enumSubframes);
  91. /*!
  92. @method data
  93. @result The data representation of the archive.
  94. @discussion The data returned by this method can be used to save a web archive to a file or to place a web archive on the pasteboard
  95. using WebArchivePboardType. To create a WebArchive using the returned data, call initWithData:.
  96. - (NSData *)data;
  97. */
  98. HRESULT data([out, retval] IStream** stream);
  99. }