/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * The contents of this file are subject to the Netscape Public License
 * Version 1.0 (the "NPL"); you may not use this file except in
 * compliance with the NPL.  You may obtain a copy of the NPL at
 * http://www.mozilla.org/NPL/
 *
 * Software distributed under the NPL is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
 * for the specific language governing rights and limitations under the
 * NPL.
 *
 * The Initial Developer of this code under the NPL is Netscape
 * Communications Corporation.  Portions created by Netscape are
 * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
 * Reserved.
 */

/* this interface is basically for the old ListNewsGroupState class
 * (the implementation of this class probably wants to also implement
 * or contain ChangeListener so that it can react to OnAnnouncerGoingAway()
 * to destroy the DBView)
 */
#include "nsISupports.idl"
#include "nsINNTPHost.idl"
#include "nsINNTPNewsgroup.idl"

interface nsINNTPHost;
interface nsINNTPNewsgroup;

[scriptable, uuid(E628ED19-9452-11d2-B7EA-00805F05FFA5)]
interface nsINNTPNewsgroupList : nsISupports {

  /* These calls are used by libnet to determine which articles it ought to
     get in a big newsgroup. */


  long GetRangeOfArtsToDownload(in long first_message,
                                in long last_message,
                                in long maxextra,
                                out long real_first_message,
                                out long real_last_message);
  
  void AddToKnownArticles(in long first_message, in long last_message);


  /* The NNTP module of netlib calls these to feed XOVER data to the message
     library, in response to a news:group.name URL having been opened.
     If MSG_FinishXOVER() returns a message ID, that message will be loaded
     next (used for selecting the first unread message in a group after
     listing that group.)

     depricated:
     The "out" arguments are (if non-NULL) a file descriptor to write the XOVER
     line to, followed by a "\n".  This is used by the XOVER-caching code.
  */
  /* the XOVER Sink should maintain the ListNewsGroupState */
  void InitXOVER(in long first_message, in long last_message);  
  void ProcessXOVERLINE(in string line, out unsigned long status);
  void ProcessNonXOVER(in string line);
  void ResetXOVER();
  void FinishXOVERLINE(in long status, out long newstatus);
  void ClearXOVERState();
  string GetGroupName();

  void Initialize(in nsINNTPHost host, in nsINNTPNewsgroup newsgroup, in string name, in string url);
};

