module Graphics.UI.Gtk.WebKit.DOM.Storage
(storageKey, storageGetItem, storageSetItem, storageRemoveItem,
storageClear, storageGetLength, Storage, StorageClass,
castToStorage, gTypeStorage, toStorage)
where
import System.Glib.FFI
import System.Glib.UTFString
import Control.Applicative
import Graphics.UI.Gtk.WebKit.Types
import System.Glib.GError
import Graphics.UI.Gtk.WebKit.DOM.EventM
storageKey ::
(StorageClass self, GlibString string) => self -> Word -> IO string
storageKey self index = propagateGError $ \errorPtr ->
((\(Storage arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_storage_key argPtr1 arg2 arg3) (toStorage self) (fromIntegral index) errorPtr >>= readUTFString)
storageGetItem ::
(StorageClass self, GlibString string) =>
self -> string -> IO string
storageGetItem self key = propagateGError $ \errorPtr -> (
(withUTFString key $ \keyPtr ->
(\(Storage arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_storage_get_item argPtr1 arg2 arg3) (toStorage self) keyPtr errorPtr)
>>= readUTFString)
storageSetItem :: (StorageClass self, GlibString string) => self -> string -> string -> IO ()
storageSetItem self key data'
= propagateGError $
\ errorPtr_ ->
withUTFString data' $
\ dataPtr ->
withUTFString key $
\ keyPtr ->
(\(Storage arg1) arg2 arg3 arg4 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_storage_set_item argPtr1 arg2 arg3 arg4) (toStorage self) keyPtr
dataPtr
errorPtr_
storageRemoveItem ::
(StorageClass self, GlibString string) => self -> string -> IO ()
storageRemoveItem self key = propagateGError $ \errorPtr -> (
withUTFString key $ \keyPtr ->
(\(Storage arg1) arg2 arg3 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_storage_remove_item argPtr1 arg2 arg3) (toStorage self) keyPtr errorPtr)
storageClear :: (StorageClass self) => self -> IO ()
storageClear self = propagateGError $ (\(Storage arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_storage_clear argPtr1 arg2) (toStorage self)
storageGetLength :: (StorageClass self) => self -> IO Word
storageGetLength self = fromIntegral <$> propagateGError ((\(Storage arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_storage_get_length argPtr1 arg2) (toStorage self))
foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/Storage.h webkit_dom_storage_key"
webkit_dom_storage_key :: ((Ptr Storage) -> (CULong -> ((Ptr (Ptr ())) -> (IO (Ptr CChar)))))
foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/Storage.h webkit_dom_storage_get_item"
webkit_dom_storage_get_item :: ((Ptr Storage) -> ((Ptr CChar) -> ((Ptr (Ptr ())) -> (IO (Ptr CChar)))))
foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/Storage.h webkit_dom_storage_set_item"
webkit_dom_storage_set_item :: ((Ptr Storage) -> ((Ptr CChar) -> ((Ptr CChar) -> ((Ptr (Ptr ())) -> (IO ())))))
foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/Storage.h webkit_dom_storage_remove_item"
webkit_dom_storage_remove_item :: ((Ptr Storage) -> ((Ptr CChar) -> ((Ptr (Ptr ())) -> (IO ()))))
foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/Storage.h webkit_dom_storage_clear"
webkit_dom_storage_clear :: ((Ptr Storage) -> ((Ptr (Ptr ())) -> (IO ())))
foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/Storage.h webkit_dom_storage_get_length"
webkit_dom_storage_get_length :: ((Ptr Storage) -> ((Ptr (Ptr ())) -> (IO CULong)))