2009-03-25 Darin Adler <darin@apple.com>
[WebKit-https.git] / WebCore / loader / archive / cf / LegacyWebArchive.h
index c155198..8c8f2e4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #ifndef LegacyWebArchive_h
 #define LegacyWebArchive_h
 
-// FIXME:  Code will go here!
+#include "Archive.h"
+
+namespace WebCore {
+
+class Frame;
+class Node;
+class Range;
+
+class LegacyWebArchive : public Archive {
+public:
+    static PassRefPtr<LegacyWebArchive> create();
+    static PassRefPtr<LegacyWebArchive> create(SharedBuffer*);
+    static PassRefPtr<LegacyWebArchive> create(PassRefPtr<ArchiveResource> mainResource, Vector<PassRefPtr<ArchiveResource> >& subresources, Vector<PassRefPtr<LegacyWebArchive> >& subframeArchives);
+    static PassRefPtr<LegacyWebArchive> create(Node*);
+    static PassRefPtr<LegacyWebArchive> create(Frame*);
+    static PassRefPtr<LegacyWebArchive> createFromSelection(Frame*);
+    static PassRefPtr<LegacyWebArchive> create(Range*);
+
+    RetainPtr<CFDataRef> rawDataRepresentation();
+
+private:
+    LegacyWebArchive() { }
+
+    enum MainResourceStatus { Subresource, MainResource };
+
+    static PassRefPtr<LegacyWebArchive> create(const String& markupString, Frame*, const Vector<Node*>& nodes);
+    static PassRefPtr<ArchiveResource> createResource(CFDictionaryRef);
+    static ResourceResponse createResourceResponseFromMacArchivedData(CFDataRef);
+    static ResourceResponse createResourceResponseFromPropertyListData(CFDataRef, CFStringRef responseDataType);
+    static RetainPtr<CFDataRef> createPropertyListRepresentation(const ResourceResponse&);
+    static RetainPtr<CFDictionaryRef> createPropertyListRepresentation(Archive*);
+    static RetainPtr<CFDictionaryRef> createPropertyListRepresentation(ArchiveResource*, MainResourceStatus);
+
+    bool extract(CFDictionaryRef);
+};
+
+}
 
 #endif // Archive