{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

A history item consists out of a title and a uri. It can be part of the
'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList' and the global history. The global history is used
for coloring the links of visited sites.  'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem'\'s constructed with
@/webkit_web_history_item_new/@ and @/webkit_web_history_item_new_with_data/@ are
automatically added to the global history.

\<informalexample>\<programlisting>
\/\<!-- -->* Inject a visited page into the global history *\<!-- -->\/
webkit_web_history_item_new_with_data(\"http:\/\/www.gnome.org\/\", \"GNOME: The Free Software Desktop Project\");
webkit_web_history_item_new_with_data(\"http:\/\/www.webkit.org\/\", \"The WebKit Open Source Project\");
\<\/programlisting>\<\/informalexample>
-}

module GI.WebKit.Objects.WebHistoryItem
    ( 

-- * Exported types
    WebHistoryItem(..)                      ,
    IsWebHistoryItem                        ,
    toWebHistoryItem                        ,
    noWebHistoryItem                        ,


 -- * Methods
-- ** copy #method:copy#
    WebHistoryItemCopyMethodInfo            ,
    webHistoryItemCopy                      ,


-- ** getAlternateTitle #method:getAlternateTitle#
    WebHistoryItemGetAlternateTitleMethodInfo,
    webHistoryItemGetAlternateTitle         ,


-- ** getLastVisitedTime #method:getLastVisitedTime#
    WebHistoryItemGetLastVisitedTimeMethodInfo,
    webHistoryItemGetLastVisitedTime        ,


-- ** getOriginalUri #method:getOriginalUri#
    WebHistoryItemGetOriginalUriMethodInfo  ,
    webHistoryItemGetOriginalUri            ,


-- ** getTitle #method:getTitle#
    WebHistoryItemGetTitleMethodInfo        ,
    webHistoryItemGetTitle                  ,


-- ** getUri #method:getUri#
    WebHistoryItemGetUriMethodInfo          ,
    webHistoryItemGetUri                    ,


-- ** new #method:new#
    webHistoryItemNew                       ,


-- ** newWithData #method:newWithData#
    webHistoryItemNewWithData               ,


-- ** setAlternateTitle #method:setAlternateTitle#
    WebHistoryItemSetAlternateTitleMethodInfo,
    webHistoryItemSetAlternateTitle         ,




 -- * Properties
-- ** alternateTitle #attr:alternateTitle#
    WebHistoryItemAlternateTitlePropertyInfo,
    constructWebHistoryItemAlternateTitle   ,
    getWebHistoryItemAlternateTitle         ,
    setWebHistoryItemAlternateTitle         ,
    webHistoryItemAlternateTitle            ,


-- ** lastVisitedTime #attr:lastVisitedTime#
    WebHistoryItemLastVisitedTimePropertyInfo,
    getWebHistoryItemLastVisitedTime        ,
    webHistoryItemLastVisitedTime           ,


-- ** originalUri #attr:originalUri#
    WebHistoryItemOriginalUriPropertyInfo   ,
    getWebHistoryItemOriginalUri            ,
    webHistoryItemOriginalUri               ,


-- ** title #attr:title#
    WebHistoryItemTitlePropertyInfo         ,
    getWebHistoryItemTitle                  ,
    webHistoryItemTitle                     ,


-- ** uri #attr:uri#
    WebHistoryItemUriPropertyInfo           ,
    getWebHistoryItemUri                    ,
    webHistoryItemUri                       ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

import qualified GI.GObject.Objects.Object as GObject.Object

newtype WebHistoryItem = WebHistoryItem (ManagedPtr WebHistoryItem)
foreign import ccall "webkit_web_history_item_get_type"
    c_webkit_web_history_item_get_type :: IO GType

instance GObject WebHistoryItem where
    gobjectType _ = c_webkit_web_history_item_get_type
    

class GObject o => IsWebHistoryItem o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError WebHistoryItem a) =>
    IsWebHistoryItem a
#endif
instance IsWebHistoryItem WebHistoryItem
instance GObject.Object.IsObject WebHistoryItem

toWebHistoryItem :: IsWebHistoryItem o => o -> IO WebHistoryItem
toWebHistoryItem = unsafeCastTo WebHistoryItem

noWebHistoryItem :: Maybe WebHistoryItem
noWebHistoryItem = Nothing

type family ResolveWebHistoryItemMethod (t :: Symbol) (o :: *) :: * where
    ResolveWebHistoryItemMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveWebHistoryItemMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveWebHistoryItemMethod "copy" o = WebHistoryItemCopyMethodInfo
    ResolveWebHistoryItemMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveWebHistoryItemMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveWebHistoryItemMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveWebHistoryItemMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveWebHistoryItemMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveWebHistoryItemMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveWebHistoryItemMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveWebHistoryItemMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveWebHistoryItemMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveWebHistoryItemMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveWebHistoryItemMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveWebHistoryItemMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveWebHistoryItemMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveWebHistoryItemMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveWebHistoryItemMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveWebHistoryItemMethod "getAlternateTitle" o = WebHistoryItemGetAlternateTitleMethodInfo
    ResolveWebHistoryItemMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveWebHistoryItemMethod "getLastVisitedTime" o = WebHistoryItemGetLastVisitedTimeMethodInfo
    ResolveWebHistoryItemMethod "getOriginalUri" o = WebHistoryItemGetOriginalUriMethodInfo
    ResolveWebHistoryItemMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveWebHistoryItemMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveWebHistoryItemMethod "getTitle" o = WebHistoryItemGetTitleMethodInfo
    ResolveWebHistoryItemMethod "getUri" o = WebHistoryItemGetUriMethodInfo
    ResolveWebHistoryItemMethod "setAlternateTitle" o = WebHistoryItemSetAlternateTitleMethodInfo
    ResolveWebHistoryItemMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveWebHistoryItemMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveWebHistoryItemMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveWebHistoryItemMethod t WebHistoryItem, O.MethodInfo info WebHistoryItem p) => O.IsLabelProxy t (WebHistoryItem -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveWebHistoryItemMethod t WebHistoryItem, O.MethodInfo info WebHistoryItem p) => O.IsLabel t (WebHistoryItem -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

-- VVV Prop "alternate-title"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getWebHistoryItemAlternateTitle :: (MonadIO m, IsWebHistoryItem o) => o -> m T.Text
getWebHistoryItemAlternateTitle obj = liftIO $ checkUnexpectedNothing "getWebHistoryItemAlternateTitle" $ getObjectPropertyString obj "alternate-title"

setWebHistoryItemAlternateTitle :: (MonadIO m, IsWebHistoryItem o) => o -> T.Text -> m ()
setWebHistoryItemAlternateTitle obj val = liftIO $ setObjectPropertyString obj "alternate-title" (Just val)

constructWebHistoryItemAlternateTitle :: (IsWebHistoryItem o) => T.Text -> IO (GValueConstruct o)
constructWebHistoryItemAlternateTitle val = constructObjectPropertyString "alternate-title" (Just val)

data WebHistoryItemAlternateTitlePropertyInfo
instance AttrInfo WebHistoryItemAlternateTitlePropertyInfo where
    type AttrAllowedOps WebHistoryItemAlternateTitlePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint WebHistoryItemAlternateTitlePropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint WebHistoryItemAlternateTitlePropertyInfo = IsWebHistoryItem
    type AttrGetType WebHistoryItemAlternateTitlePropertyInfo = T.Text
    type AttrLabel WebHistoryItemAlternateTitlePropertyInfo = "alternate-title"
    type AttrOrigin WebHistoryItemAlternateTitlePropertyInfo = WebHistoryItem
    attrGet _ = getWebHistoryItemAlternateTitle
    attrSet _ = setWebHistoryItemAlternateTitle
    attrConstruct _ = constructWebHistoryItemAlternateTitle
    attrClear _ = undefined

-- VVV Prop "last-visited-time"
   -- Type: TBasicType TDouble
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getWebHistoryItemLastVisitedTime :: (MonadIO m, IsWebHistoryItem o) => o -> m Double
getWebHistoryItemLastVisitedTime obj = liftIO $ getObjectPropertyDouble obj "last-visited-time"

data WebHistoryItemLastVisitedTimePropertyInfo
instance AttrInfo WebHistoryItemLastVisitedTimePropertyInfo where
    type AttrAllowedOps WebHistoryItemLastVisitedTimePropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint WebHistoryItemLastVisitedTimePropertyInfo = (~) ()
    type AttrBaseTypeConstraint WebHistoryItemLastVisitedTimePropertyInfo = IsWebHistoryItem
    type AttrGetType WebHistoryItemLastVisitedTimePropertyInfo = Double
    type AttrLabel WebHistoryItemLastVisitedTimePropertyInfo = "last-visited-time"
    type AttrOrigin WebHistoryItemLastVisitedTimePropertyInfo = WebHistoryItem
    attrGet _ = getWebHistoryItemLastVisitedTime
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "original-uri"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getWebHistoryItemOriginalUri :: (MonadIO m, IsWebHistoryItem o) => o -> m T.Text
getWebHistoryItemOriginalUri obj = liftIO $ checkUnexpectedNothing "getWebHistoryItemOriginalUri" $ getObjectPropertyString obj "original-uri"

data WebHistoryItemOriginalUriPropertyInfo
instance AttrInfo WebHistoryItemOriginalUriPropertyInfo where
    type AttrAllowedOps WebHistoryItemOriginalUriPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint WebHistoryItemOriginalUriPropertyInfo = (~) ()
    type AttrBaseTypeConstraint WebHistoryItemOriginalUriPropertyInfo = IsWebHistoryItem
    type AttrGetType WebHistoryItemOriginalUriPropertyInfo = T.Text
    type AttrLabel WebHistoryItemOriginalUriPropertyInfo = "original-uri"
    type AttrOrigin WebHistoryItemOriginalUriPropertyInfo = WebHistoryItem
    attrGet _ = getWebHistoryItemOriginalUri
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "title"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getWebHistoryItemTitle :: (MonadIO m, IsWebHistoryItem o) => o -> m T.Text
getWebHistoryItemTitle obj = liftIO $ checkUnexpectedNothing "getWebHistoryItemTitle" $ getObjectPropertyString obj "title"

data WebHistoryItemTitlePropertyInfo
instance AttrInfo WebHistoryItemTitlePropertyInfo where
    type AttrAllowedOps WebHistoryItemTitlePropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint WebHistoryItemTitlePropertyInfo = (~) ()
    type AttrBaseTypeConstraint WebHistoryItemTitlePropertyInfo = IsWebHistoryItem
    type AttrGetType WebHistoryItemTitlePropertyInfo = T.Text
    type AttrLabel WebHistoryItemTitlePropertyInfo = "title"
    type AttrOrigin WebHistoryItemTitlePropertyInfo = WebHistoryItem
    attrGet _ = getWebHistoryItemTitle
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "uri"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getWebHistoryItemUri :: (MonadIO m, IsWebHistoryItem o) => o -> m T.Text
getWebHistoryItemUri obj = liftIO $ checkUnexpectedNothing "getWebHistoryItemUri" $ getObjectPropertyString obj "uri"

data WebHistoryItemUriPropertyInfo
instance AttrInfo WebHistoryItemUriPropertyInfo where
    type AttrAllowedOps WebHistoryItemUriPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint WebHistoryItemUriPropertyInfo = (~) ()
    type AttrBaseTypeConstraint WebHistoryItemUriPropertyInfo = IsWebHistoryItem
    type AttrGetType WebHistoryItemUriPropertyInfo = T.Text
    type AttrLabel WebHistoryItemUriPropertyInfo = "uri"
    type AttrOrigin WebHistoryItemUriPropertyInfo = WebHistoryItem
    attrGet _ = getWebHistoryItemUri
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

instance O.HasAttributeList WebHistoryItem
type instance O.AttributeList WebHistoryItem = WebHistoryItemAttributeList
type WebHistoryItemAttributeList = ('[ '("alternateTitle", WebHistoryItemAlternateTitlePropertyInfo), '("lastVisitedTime", WebHistoryItemLastVisitedTimePropertyInfo), '("originalUri", WebHistoryItemOriginalUriPropertyInfo), '("title", WebHistoryItemTitlePropertyInfo), '("uri", WebHistoryItemUriPropertyInfo)] :: [(Symbol, *)])

webHistoryItemAlternateTitle :: AttrLabelProxy "alternateTitle"
webHistoryItemAlternateTitle = AttrLabelProxy

webHistoryItemLastVisitedTime :: AttrLabelProxy "lastVisitedTime"
webHistoryItemLastVisitedTime = AttrLabelProxy

webHistoryItemOriginalUri :: AttrLabelProxy "originalUri"
webHistoryItemOriginalUri = AttrLabelProxy

webHistoryItemTitle :: AttrLabelProxy "title"
webHistoryItemTitle = AttrLabelProxy

webHistoryItemUri :: AttrLabelProxy "uri"
webHistoryItemUri = AttrLabelProxy

type instance O.SignalList WebHistoryItem = WebHistoryItemSignalList
type WebHistoryItemSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method WebHistoryItem::new
-- method type : Constructor
-- Args : []
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_history_item_new" webkit_web_history_item_new :: 
    IO (Ptr WebHistoryItem)

{- |
Creates a new 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' instance
-}
webHistoryItemNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m WebHistoryItem
    {- ^ __Returns:__ the new 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' -}
webHistoryItemNew  = liftIO $ do
    result <- webkit_web_history_item_new
    checkUnexpectedReturnNULL "webHistoryItemNew" result
    result' <- (wrapObject WebHistoryItem) result
    return result'

-- method WebHistoryItem::new_with_data
-- method type : Constructor
-- Args : [Arg {argCName = "uri", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the URI of the page", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "title", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the title of the page", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_history_item_new_with_data" webkit_web_history_item_new_with_data :: 
    CString ->                              -- uri : TBasicType TUTF8
    CString ->                              -- title : TBasicType TUTF8
    IO (Ptr WebHistoryItem)

{- |
Creates a new 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' with the given URI and title
-}
webHistoryItemNewWithData ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    {- ^ /@uri@/: the URI of the page -}
    -> T.Text
    {- ^ /@title@/: the title of the page -}
    -> m WebHistoryItem
    {- ^ __Returns:__ the new 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' -}
webHistoryItemNewWithData uri title = liftIO $ do
    uri' <- textToCString uri
    title' <- textToCString title
    result <- webkit_web_history_item_new_with_data uri' title'
    checkUnexpectedReturnNULL "webHistoryItemNewWithData" result
    result' <- (wrapObject WebHistoryItem) result
    freeMem uri'
    freeMem title'
    return result'

-- method WebHistoryItem::copy
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_history_item", argType = TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebHistoryItem", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_history_item_copy" webkit_web_history_item_copy :: 
    Ptr WebHistoryItem ->                   -- web_history_item : TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"})
    IO (Ptr WebHistoryItem)

{- |
Makes a copy of the item for use with other WebView objects.

@since 1.1.18
-}
webHistoryItemCopy ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebHistoryItem a) =>
    a
    {- ^ /@webHistoryItem@/: a 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' -}
    -> m WebHistoryItem
    {- ^ __Returns:__ the new 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem'. -}
webHistoryItemCopy webHistoryItem = liftIO $ do
    webHistoryItem' <- unsafeManagedPtrCastPtr webHistoryItem
    result <- webkit_web_history_item_copy webHistoryItem'
    checkUnexpectedReturnNULL "webHistoryItemCopy" result
    result' <- (wrapObject WebHistoryItem) result
    touchManagedPtr webHistoryItem
    return result'

data WebHistoryItemCopyMethodInfo
instance (signature ~ (m WebHistoryItem), MonadIO m, IsWebHistoryItem a) => O.MethodInfo WebHistoryItemCopyMethodInfo a signature where
    overloadedMethod _ = webHistoryItemCopy

-- method WebHistoryItem::get_alternate_title
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_history_item", argType = TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebHistoryItem", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_history_item_get_alternate_title" webkit_web_history_item_get_alternate_title :: 
    Ptr WebHistoryItem ->                   -- web_history_item : TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"})
    IO CString

{- |
Returns the alternate title of /@webHistoryItem@/
-}
webHistoryItemGetAlternateTitle ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebHistoryItem a) =>
    a
    {- ^ /@webHistoryItem@/: a 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' -}
    -> m T.Text
    {- ^ __Returns:__ the alternate title of /@webHistoryItem@/ -}
webHistoryItemGetAlternateTitle webHistoryItem = liftIO $ do
    webHistoryItem' <- unsafeManagedPtrCastPtr webHistoryItem
    result <- webkit_web_history_item_get_alternate_title webHistoryItem'
    checkUnexpectedReturnNULL "webHistoryItemGetAlternateTitle" result
    result' <- cstringToText result
    touchManagedPtr webHistoryItem
    return result'

data WebHistoryItemGetAlternateTitleMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsWebHistoryItem a) => O.MethodInfo WebHistoryItemGetAlternateTitleMethodInfo a signature where
    overloadedMethod _ = webHistoryItemGetAlternateTitle

-- method WebHistoryItem::get_last_visited_time
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_history_item", argType = TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TDouble)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_history_item_get_last_visited_time" webkit_web_history_item_get_last_visited_time :: 
    Ptr WebHistoryItem ->                   -- web_history_item : TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"})
    IO CDouble

{- |
/No description available in the introspection data./
-}
webHistoryItemGetLastVisitedTime ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebHistoryItem a) =>
    a
    -> m Double
webHistoryItemGetLastVisitedTime webHistoryItem = liftIO $ do
    webHistoryItem' <- unsafeManagedPtrCastPtr webHistoryItem
    result <- webkit_web_history_item_get_last_visited_time webHistoryItem'
    let result' = realToFrac result
    touchManagedPtr webHistoryItem
    return result'

data WebHistoryItemGetLastVisitedTimeMethodInfo
instance (signature ~ (m Double), MonadIO m, IsWebHistoryItem a) => O.MethodInfo WebHistoryItemGetLastVisitedTimeMethodInfo a signature where
    overloadedMethod _ = webHistoryItemGetLastVisitedTime

-- method WebHistoryItem::get_original_uri
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_history_item", argType = TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebHistoryItem", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_history_item_get_original_uri" webkit_web_history_item_get_original_uri :: 
    Ptr WebHistoryItem ->                   -- web_history_item : TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"})
    IO CString

{- |
Returns the original URI of /@webHistoryItem@/.
-}
webHistoryItemGetOriginalUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebHistoryItem a) =>
    a
    {- ^ /@webHistoryItem@/: a 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' -}
    -> m T.Text
    {- ^ __Returns:__ the original URI of /@webHistoryItem@/ -}
webHistoryItemGetOriginalUri webHistoryItem = liftIO $ do
    webHistoryItem' <- unsafeManagedPtrCastPtr webHistoryItem
    result <- webkit_web_history_item_get_original_uri webHistoryItem'
    checkUnexpectedReturnNULL "webHistoryItemGetOriginalUri" result
    result' <- cstringToText result
    touchManagedPtr webHistoryItem
    return result'

data WebHistoryItemGetOriginalUriMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsWebHistoryItem a) => O.MethodInfo WebHistoryItemGetOriginalUriMethodInfo a signature where
    overloadedMethod _ = webHistoryItemGetOriginalUri

-- method WebHistoryItem::get_title
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_history_item", argType = TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebHistoryItem", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_history_item_get_title" webkit_web_history_item_get_title :: 
    Ptr WebHistoryItem ->                   -- web_history_item : TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"})
    IO CString

{- |
/No description available in the introspection data./
-}
webHistoryItemGetTitle ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebHistoryItem a) =>
    a
    {- ^ /@webHistoryItem@/: a 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' -}
    -> m T.Text
    {- ^ __Returns:__ the page title of /@webHistoryItem@/ -}
webHistoryItemGetTitle webHistoryItem = liftIO $ do
    webHistoryItem' <- unsafeManagedPtrCastPtr webHistoryItem
    result <- webkit_web_history_item_get_title webHistoryItem'
    checkUnexpectedReturnNULL "webHistoryItemGetTitle" result
    result' <- cstringToText result
    touchManagedPtr webHistoryItem
    return result'

data WebHistoryItemGetTitleMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsWebHistoryItem a) => O.MethodInfo WebHistoryItemGetTitleMethodInfo a signature where
    overloadedMethod _ = webHistoryItemGetTitle

-- method WebHistoryItem::get_uri
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_history_item", argType = TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebHistoryItem", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_history_item_get_uri" webkit_web_history_item_get_uri :: 
    Ptr WebHistoryItem ->                   -- web_history_item : TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"})
    IO CString

{- |
Returns the URI of /@this@/
-}
webHistoryItemGetUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebHistoryItem a) =>
    a
    {- ^ /@webHistoryItem@/: a 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' -}
    -> m T.Text
    {- ^ __Returns:__ the URI of /@webHistoryItem@/ -}
webHistoryItemGetUri webHistoryItem = liftIO $ do
    webHistoryItem' <- unsafeManagedPtrCastPtr webHistoryItem
    result <- webkit_web_history_item_get_uri webHistoryItem'
    checkUnexpectedReturnNULL "webHistoryItemGetUri" result
    result' <- cstringToText result
    touchManagedPtr webHistoryItem
    return result'

data WebHistoryItemGetUriMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsWebHistoryItem a) => O.MethodInfo WebHistoryItemGetUriMethodInfo a signature where
    overloadedMethod _ = webHistoryItemGetUri

-- method WebHistoryItem::set_alternate_title
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_history_item", argType = TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebHistoryItem", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "title", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the alternate title for @this history item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_history_item_set_alternate_title" webkit_web_history_item_set_alternate_title :: 
    Ptr WebHistoryItem ->                   -- web_history_item : TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"})
    CString ->                              -- title : TBasicType TUTF8
    IO ()

{- |
Sets an alternate title for /@webHistoryItem@/
-}
webHistoryItemSetAlternateTitle ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebHistoryItem a) =>
    a
    {- ^ /@webHistoryItem@/: a 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' -}
    -> T.Text
    {- ^ /@title@/: the alternate title for /@this@/ history item -}
    -> m ()
webHistoryItemSetAlternateTitle webHistoryItem title = liftIO $ do
    webHistoryItem' <- unsafeManagedPtrCastPtr webHistoryItem
    title' <- textToCString title
    webkit_web_history_item_set_alternate_title webHistoryItem' title'
    touchManagedPtr webHistoryItem
    freeMem title'
    return ()

data WebHistoryItemSetAlternateTitleMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsWebHistoryItem a) => O.MethodInfo WebHistoryItemSetAlternateTitleMethodInfo a signature where
    overloadedMethod _ = webHistoryItemSetAlternateTitle