-- Automatically generated by HaskellDirect (ihc.exe), snapshot 061203 -- Created: 12:16 E. Europe Standard Time, Wednesday 24 December, 2003 -- Command line: oleipc.idl -fcom module Oleipc ( POINTS(..) , writePOINTS , readPOINTS , sizeofPOINTS , OLEROLE(..) , OLEMSGBUTTON(..) , OLEMSGDEFBUTTON(..) , OLEMSGICON(..) , IOleCommandTarget , IOleCommandTarget_(..) , deleted1 , deleted2 , onUIEvent , onUIEventProgress , setStatus , showContextMenu , showHelp , showMessage , IOleComponentUIManager , IOleComponentUIManager_ , iidIOleComponentUIManager ) where import Prelude (fromEnum, toEnum) import qualified Prelude import qualified Automation (Variant, marshallVariant, VARIANT) import qualified Com (IUnknown, IID, mkIID, invokeAndCheck, GUID, marshallCLSID, marshallGUID, invokeIt, CLSID, marshallIUnknown) import qualified Foreign.ForeignPtr (withForeignPtr) import qualified Foreign.Ptr (Ptr,nullPtr) import qualified HDirect (writeInt16, addNCastPtr, readInt16, allocBytes, marshallref, free, writeWord32, sizeofWord32, readWord32, doThenFree, nullFO, marshallMaybe, sizeofInt32, marshallEnum32, readInt32) import qualified Int (Int32) import qualified WideString (marshallWideString, freeWideString, WideString) import qualified Word (Word32) import qualified Wtypes (SHORT, DWORD, REFCLSID, RECT, writeRECT, sizeofRECT, DWORD_PTR, BOOL, LPOLESTR, ULONG, LPCOLESTR, LONG) data POINTS = POINTS {x :: Wtypes.SHORT, y :: Wtypes.SHORT} writePOINTS :: Foreign.Ptr.Ptr POINTS -> POINTS -> Prelude.IO () writePOINTS ptr (POINTS x y) = let pf0 = ptr pf1 = HDirect.addNCastPtr pf0 0 in do HDirect.writeInt16 pf1 x let pf2 = HDirect.addNCastPtr pf1 2 HDirect.writeInt16 pf2 y readPOINTS :: Foreign.Ptr.Ptr POINTS -> Prelude.IO POINTS readPOINTS ptr = let pf0 = ptr pf1 = HDirect.addNCastPtr pf0 0 in do x <- HDirect.readInt16 pf1 let pf2 = HDirect.addNCastPtr pf1 2 y <- HDirect.readInt16 pf2 Prelude.return (POINTS x y) sizeofPOINTS :: Word.Word32 sizeofPOINTS = 4 data OLEROLE = OLEROLE_UNKNOWN | OLEROLE_COMPONENTHOST | OLEROLE_HOSTEXTENSION | OLEROLE_TOPLEVELCOMPONENT | OLEROLE_MAINCOMPONENT | OLEROLE_SUBCOMPONENT | OLEROLE_COMPONENTCONTROL instance Prelude.Enum (OLEROLE) where fromEnum v = case v of OLEROLE_UNKNOWN -> (-1) OLEROLE_COMPONENTHOST -> 0 OLEROLE_HOSTEXTENSION -> 0 OLEROLE_TOPLEVELCOMPONENT -> 0 OLEROLE_MAINCOMPONENT -> 1 OLEROLE_SUBCOMPONENT -> 2 OLEROLE_COMPONENTCONTROL -> 3 toEnum v = case v of (-1) -> OLEROLE_UNKNOWN 0 -> OLEROLE_COMPONENTHOST 0 -> OLEROLE_HOSTEXTENSION 0 -> OLEROLE_TOPLEVELCOMPONENT 1 -> OLEROLE_MAINCOMPONENT 2 -> OLEROLE_SUBCOMPONENT 3 -> OLEROLE_COMPONENTCONTROL _ -> Prelude.error "unmarshallOLEROLE: illegal enum value " data OLEMSGBUTTON = OLEMSGBUTTON_OK | OLEMSGBUTTON_OKCANCEL | OLEMSGBUTTON_ABORTRETRYIGNORE | OLEMSGBUTTON_YESNOCANCEL | OLEMSGBUTTON_YESNO | OLEMSGBUTTON_RETRYCANCEL | OLEMSGBUTTON_YESALLNOCANCEL deriving (Prelude.Enum) data OLEMSGDEFBUTTON = OLEMSGDEFBUTTON_FIRST | OLEMSGDEFBUTTON_SECOND | OLEMSGDEFBUTTON_THIRD | OLEMSGDEFBUTTON_FOURTH deriving (Prelude.Enum) data OLEMSGICON = OLEMSGICON_NOICON | OLEMSGICON_CRITICAL | OLEMSGICON_QUERY | OLEMSGICON_WARNING | OLEMSGICON_INFO deriving (Prelude.Enum) -- -------------------------------------------------- -- -- interface IOleCommandTarget -- -- -------------------------------------------------- data IOleCommandTarget_ a = IOleCommandTarget__ type IOleCommandTarget a = Com.IUnknown (IOleCommandTarget_ a) -- -------------------------------------------------- -- -- interface IOleComponentUIManager -- -- -------------------------------------------------- data IOleComponentUIManager_ a = IOleComponentUIManager__ type IOleComponentUIManager a = Com.IUnknown (IOleComponentUIManager_ a) iidIOleComponentUIManager :: Com.IID (IOleComponentUIManager ()) iidIOleComponentUIManager = Com.mkIID "{5efc7972-14bc-11cf-9b2b-00aa00573819}" deleted1 :: IOleComponentUIManager a0 -> Prelude.IO () deleted1 iptr = Com.invokeAndCheck (\ methPtr iptr -> prim_Oleipc_deleted1 methPtr iptr) 3 iptr foreign import stdcall "dynamic" prim_Oleipc_deleted1 :: Foreign.Ptr.Ptr () -> Foreign.Ptr.Ptr () -> Prelude.IO Int.Int32 deleted2 :: IOleComponentUIManager a0 -> Prelude.IO () deleted2 iptr = Com.invokeAndCheck (\ methPtr iptr -> prim_Oleipc_deleted1 methPtr iptr) 4 iptr onUIEvent :: (Automation.Variant a1) => Wtypes.DWORD -> Wtypes.REFCLSID -> Com.GUID -> Wtypes.DWORD -> Wtypes.DWORD -> Wtypes.DWORD -> Wtypes.RECT -> a1 -> IOleComponentUIManager a0 -> Prelude.IO () onUIEvent dwCompRole rclsidComp pguidUIEventGroup nUIEventId dwUIEventStatus dwEventFreq prcEventRegion pvarEventArg iptr = do rclsidComp <- Com.marshallCLSID rclsidComp pguidUIEventGroup <- Com.marshallGUID pguidUIEventGroup prcEventRegion <- HDirect.marshallref (HDirect.allocBytes (Prelude.fromIntegral Wtypes.sizeofRECT)) Wtypes.writeRECT prcEventRegion pvarEventArg <- Automation.marshallVariant pvarEventArg Com.invokeIt (\ methPtr iptr -> Foreign.ForeignPtr.withForeignPtr rclsidComp (\ rclsidComp -> Foreign.ForeignPtr.withForeignPtr pguidUIEventGroup (\ pguidUIEventGroup -> prim_Oleipc_onUIEvent methPtr iptr dwCompRole rclsidComp pguidUIEventGroup nUIEventId dwUIEventStatus dwEventFreq prcEventRegion pvarEventArg))) 5 iptr HDirect.free prcEventRegion HDirect.free pvarEventArg foreign import stdcall "dynamic" prim_Oleipc_onUIEvent :: Foreign.Ptr.Ptr () -> Foreign.Ptr.Ptr () -> Word.Word32 -> Foreign.Ptr.Ptr Com.GUID -> Foreign.Ptr.Ptr Com.GUID -> Word.Word32 -> Word.Word32 -> Word.Word32 -> Foreign.Ptr.Ptr Wtypes.RECT -> Automation.VARIANT -> Prelude.IO () onUIEventProgress :: Wtypes.DWORD_PTR -> Wtypes.BOOL -> Wtypes.LPOLESTR -> Wtypes.ULONG -> Wtypes.ULONG -> IOleComponentUIManager a0 -> Prelude.IO Wtypes.DWORD_PTR onUIEventProgress pdwCookie fInProgress pwszLabel nComplete nTotal iptr = do pwszLabel <- WideString.marshallWideString pwszLabel pdwCookie <- HDirect.marshallref (HDirect.allocBytes (Prelude.fromIntegral HDirect.sizeofWord32)) HDirect.writeWord32 pdwCookie Com.invokeAndCheck (\ methPtr iptr -> prim_Oleipc_onUIEventProgress methPtr iptr pdwCookie fInProgress pwszLabel nComplete nTotal) 6 iptr WideString.freeWideString pwszLabel HDirect.doThenFree HDirect.free HDirect.readWord32 pdwCookie foreign import stdcall "dynamic" prim_Oleipc_onUIEventProgress :: Foreign.Ptr.Ptr () -> Foreign.Ptr.Ptr () -> Foreign.Ptr.Ptr Word.Word32 -> Int.Int32 -> Foreign.Ptr.Ptr WideString.WideString -> Word.Word32 -> Word.Word32 -> Prelude.IO Int.Int32 setStatus :: Wtypes.LPCOLESTR -> Wtypes.DWORD -> IOleComponentUIManager a0 -> Prelude.IO () setStatus pwszStatusText dwReserved iptr = do pwszStatusText <- WideString.marshallWideString pwszStatusText Com.invokeAndCheck (\ methPtr iptr -> prim_Oleipc_setStatus methPtr iptr pwszStatusText dwReserved) 7 iptr WideString.freeWideString pwszStatusText foreign import stdcall "dynamic" prim_Oleipc_setStatus :: Foreign.Ptr.Ptr () -> Foreign.Ptr.Ptr () -> Foreign.Ptr.Ptr WideString.WideString -> Word.Word32 -> Prelude.IO Int.Int32 showContextMenu :: Wtypes.DWORD -> Wtypes.REFCLSID -> Wtypes.LONG -> POINTS -> Prelude.Maybe (IOleCommandTarget ()) -> IOleComponentUIManager a0 -> Prelude.IO () showContextMenu dwCompRole rclsidActive nMenuId pos pCmdTrgtActive iptr = do rclsidActive <- Com.marshallCLSID rclsidActive pos <- HDirect.marshallref (HDirect.allocBytes (Prelude.fromIntegral sizeofPOINTS)) writePOINTS pos pCmdTrgtActive <- HDirect.marshallMaybe Com.marshallIUnknown Foreign.Ptr.nullPtr pCmdTrgtActive Com.invokeAndCheck (\ methPtr iptr -> Foreign.ForeignPtr.withForeignPtr rclsidActive (\ rclsidActive -> prim_Oleipc_showContextMenu methPtr iptr dwCompRole rclsidActive nMenuId pos pCmdTrgtActive)) 8 iptr HDirect.free pos foreign import stdcall "dynamic" prim_Oleipc_showContextMenu :: Foreign.Ptr.Ptr () -> Foreign.Ptr.Ptr () -> Word.Word32 -> Foreign.Ptr.Ptr Com.GUID -> Int.Int32 -> Foreign.Ptr.Ptr POINTS -> Foreign.Ptr.Ptr (IOleCommandTarget a) -> Prelude.IO Int.Int32 showHelp :: Wtypes.DWORD -> Wtypes.REFCLSID -> POINTS -> Wtypes.DWORD -> Wtypes.LPOLESTR -> Wtypes.DWORD -> IOleComponentUIManager a0 -> Prelude.IO () showHelp dwCompRole rclsidComp posMouse dwHelpCmd pszHelpFile dwData iptr = do rclsidComp <- Com.marshallCLSID rclsidComp posMouse <- HDirect.marshallref (HDirect.allocBytes (Prelude.fromIntegral sizeofPOINTS)) writePOINTS posMouse pszHelpFile <- WideString.marshallWideString pszHelpFile Com.invokeAndCheck (\ methPtr iptr -> Foreign.ForeignPtr.withForeignPtr rclsidComp (\ rclsidComp -> prim_Oleipc_showHelp methPtr iptr dwCompRole rclsidComp posMouse dwHelpCmd pszHelpFile dwData)) 9 iptr WideString.freeWideString pszHelpFile foreign import stdcall "prim_Oleipc_showHelp" prim_Oleipc_showHelp :: Foreign.Ptr.Ptr () -> Foreign.Ptr.Ptr () -> Word.Word32 -> Foreign.Ptr.Ptr Com.GUID -> Foreign.Ptr.Ptr POINTS -> Word.Word32 -> Foreign.Ptr.Ptr WideString.WideString -> Word.Word32 -> Prelude.IO Int.Int32 showMessage :: OLEROLE -> Wtypes.REFCLSID -> Wtypes.LPOLESTR -> Wtypes.LPOLESTR -> Wtypes.LPOLESTR -> Wtypes.DWORD -> OLEMSGBUTTON -> OLEMSGDEFBUTTON -> OLEMSGICON -> Wtypes.BOOL -> IOleComponentUIManager a0 -> Prelude.IO Wtypes.LONG showMessage dwCompRole rclsidComp pszTitle pszText pszHelpFile dwHelpContextID msgbtn msgdefbtn msgicon fSysAlert iptr = do pnResult <- HDirect.allocBytes (Prelude.fromIntegral HDirect.sizeofInt32) dwCompRole <- HDirect.marshallEnum32 dwCompRole rclsidComp <- Com.marshallCLSID rclsidComp pszTitle <- WideString.marshallWideString pszTitle pszText <- WideString.marshallWideString pszText pszHelpFile <- WideString.marshallWideString pszHelpFile msgbtn <- HDirect.marshallEnum32 msgbtn msgdefbtn <- HDirect.marshallEnum32 msgdefbtn msgicon <- HDirect.marshallEnum32 msgicon Com.invokeAndCheck (\ methPtr iptr -> Foreign.ForeignPtr.withForeignPtr rclsidComp (\ rclsidComp -> prim_Oleipc_showMessage methPtr iptr dwCompRole rclsidComp pszTitle pszText pszHelpFile dwHelpContextID msgbtn msgdefbtn msgicon fSysAlert pnResult)) 10 iptr WideString.freeWideString pszTitle WideString.freeWideString pszText WideString.freeWideString pszHelpFile HDirect.doThenFree HDirect.free HDirect.readInt32 pnResult foreign import stdcall "dynamic" prim_Oleipc_showMessage :: Foreign.Ptr.Ptr () -> Foreign.Ptr.Ptr () -> Int.Int32 -> Foreign.Ptr.Ptr Com.GUID -> Foreign.Ptr.Ptr WideString.WideString -> Foreign.Ptr.Ptr WideString.WideString -> Foreign.Ptr.Ptr WideString.WideString -> Word.Word32 -> Int.Int32 -> Int.Int32 -> Int.Int32 -> Int.Int32 -> Foreign.Ptr.Ptr Int.Int32 -> Prelude.IO Int.Int32