/* * xvITorrentManager.idl * * Copyright (c) 2005, 2006 by Daniel Potter. All rights reserved. * * This file is part of FireTorrent. * * FireTorrent is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published * by the Free Software Foundation. * * FireTorrent is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with FireTorrent; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Defines the xvITorrentManager interface. */ #include "nsISupports.idl" #include "nsIInputStream.idl" #include "xvITorrent.idl" /** * Listener for the FireTorrent manager. */ [scriptable, uuid(13f217fd-4fef-4eb3-8675-1e8ab59e1024)] interface xvITorrentManagerListener : nsISupports { /** * Indicates that a torrent was added to the list of torrents. */ void torrentAdded(in xvITorrent torrent); /** * Indicates that a torrent was removed from the list of torrents. */ void torrentRemoved(in xvITorrent torrent); }; /** * A Torrent manager. Among other things, this handles accepting * connections for current torrents and passing them off to the appropriate * torrent. * @status FLUID */ [scriptable, uuid(612d155f-3f1d-4256-99de-9ce47aa6c26e)] interface xvITorrentManager : nsISupports { /** * The port the client listens to. If the client is already listening, * then setting this does nothing. */ attribute PRUint32 port; /** * True if the system is currently listening, and the port cannot * currently be changed. */ readonly attribute boolean active; /** * The number of torrents currently being managed. */ readonly attribute PRUint32 torrentCount; /** * Gets a torrent by the index, from [0..torrentCount-1] */ xvITorrent getTorrentAt(in PRUint32 index); /** * Creates a new torrent from the given nsIInputStream. */ xvITorrent createTorrent(in nsIInputStream inputStream); /** * Initializes the system, starting all suspended torrents (if any). * The engine is discovered at this time, so calling stop() and then * start() will allow an engine to be swapped at runtime. */ void start( ); /** * Stops the system, deactivating the listener. */ void stop( ); /** * Removes a given torrent to the torrents being handled. */ void removeTorrent(in xvITorrent torrent); /** * Adds a listener to the list of listeners interested in receiving * events. */ void addTorrentManagerListener(in xvITorrentManagerListener listener); /** * Removes a listener from the list of listeners interested in * receiving events. */ void removeTorrentManagerListener(in xvITorrentManagerListener listener); };