module Graphics.UI.Gtk.WebKit.SecurityOrigin (
SecurityOrigin,
SecurityOriginClass,
securityOriginGetAllWebDatabases,
securityOriginGetHost,
securityOriginGetPort,
securityOriginGetProtocol,
securityOriginGetWebDatabaseQuota,
securityOriginSetWebDatabaseQuota,
securityOriginGetWebDatabaseUsage,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.UTFString
import System.Glib.GList
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
securityOriginGetAllWebDatabases ::
SecurityOriginClass self => self
-> IO [WebDatabase]
securityOriginGetAllWebDatabases so = do
glist <- (\(SecurityOrigin arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_security_origin_get_all_web_databases argPtr1) (toSecurityOrigin so)
databasePtr <- fromGList glist
mapM (makeNewGObject mkWebDatabase . return) databasePtr
securityOriginGetHost ::
(SecurityOriginClass self, GlibString string) => self
-> IO string
securityOriginGetHost so =
(\(SecurityOrigin arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_security_origin_get_host argPtr1) (toSecurityOrigin so) >>= peekUTFString
securityOriginGetPort ::
SecurityOriginClass self => self
-> IO Int
securityOriginGetPort so =
liftM fromIntegral $ (\(SecurityOrigin arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_security_origin_get_port argPtr1) (toSecurityOrigin so)
securityOriginGetProtocol ::
(SecurityOriginClass self, GlibString string) => self
-> IO string
securityOriginGetProtocol so =
(\(SecurityOrigin arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_security_origin_get_protocol argPtr1) (toSecurityOrigin so) >>= peekUTFString
securityOriginGetWebDatabaseQuota ::
SecurityOriginClass self => self
-> IO Int
securityOriginGetWebDatabaseQuota so =
liftM fromIntegral $ (\(SecurityOrigin arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_security_origin_get_web_database_quota argPtr1) (toSecurityOrigin so)
securityOriginGetWebDatabaseUsage ::
SecurityOriginClass self => self
-> IO Int
securityOriginGetWebDatabaseUsage so =
liftM fromIntegral $ (\(SecurityOrigin arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_security_origin_get_web_database_usage argPtr1) (toSecurityOrigin so)
securityOriginSetWebDatabaseQuota ::
SecurityOriginClass self => self
-> Int
-> IO ()
securityOriginSetWebDatabaseQuota so quota =
(\(SecurityOrigin arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_security_origin_set_web_database_quota argPtr1 arg2) (toSecurityOrigin so) (fromIntegral quota)
foreign import ccall safe "webkit_security_origin_get_all_web_databases"
webkit_security_origin_get_all_web_databases :: ((Ptr SecurityOrigin) -> (IO (Ptr ())))
foreign import ccall safe "webkit_security_origin_get_host"
webkit_security_origin_get_host :: ((Ptr SecurityOrigin) -> (IO (Ptr CChar)))
foreign import ccall safe "webkit_security_origin_get_port"
webkit_security_origin_get_port :: ((Ptr SecurityOrigin) -> (IO CUInt))
foreign import ccall safe "webkit_security_origin_get_protocol"
webkit_security_origin_get_protocol :: ((Ptr SecurityOrigin) -> (IO (Ptr CChar)))
foreign import ccall safe "webkit_security_origin_get_web_database_quota"
webkit_security_origin_get_web_database_quota :: ((Ptr SecurityOrigin) -> (IO CULong))
foreign import ccall safe "webkit_security_origin_get_web_database_usage"
webkit_security_origin_get_web_database_usage :: ((Ptr SecurityOrigin) -> (IO CULong))
foreign import ccall safe "webkit_security_origin_set_web_database_quota"
webkit_security_origin_set_web_database_quota :: ((Ptr SecurityOrigin) -> (CULong -> (IO ())))