/* * xvITorrentEngine.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 * * Interface definition for torrent engines. */ #include "nsISupports.idl" #include "nsIInputStream.idl" #include "xvITorrent.idl" /** * An engine that can handle torrents. * @status FLUID */ [scriptable, uuid(04c58fdf-3738-402c-b63b-264a59517490)] interface xvITorrentEngine : nsISupports { /** * The port the peer listens to. If the peer 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); /** * Starts listening on the current BitTorrent port, allowing torrents * to be downloaded. */ void start( ); /** * Stops all torrents, disables the listener; gracefully shutting down * the system. */ void stop( ); /** * Removes a given torrent to the torrents being handled. This should * also stop the torrent. */ void removeTorrent(in xvITorrent torrent); };