Skip to content

Commit

Permalink
the original adblock plus 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lovelywcm committed Feb 19, 2009
0 parents commit d137f94
Show file tree
Hide file tree
Showing 657 changed files with 61,885 additions and 0 deletions.
158 changes: 158 additions & 0 deletions IAdblockPlus.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
/* ***** 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(2a311a4f-f32b-472a-9fc9-f1b1529924ad)]
interface IAdblockPlusSubscription: 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(6e70a4b4-bef8-b0b3-25a2-62146012352b)]
interface IAdblockPlus : nsISupports
{
/**
* Number of subscriptions in the list
*/
readonly attribute PRInt32 subscriptionCount;

/**
* Retrieves a subscription by its identifier.
*
* @param id subscription identifier
*/
IAdblockPlusSubscription getSubscription(in AString id);

/**
* Retrieves a subscription by its position in the list.
*
* @param index index of the subscription in the list
*/
IAdblockPlusSubscription 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 Adblock Plus.
*/
AString getInstalledVersion();
};
Loading

0 comments on commit d137f94

Please sign in to comment.