/* -*- Mode: C++; 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) 1999 Netscape Communications Corporation.  All Rights
 * Reserved.
 */
 
#include "nsISupports.idl"
#include "nsIEnumerator.idl"
#include "nsIRDFDataSource.idl"
#include "domstubs.idl"

[ptr] native nsIWebShellWindow(nsIWebShellWindow);
%{C++
#include "nsIWebShellWindow.h"
%}

%{C++
#define NS_WINDOWMEDIATOR_CID \
{ 0x0659cb83, 0xfaad, 0x11d2, { 0x8e, 0x19, 0xb2, 0x06, 0x62, 0x0a, 0x65, 0x7c } }
%}


[scriptable, uuid(0659cb81-faad-11d2-8e19-b206620a657c)]
interface nsIWindowMediator: nsIRDFDataSource
{

	/*
		iterates over the windows of type inType in the order that they were created. if inType  is null
		iterates over all windows
	*/
	
	nsISimpleEnumerator GetEnumerator( in wstring inType );
	/*
		Returns the window of type inType ( if null return any window type ) which has the most recent
		time stamp
	*/
	nsIDOMWindow GetMostRecentWindow( in wstring inType );
	
	/*
		Get window given an RDF resource.
	*/
	nsIDOMWindow GetWindowForResource( in wstring inResource );
	
	/* */
	nsIDOMWindow ConvertISupportsToDOMWindow( in nsISupports inWindow );
	
	/* Add the webshellwindow to the list */
	[noscript] void RegisterWindow( in nsIWebShellWindow inWindow);
	
	/* remove the window from the list */
	[noscript] void UnregisterWindow( in nsIWebShellWindow inWindow );
	
	/* Call when the window gains focus. Used to determine the most recent window */
	[noscript] void  UpdateWindowTimeStamp( in nsIWebShellWindow inWindow );
	
	/* */
	[noscript] void UpdateWindowTitle(in nsIWebShellWindow inWindow, in wstring inTitle );

};

%{C++
extern nsresult NS_NewWindowMediatorFactory(nsIFactory** aResult);
%}
