module Graphics.UI.Gtk.WebKit.WebResource (
WebResource,
WebResourceClass,
webResourceNew,
webResourceGetData,
webResourceGetEncoding,
webResourceGetFrameName,
webResourceGetMimeType,
webResourceGetUri,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.UTFString
import System.Glib.GList
import System.Glib.GString
import System.Glib.GError
import Graphics.UI.Gtk.Gdk.Events
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.WebKit.Types
import System.Glib.GObject
webResourceNew :: String -> Int -> String -> String -> String -> String -> IO WebResource
webResourceNew resData size uri mimeType encoding frameName =
withCString resData $ \dataPtr ->
withCString uri $ \uriPtr ->
withCString mimeType $ \mimePtr ->
withCString encoding $ \encodingPtr ->
withCString frameName $ \framePtr ->
wrapNewGObject mkWebResource $
webkit_web_resource_new dataPtr (fromIntegral size) uriPtr mimePtr encodingPtr framePtr
webResourceGetData :: WebResourceClass self => self -> IO (Maybe String)
webResourceGetData wr =
(\(WebResource arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_web_resource_get_data argPtr1) (toWebResource wr) >>= readGString
webResourceGetEncoding ::
WebResourceClass self => self
-> IO (Maybe String)
webResourceGetEncoding wr =
(\(WebResource arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_web_resource_get_encoding argPtr1) (toWebResource wr) >>= maybePeek peekCString
webResourceGetFrameName ::
WebResourceClass self => self
-> IO (Maybe String)
webResourceGetFrameName wr =
(\(WebResource arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_web_resource_get_frame_name argPtr1) (toWebResource wr) >>= maybePeek peekCString
webResourceGetMimeType ::
WebResourceClass self => self
-> IO (Maybe String)
webResourceGetMimeType wr =
(\(WebResource arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_web_resource_get_mime_type argPtr1) (toWebResource wr) >>= maybePeek peekCString
webResourceGetUri ::
WebResourceClass self => self
-> IO String
webResourceGetUri wr =
(\(WebResource arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_web_resource_get_uri argPtr1) (toWebResource wr) >>= peekCString
foreign import ccall safe "webkit_web_resource_new"
webkit_web_resource_new :: ((Ptr CChar) -> (CLong -> ((Ptr CChar) -> ((Ptr CChar) -> ((Ptr CChar) -> ((Ptr CChar) -> (IO (Ptr WebResource))))))))
foreign import ccall safe "webkit_web_resource_get_data"
webkit_web_resource_get_data :: ((Ptr WebResource) -> (IO (Ptr ())))
foreign import ccall safe "webkit_web_resource_get_encoding"
webkit_web_resource_get_encoding :: ((Ptr WebResource) -> (IO (Ptr CChar)))
foreign import ccall safe "webkit_web_resource_get_frame_name"
webkit_web_resource_get_frame_name :: ((Ptr WebResource) -> (IO (Ptr CChar)))
foreign import ccall safe "webkit_web_resource_get_mime_type"
webkit_web_resource_get_mime_type :: ((Ptr WebResource) -> (IO (Ptr CChar)))
foreign import ccall safe "webkit_web_resource_get_uri"
webkit_web_resource_get_uri :: ((Ptr WebResource) -> (IO (Ptr CChar)))