forked from agunchan/autoproxy
-
Notifications
You must be signed in to change notification settings - Fork 15
/
IAutoProxy.idl
163 lines (142 loc) · 4.96 KB
/
IAutoProxy.idl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Adblock Plus.
*
* The Initial Developer of the Original Code is
* Wladimir Palant.
* Portions created by the Initial Developer are Copyright (C) 2006-2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
[scriptable, uuid(62B7B3B8-028D-11DE-BC3C-3E8D56D89593)]
interface IAutoProxySubscription: nsISupports
{
/**
* Subscription identifier, this is its URL unless the attribute external is set
*/
readonly attribute AString url;
/**
* true for special "subscriptions" representing segments of the user patterns
* list (e.g. ~wl~ contains whitelisting patterns)
*/
readonly attribute boolean special;
/**
* Subscription's title
*/
readonly attribute AUTF8String title;
/**
* Defines whether the subscription is downloaded automatically
*/
readonly attribute boolean autoDownload;
/**
* Defines whether the subscription's patterns are disabled
*/
readonly attribute boolean disabled;
/**
* Defines whether the subscription is managed externally rather than
* downloaded by the built-in synchronizer
*/
readonly attribute boolean external;
/**
* Time of the last download attempt in seconds since 1 January 1970 00:00:00
*/
readonly attribute unsigned long lastDownload;
/**
* Code for the result of the last download attempt (one of "synchronize_ok",
* "synchronize_invalid_url", "synchronize_connection_error", "synchronize_invalid_data")
*/
readonly attribute AString downloadStatus;
/**
* Value of the Last-Modified header for the last download
*/
readonly attribute AString lastModified;
/**
* Expiration time of the subscription (value of the Expires header but no more than two weeks
* after the download) for the last download in seconds since 1 January 1970 00:00:00
*/
readonly attribute unsigned long expires;
/**
* Retrieves a list of subscription's patterns
*/
void getPatterns(out unsigned long length,
[retval, array, size_is(length)] out wstring patterns);
};
[scriptable, uuid(70EAF9EA-028D-11DE-B53C-A18D56D89593)]
interface IAutoProxy : nsISupports
{
/**
* Number of subscriptions in the list
*/
readonly attribute PRInt32 subscriptionCount;
/**
* Retrieves a subscription by its identifier.
*
* @param id subscription identifier
*/
IAutoProxySubscription getSubscription(in AString id);
/**
* Retrieves a subscription by its position in the list.
*
* @param index index of the subscription in the list
*/
IAutoProxySubscription getSubscriptionAt(in PRInt32 index);
/**
* Adds an external subscription or updates subscription's patterns if it
* already exists. It will fail to update the subscription if it exists
* but doesn't have the external attribute set.
*
* @param id subscription identifier
* @param title subscription title
* @param patterns array containing subscription's patterns
* @param length length of patterns array
* @return true if the subscription was updated or false if the
* update failed
*/
boolean updateExternalSubscription(in AString id, in AUTF8String title,
[array, size_is(length), const] in wstring patterns,
in unsigned long length);
/**
* Removes an external subscription.
*
* @param id subscription identifier
* @return true if the subscription was removed or false if no
* external subscription with the given identifier was found
*/
boolean removeExternalSubscription(in AString id);
/**
* Adds user-defined patterns to the filter list.
*
* @param patterns array of patterns to be added
* @param length length of the patterns array
*/
void addPatterns([array, size_is(length)] in wstring patterns, in unsigned long length);
/**
* Removes user-defined patterns from the filter list.
*
* @param patterns array of patterns to be removed
* @param length length of the patterns array
*/
void removePatterns([array, size_is(length)] in wstring patterns, in unsigned long length);
/**
* Returns the installed version of AutoProxy.
*/
AString getInstalledVersion();
/**
* Returns source code revision this Adblock Plus build was created from (if available)
*/
AString getInstalledBuild();
};