1 // Copyright 2005, Google Inc.
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are met:
6 // 1. Redistributions of source code must retain the above copyright notice,
7 // this list of conditions and the following disclaimer.
8 // 2. Redistributions in binary form must reproduce the above copyright notice,
9 // this list of conditions and the following disclaimer in the documentation
10 // and/or other materials provided with the distribution.
11 // 3. Neither the name of Google Inc. nor the names of its contributors may be
12 // used to endorse or promote products derived from this software without
13 // specific prior written permission.
15 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
16 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
18 // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 //#include "nsISupports.idl"
27 #include "base_interface_ff.idl" // XPIDL doesn't like slashes in #includes
31 //------------------------------------------------------------------------------
32 // GearsManagedResourceStoreInterface
33 //------------------------------------------------------------------------------
34 [scriptable, uuid(813CBD00-743C-449e-99ED-2749D8B053D1)]
35 interface GearsManagedResourceStoreInterface : GearsBaseClassInterface {
36 // Identifying properties
37 readonly attribute AString name;
38 readonly attribute AString requiredCookie;
40 // Enable/disable local serving
41 attribute boolean enabled;
44 attribute AString manifestUrl;
45 readonly attribute long lastUpdateCheckTime;
46 readonly attribute long updateStatus;
47 readonly attribute AString lastErrorMessage;
49 // Callbacks for update events.
50 attribute nsIVariant onerror;
51 attribute nsIVariant onprogress;
52 attribute nsIVariant oncomplete;
54 void checkForUpdate();
56 // Version information
57 readonly attribute AString currentVersion;
60 //------------------------------------------------------------------------------
61 // GearsFileSubmitterInterface
62 // Facilitates the inclusion of resources into form submissions
63 // as the file parts of multipart/form-data encoded POSTs
64 //------------------------------------------------------------------------------
65 [scriptable, uuid(265DA719-EBBD-431b-8617-A2B5BF937E29)]
66 interface GearsFileSubmitterInterface : GearsBaseClassInterface {
68 * Prepares a <input type=file> form element to submit a file residing in
69 * the web capture store when the form is submitted.
71 void setFileInputElement(in nsISupports file_input_element,
72 in AString resource_url);
75 //------------------------------------------------------------------------------
76 // ResourceCaptureCompletionHandler
77 //------------------------------------------------------------------------------
78 [scriptable, function, uuid(4995172C-1842-4720-9465-98033A5A4E66)]
79 interface ResourceCaptureCompletionHandler : nsISupports {
80 void invoke(in AString url, in boolean success, in long captureId);
83 //------------------------------------------------------------------------------
84 // GearsResourceStoreInterface
85 //------------------------------------------------------------------------------
86 [scriptable, uuid(03BE747B-25B0-43ed-B78C-09093F50EEF8)]
87 interface GearsResourceStoreInterface : GearsBaseClassInterface {
88 // Identifying properties
89 readonly attribute AString name;
90 readonly attribute AString requiredCookie;
92 // Enable/disable local serving
93 attribute boolean enabled;
95 long capture(in nsIVariant urls,
96 in ResourceCaptureCompletionHandler completion_callback);
98 void abortCapture(in long capture_id);
100 boolean isCaptured(in AString url);
102 void remove(in AString url);
104 void rename(in AString src_url, in AString dst_url);
106 void copy(in AString src_url, in AString dst_url);
108 AString getHeader(in AString url, in AString header);
110 AString getAllHeaders(in AString url);
112 void captureFile(in nsISupports file_input_element, in AString url);
114 AString getCapturedFileName(in AString url);
116 GearsFileSubmitterInterface createFileSubmitter();
119 //------------------------------------------------------------------------------
120 // GearsLocalServerInterface
121 //------------------------------------------------------------------------------
122 [scriptable, uuid(37C3FB6E-40A0-40f1-8A98-5FFF1F3BAB3A)]
123 interface GearsLocalServerInterface : GearsBaseClassInterface {
124 boolean canServeLocally();
127 GearsManagedResourceStoreInterface createManagedStore();
129 // [optional] in AString requiredCookie
131 GearsManagedResourceStoreInterface openManagedStore();
133 // [optional] in AString requiredCookie
135 void removeManagedStore();
137 // [optional] in AString requiredCookie
139 GearsResourceStoreInterface createStore();
141 // [optional] in AString requiredCookie
143 GearsResourceStoreInterface openStore();
145 // [optional] in AString requiredCookie
149 // [optional] in AString requiredCookie
152 //------------------------------------------------------------------------------
153 // SpecialHttpRequestInterface
154 //------------------------------------------------------------------------------
155 interface FFHttpRequest; // defined in C++
156 [ptr] native FFHttpRequestPtr(FFHttpRequest);
158 [noscript, uuid(c1aa6650-21da-4b68-bde4-a2f8cf5cc091)]
159 interface SpecialHttpRequestInterface : nsISupports {
160 // This is an interface for use by CacheIntercept. We QueryInterface
161 // for it to see whether a given request came from Gears.
162 [noscript] FFHttpRequestPtr getNativeHttpRequest();