// myspage.idl : IDL source for myspage.dll
//

// This file will be processed by the MIDL tool to
// produce the type library (myspage.tlb) and marshalling code.

import "oaidl.idl";
import "ocidl.idl";
#include "olectl.h"


typedef enum _event_type_ {
  click,
  dblclick,
  error,
  keydown,
  keypress,
  keyup,
  mousedown,
  mousemove,
  mouseout,
  mouseover,
  mouseup
} EVENT_TYPE;

typedef enum _mouse_button_ {
  none=0,left=1,middle=2,right=4 /* same as MS encoding */
} MOUSE_BUTTON;

	[
		object,
		uuid(0E7D148C-8948-11D2-B54E-0060089002FE),
		dual,
		helpstring("IDHTMLPage Interface"),
		pointer_default(unique)
	]
	interface IDHTMLPage : IDispatch
	{
		[id(1), helpstring("method marshalWebBrowserToStream")] HRESULT marshalWebBrowserToStream(IStream **);
		[id(2), helpstring("method marshalEventQueueToStream")] HRESULT marshalEventQueueToStream(IStream **);
	};
	[
		object,
		uuid(0E7D148E-8948-11D2-B54E-0060089002FE),
		dual,
		helpstring("IDHTMLPageUI Interface"),
		pointer_default(unique)
	]
	interface IDHTMLPageUI : IDispatch
	{
		HRESULT AtAnyEvent();
	};
	[
		object,
		uuid(FED3418C-9505-11D2-B55E-0060089002FE),
		dual,
		helpstring("IEvent Interface"),
		pointer_default(unique)
	]
	interface IEvent : IDispatch
	{
		[propget, id(1), helpstring("property eventType")] HRESULT eventType([out, retval] EVENT_TYPE *pVal);
		[propput, id(1), helpstring("property eventType")] HRESULT eventType([in] EVENT_TYPE newVal);
		[propget, id(2), helpstring("property sourceElement")] HRESULT srcTag([out, retval] BSTR *);
		[propput, id(2), helpstring("property sourceElement")] HRESULT srcTag([in] BSTR);
		[propget, id(3), helpstring("property srcId")] HRESULT srcId([out, retval] BSTR *pVal);
		[propput, id(3), helpstring("property srcId")] HRESULT srcId([in] BSTR newVal);
		[propget, id(4), helpstring("property fromTag")] HRESULT fromTag([out, retval] BSTR *pVal);
		[propput, id(4), helpstring("property fromTag")] HRESULT fromTag([in] BSTR newVal);
		[propget, id(5), helpstring("property fromId")] HRESULT fromId([out, retval] BSTR *pVal);
		[propput, id(5), helpstring("property fromId")] HRESULT fromId([in] BSTR newVal);
		[propget, id(6), helpstring("property toTag")] HRESULT toTag([out, retval] BSTR *pVal);
		[propput, id(6), helpstring("property toTag")] HRESULT toTag([in] BSTR newVal);
		[propget, id(7), helpstring("property toId")] HRESULT toId([out, retval] BSTR *pVal);
		[propput, id(7), helpstring("property toId")] HRESULT toId([in] BSTR newVal);
		[propget, id(8), helpstring("property keyCode")] HRESULT keyCode([out, retval] long *pVal);
		[propput, id(8), helpstring("property keyCode")] HRESULT keyCode([in] long newVal);
		[propget, id(9), helpstring("property altPressed")] HRESULT altPressed([out, retval] VARIANT_BOOL *pVal);
		[propput, id(9), helpstring("property altPressed")] HRESULT altPressed([in] VARIANT_BOOL newVal);
		[propget, id(10), helpstring("property ctrlPressed")] HRESULT ctrlPressed([out, retval] VARIANT_BOOL *pVal);
		[propput, id(10), helpstring("property ctrlPressed")] HRESULT ctrlPressed([in] VARIANT_BOOL newVal);
		[propget, id(11), helpstring("property shiftPressed")] HRESULT shiftPressed([out, retval] VARIANT_BOOL *pVal);
		[propput, id(11), helpstring("property shiftPressed")] HRESULT shiftPressed([in] VARIANT_BOOL newVal);
		[propget, id(12), helpstring("property mouseButton")] HRESULT mouseButton([out, retval] MOUSE_BUTTON *pVal);
		[propput, id(12), helpstring("property mouseButton")] HRESULT mouseButton([in] MOUSE_BUTTON newVal);
		[propget, id(13), helpstring("property x")] HRESULT x([out, retval] long *pVal);
		[propput, id(13), helpstring("property x")] HRESULT x([in] long newVal);
		[propget, id(14), helpstring("property y")] HRESULT y([out, retval] long *pVal);
		[propput, id(14), helpstring("property y")] HRESULT y([in] long newVal);
	};
	[
		object,
		uuid(FED3418D-9505-11D2-B55E-0060089002FE),
		dual,
		helpstring("IEventQueue Interface"),
		pointer_default(unique)
	]
	interface IEventQueue : IDispatch
	{
		[id(1), helpstring("method GetEvent")] HRESULT GetEvent(IEvent **);
		[id(2), helpstring("method QueueEvent")] HRESULT QueueEvent(IEvent *);
		[id(3), helpstring("method GetReaderSemaphore")] HRESULT GetReaderSemaphore(int *);
                [id(4), helpstring("method set_extension_table"
)] HRESULT set_extension_table(int);
		[propget, id(5), helpstring("property EventAvailable")] HRESULT EventAvailable([out, retval] VARIANT_BOOL *pVal);
	};
    [
	uuid(0E7D1480-8948-11D2-B54E-0060089002FE),
	version(1.0),
        helpstring("myspage 1.0 Type Library")
    ]
library MYSPAGELib
{
	importlib("stdole32.tlb");
	importlib("stdole2.tlb");

	[
		uuid(0E7D148D-8948-11D2-B54E-0060089002FE),
		helpstring("DHTMLPage Class")
	]
	coclass DHTMLPage
	{
		[default] interface IDHTMLPage;
		interface IDHTMLPageUI;
	};
	[
		uuid(44D46F53-9375-11D2-B559-0060089002FE),
		helpstring("Event Class")
	]
	coclass Event
	{
		[default] interface IEvent;
	};
	[
		uuid(44D46F51-9375-11D2-B559-0060089002FE),
		helpstring("EventQueue Class")
	]
	coclass EventQueue
	{
		[default] interface IEventQueue;
	};
};
