/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsISupports.idl" interface nsIFile; interface nsIMsgNewsFolder; interface nsIURI; interface nsIMsgWindow; [scriptable, uuid(077620ed-c6c4-4d4d-bed5-4d041f924002)] interface nsINntpIncomingServer : nsISupports { /* the on-disk path to the newsrc file for this server */ attribute nsIFile newsrcFilePath; /* the newsrc root path (the directories all the newsrc files live) */ attribute nsIFile newsrcRootPath; /* ask the user before downloading more than maxArticles? */ attribute boolean notifyOn; /* the max articles to download */ attribute long maxArticles; /* when we don't download all, do we mark the rest read? */ attribute boolean markOldRead; /* abbreviate the newsgroup names in the folder pane? */ attribute boolean abbreviate; /* do we use a single login per server or do we login per group */ attribute boolean singleSignon; /** the server charset and it may be needed to display newsgroup folder * names correctly **/ attribute ACString charset; /* the server keeps track of all the newsgroups we are subscribed to */ void addNewsgroup(in AUTF8String name); void removeNewsgroup(in AUTF8String name); void writeNewsrcFile(); attribute boolean newsrcHasChanged; /** * The maximum number of connections to make to the server. * * This preference (internally max_cached_connections) controls how many * connections we can make. A negative connection count is treated as only * one connection, while 0 (the default) loads the default number of * connections, presently 2. */ attribute long maximumConnectionsNumber; /** * The duration of inactivity (in seconds) until a connection to the server * is closed. * * This preference (internally connection_timeout) controls how long an * inactive connection to the server is held open. The default value of 170 * corresponds to RFC 3977. Use -1 to disable. * @see https://datatracker.ietf.org/doc/html/rfc3977#section-3.1 (last * paragraph) */ attribute long connectionTimeout; /** * Enqueues a URI to be run when we have a free connection. * * If there is one already free, it will be immediately started. * * @param uri The URI to run. * @param window The standard message window object. * @param consumer A listener for the response data. */ void loadNewsUrl(in nsIURI uri, in nsIMsgWindow window, in nsISupports consumer); /** * Returns whether or not the server has subscribed to the given newsgroup. * * Note that the name here is intended to be escaped; however, since `%' is * not a legal newsgroup name, it is possibly safe to pass in an unescaped * newsgroup name. */ boolean containsNewsgroup(in AUTF8String escapedName); void subscribeToNewsgroup(in AUTF8String name); /* used for the subscribe dialog. name is encoded in |charset| (attribute declared above) */ void addNewsgroupToList(in string name); attribute boolean pushAuth; /** * Returns the folder corresponding to the given group. * * Note that this name is expected to be unescaped. * @note If the group does not exist, a bogus news folder will be returned. * DO NOT call this method unless you are sure that the newsgroup * is subscribed to (e.g., by containsNewsgroup) */ nsIMsgNewsFolder findGroup(in AUTF8String name); };