/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 *
 * The contents of this file are subject to the Mozilla Public
 * License Version 1.1 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of
 * the License at http://www.mozilla.org/MPL/
 * 
 * Software distributed under the License is distributed on an "AS
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * rights and limitations under the License.
 * 
 * The Original Code is the Mozilla browser.
 * 
 * The Initial Developer of the Original Code is Netscape
 * Communications, Inc.  Portions created by Netscape are
 * Copyright (C) 1999, Mozilla.  All Rights Reserved.
 * 
 * Contributor(s):
 *   Travis Bogard <travis@netscape.com>
 */

#include "nsISupports.idl"

/**
 * The nsIEventFilter serves as a base interface for the platform specific 
 * interfaces that define what a filter message looks like.    
 */

typedef long nsNativeFilterDataType;

[scriptable, uuid(2EFB5012-4508-11d3-AEDA-00A024FFC08C)]
interface nsNativeFilterDataTypes
{
	const long WinFilter = 1;    // nsCWinFilter structure
	const long PhotonFilter = 2; // nsCWinFilter structure
};



[scriptable, uuid(2EFB5003-4508-11d3-AEDA-00A024FFC08C)]
interface nsIEventFilter : nsISupports
{
	/*
	Retrieves the internal structure requested via the dataType parameter.
	 
	@param dataType The type of data being requested.  This should be one of 
		the consts found in nsNativeFilterDataTypes.

	@param data	Returns a pointer to the requested data.  For optimization sake,
		this is a pointer to internal memory, so the validity of the returned
		pointer is only valuable as long as the object pointed to with the 
		nsIEvent pointer is referenced.  If you need it beyond the life of this
		object, then copy the structure data.

	@return	NS_OK The returned data value has been filled with the appropriate
					pointer.
				NS_INVALID_ARG The requested dataType is not available.
				NS_INVALID_POINTER The parameter data was not a valid pointer to 
					return the pointer in.
	*/
	[noscript] void GetNativeData(in nsNativeFilterDataType dataType, 
		out voidPtr data);

	/*
	Sets the internal structure to hold the appropriate data.

	@param dataType The type of data being passed in.

	@param data A pointer to the data to set.  Unlike the get method this
		pointer does not need to live for the life of the object.  The object
		will copy the contents of referred to by the pointer.  nsnull can be
		passed to this function.  Passing null will 0 out the contents of
		the internal structure or pointer referrned to by dataType.

	@return	NS_OK - All went well with setting the data.
				NS_INVALID_ARG The data type sent is not supported by this event.
	*/
	[noscript] void SetNativeData(in nsNativeFilterDataType dataType,
		in voidPtr data);

};

