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

\<informalexample>\<programlisting>
\/\<!-- -->* Get the WebKitWebBackForwardList from the WebKitWebView *\<!-- -->\/
WebKitWebBackForwardList *back_forward_list = webkit_web_view_get_back_forward_list (my_web_view);
WebKitWebHistoryItem *item = webkit_web_back_forward_list_get_current_item (back_forward_list);

\/\<!-- -->* Do something with a WebKitWebHistoryItem *\<!-- -->\/
g_print(\"@/p/@\", item);

\/\<!-- -->* Control some parameters *\<!-- -->\/
WebKitWebBackForwardList *back_forward_list = webkit_web_view_get_back_forward_list (my_web_view);
webkit_web_back_forward_list_set_limit (back_forward_list, 30);
\<\/programlisting>\<\/informalexample>
-}

module GI.WebKit.Objects.WebBackForwardList
    ( 

-- * Exported types
    WebBackForwardList(..)                  ,
    IsWebBackForwardList                    ,
    toWebBackForwardList                    ,
    noWebBackForwardList                    ,


 -- * Methods
-- ** addItem #method:addItem#
    WebBackForwardListAddItemMethodInfo     ,
    webBackForwardListAddItem               ,


-- ** clear #method:clear#
    WebBackForwardListClearMethodInfo       ,
    webBackForwardListClear                 ,


-- ** containsItem #method:containsItem#
    WebBackForwardListContainsItemMethodInfo,
    webBackForwardListContainsItem          ,


-- ** getBackItem #method:getBackItem#
    WebBackForwardListGetBackItemMethodInfo ,
    webBackForwardListGetBackItem           ,


-- ** getBackLength #method:getBackLength#
    WebBackForwardListGetBackLengthMethodInfo,
    webBackForwardListGetBackLength         ,


-- ** getBackListWithLimit #method:getBackListWithLimit#
    WebBackForwardListGetBackListWithLimitMethodInfo,
    webBackForwardListGetBackListWithLimit  ,


-- ** getCurrentItem #method:getCurrentItem#
    WebBackForwardListGetCurrentItemMethodInfo,
    webBackForwardListGetCurrentItem        ,


-- ** getForwardItem #method:getForwardItem#
    WebBackForwardListGetForwardItemMethodInfo,
    webBackForwardListGetForwardItem        ,


-- ** getForwardLength #method:getForwardLength#
    WebBackForwardListGetForwardLengthMethodInfo,
    webBackForwardListGetForwardLength      ,


-- ** getForwardListWithLimit #method:getForwardListWithLimit#
    WebBackForwardListGetForwardListWithLimitMethodInfo,
    webBackForwardListGetForwardListWithLimit,


-- ** getLimit #method:getLimit#
    WebBackForwardListGetLimitMethodInfo    ,
    webBackForwardListGetLimit              ,


-- ** getNthItem #method:getNthItem#
    WebBackForwardListGetNthItemMethodInfo  ,
    webBackForwardListGetNthItem            ,


-- ** goBack #method:goBack#
    WebBackForwardListGoBackMethodInfo      ,
    webBackForwardListGoBack                ,


-- ** goForward #method:goForward#
    WebBackForwardListGoForwardMethodInfo   ,
    webBackForwardListGoForward             ,


-- ** goToItem #method:goToItem#
    WebBackForwardListGoToItemMethodInfo    ,
    webBackForwardListGoToItem              ,


-- ** setLimit #method:setLimit#
    WebBackForwardListSetLimitMethodInfo    ,
    webBackForwardListSetLimit              ,




    ) 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
import {-# SOURCE #-} qualified GI.WebKit.Objects.WebHistoryItem as WebKit.WebHistoryItem

newtype WebBackForwardList = WebBackForwardList (ManagedPtr WebBackForwardList)
foreign import ccall "webkit_web_back_forward_list_get_type"
    c_webkit_web_back_forward_list_get_type :: IO GType

instance GObject WebBackForwardList where
    gobjectType _ = c_webkit_web_back_forward_list_get_type
    

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

toWebBackForwardList :: IsWebBackForwardList o => o -> IO WebBackForwardList
toWebBackForwardList = unsafeCastTo WebBackForwardList

noWebBackForwardList :: Maybe WebBackForwardList
noWebBackForwardList = Nothing

type family ResolveWebBackForwardListMethod (t :: Symbol) (o :: *) :: * where
    ResolveWebBackForwardListMethod "addItem" o = WebBackForwardListAddItemMethodInfo
    ResolveWebBackForwardListMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveWebBackForwardListMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveWebBackForwardListMethod "clear" o = WebBackForwardListClearMethodInfo
    ResolveWebBackForwardListMethod "containsItem" o = WebBackForwardListContainsItemMethodInfo
    ResolveWebBackForwardListMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveWebBackForwardListMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveWebBackForwardListMethod "goBack" o = WebBackForwardListGoBackMethodInfo
    ResolveWebBackForwardListMethod "goForward" o = WebBackForwardListGoForwardMethodInfo
    ResolveWebBackForwardListMethod "goToItem" o = WebBackForwardListGoToItemMethodInfo
    ResolveWebBackForwardListMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveWebBackForwardListMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveWebBackForwardListMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveWebBackForwardListMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveWebBackForwardListMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveWebBackForwardListMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveWebBackForwardListMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveWebBackForwardListMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveWebBackForwardListMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveWebBackForwardListMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveWebBackForwardListMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveWebBackForwardListMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveWebBackForwardListMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveWebBackForwardListMethod "getBackItem" o = WebBackForwardListGetBackItemMethodInfo
    ResolveWebBackForwardListMethod "getBackLength" o = WebBackForwardListGetBackLengthMethodInfo
    ResolveWebBackForwardListMethod "getBackListWithLimit" o = WebBackForwardListGetBackListWithLimitMethodInfo
    ResolveWebBackForwardListMethod "getCurrentItem" o = WebBackForwardListGetCurrentItemMethodInfo
    ResolveWebBackForwardListMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveWebBackForwardListMethod "getForwardItem" o = WebBackForwardListGetForwardItemMethodInfo
    ResolveWebBackForwardListMethod "getForwardLength" o = WebBackForwardListGetForwardLengthMethodInfo
    ResolveWebBackForwardListMethod "getForwardListWithLimit" o = WebBackForwardListGetForwardListWithLimitMethodInfo
    ResolveWebBackForwardListMethod "getLimit" o = WebBackForwardListGetLimitMethodInfo
    ResolveWebBackForwardListMethod "getNthItem" o = WebBackForwardListGetNthItemMethodInfo
    ResolveWebBackForwardListMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveWebBackForwardListMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveWebBackForwardListMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveWebBackForwardListMethod "setLimit" o = WebBackForwardListSetLimitMethodInfo
    ResolveWebBackForwardListMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveWebBackForwardListMethod l o = O.MethodResolutionFailed l o

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

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

instance O.HasAttributeList WebBackForwardList
type instance O.AttributeList WebBackForwardList = WebBackForwardListAttributeList
type WebBackForwardListAttributeList = ('[ ] :: [(Symbol, *)])

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

-- method WebBackForwardList::add_item
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_back_forward_list", argType = TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebBackForwardList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "history_item", argType = TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitWebHistoryItem to add", 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_back_forward_list_add_item" webkit_web_back_forward_list_add_item :: 
    Ptr WebBackForwardList ->               -- web_back_forward_list : TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"})
    Ptr WebKit.WebHistoryItem.WebHistoryItem -> -- history_item : TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"})
    IO ()

{- |
Adds the item to the 'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList'.

The /@webBackForwardList@/ will add a reference to the /@webHistoryItem@/, so you
don\'t need to keep a reference once you\'ve added it to the list.

@since 1.1.1
-}
webBackForwardListAddItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebBackForwardList a, WebKit.WebHistoryItem.IsWebHistoryItem b) =>
    a
    {- ^ /@webBackForwardList@/: a 'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList' -}
    -> b
    {- ^ /@historyItem@/: the 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' to add -}
    -> m ()
webBackForwardListAddItem webBackForwardList historyItem = liftIO $ do
    webBackForwardList' <- unsafeManagedPtrCastPtr webBackForwardList
    historyItem' <- unsafeManagedPtrCastPtr historyItem
    webkit_web_back_forward_list_add_item webBackForwardList' historyItem'
    touchManagedPtr webBackForwardList
    touchManagedPtr historyItem
    return ()

data WebBackForwardListAddItemMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsWebBackForwardList a, WebKit.WebHistoryItem.IsWebHistoryItem b) => O.MethodInfo WebBackForwardListAddItemMethodInfo a signature where
    overloadedMethod _ = webBackForwardListAddItem

-- method WebBackForwardList::clear
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_back_forward_list", argType = TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitWebBackForwardList to be cleared", 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_back_forward_list_clear" webkit_web_back_forward_list_clear :: 
    Ptr WebBackForwardList ->               -- web_back_forward_list : TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"})
    IO ()

{- |
Clears the /@webBackForwardList@/ by removing all its elements. Note that not even
the current page is kept in list when cleared so you would have to add it later.
This method also clears the list of visited links which means that all links will
appear unvisited.

@since 1.3.1
-}
webBackForwardListClear ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebBackForwardList a) =>
    a
    {- ^ /@webBackForwardList@/: the 'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList' to be cleared -}
    -> m ()
webBackForwardListClear webBackForwardList = liftIO $ do
    webBackForwardList' <- unsafeManagedPtrCastPtr webBackForwardList
    webkit_web_back_forward_list_clear webBackForwardList'
    touchManagedPtr webBackForwardList
    return ()

data WebBackForwardListClearMethodInfo
instance (signature ~ (m ()), MonadIO m, IsWebBackForwardList a) => O.MethodInfo WebBackForwardListClearMethodInfo a signature where
    overloadedMethod _ = webBackForwardListClear

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

foreign import ccall "webkit_web_back_forward_list_contains_item" webkit_web_back_forward_list_contains_item :: 
    Ptr WebBackForwardList ->               -- web_back_forward_list : TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"})
    Ptr WebKit.WebHistoryItem.WebHistoryItem -> -- history_item : TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"})
    IO CInt

{- |
Checks if /@webHistoryItem@/ is in the back forward list
-}
webBackForwardListContainsItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebBackForwardList a, WebKit.WebHistoryItem.IsWebHistoryItem b) =>
    a
    {- ^ /@webBackForwardList@/: a 'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList' -}
    -> b
    {- ^ /@historyItem@/: the 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' to check -}
    -> m Bool
    {- ^ __Returns:__ 'True' if /@webHistoryItem@/ is in the back forward list, 'False' if it doesn\'t -}
webBackForwardListContainsItem webBackForwardList historyItem = liftIO $ do
    webBackForwardList' <- unsafeManagedPtrCastPtr webBackForwardList
    historyItem' <- unsafeManagedPtrCastPtr historyItem
    result <- webkit_web_back_forward_list_contains_item webBackForwardList' historyItem'
    let result' = (/= 0) result
    touchManagedPtr webBackForwardList
    touchManagedPtr historyItem
    return result'

data WebBackForwardListContainsItemMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsWebBackForwardList a, WebKit.WebHistoryItem.IsWebHistoryItem b) => O.MethodInfo WebBackForwardListContainsItemMethodInfo a signature where
    overloadedMethod _ = webBackForwardListContainsItem

-- method WebBackForwardList::get_back_item
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_back_forward_list", argType = TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebBackForwardList", 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_back_forward_list_get_back_item" webkit_web_back_forward_list_get_back_item :: 
    Ptr WebBackForwardList ->               -- web_back_forward_list : TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"})
    IO (Ptr WebKit.WebHistoryItem.WebHistoryItem)

{- |
Returns the item that precedes the current item
-}
webBackForwardListGetBackItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebBackForwardList a) =>
    a
    {- ^ /@webBackForwardList@/: a 'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList' -}
    -> m WebKit.WebHistoryItem.WebHistoryItem
    {- ^ __Returns:__ the 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' preceding the current item -}
webBackForwardListGetBackItem webBackForwardList = liftIO $ do
    webBackForwardList' <- unsafeManagedPtrCastPtr webBackForwardList
    result <- webkit_web_back_forward_list_get_back_item webBackForwardList'
    checkUnexpectedReturnNULL "webBackForwardListGetBackItem" result
    result' <- (newObject WebKit.WebHistoryItem.WebHistoryItem) result
    touchManagedPtr webBackForwardList
    return result'

data WebBackForwardListGetBackItemMethodInfo
instance (signature ~ (m WebKit.WebHistoryItem.WebHistoryItem), MonadIO m, IsWebBackForwardList a) => O.MethodInfo WebBackForwardListGetBackItemMethodInfo a signature where
    overloadedMethod _ = webBackForwardListGetBackItem

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

foreign import ccall "webkit_web_back_forward_list_get_back_length" webkit_web_back_forward_list_get_back_length :: 
    Ptr WebBackForwardList ->               -- web_back_forward_list : TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"})
    IO Int32

{- |
Returns the number of items that preced the current item.
-}
webBackForwardListGetBackLength ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebBackForwardList a) =>
    a
    {- ^ /@webBackForwardList@/: a 'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList' -}
    -> m Int32
    {- ^ __Returns:__ a @/gint/@ corresponding to the number of items preceding the current item -}
webBackForwardListGetBackLength webBackForwardList = liftIO $ do
    webBackForwardList' <- unsafeManagedPtrCastPtr webBackForwardList
    result <- webkit_web_back_forward_list_get_back_length webBackForwardList'
    touchManagedPtr webBackForwardList
    return result

data WebBackForwardListGetBackLengthMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsWebBackForwardList a) => O.MethodInfo WebBackForwardListGetBackLengthMethodInfo a signature where
    overloadedMethod _ = webBackForwardListGetBackLength

-- method WebBackForwardList::get_back_list_with_limit
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_back_forward_list", argType = TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebBackForwardList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "limit", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the number of items to retrieve", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TGList (TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"})))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_back_forward_list_get_back_list_with_limit" webkit_web_back_forward_list_get_back_list_with_limit :: 
    Ptr WebBackForwardList ->               -- web_back_forward_list : TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"})
    Int32 ->                                -- limit : TBasicType TInt
    IO (Ptr (GList (Ptr WebKit.WebHistoryItem.WebHistoryItem)))

{- |
Returns a list of items that precede the current item, limited by /@limit@/
-}
webBackForwardListGetBackListWithLimit ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebBackForwardList a) =>
    a
    {- ^ /@webBackForwardList@/: a 'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList' -}
    -> Int32
    {- ^ /@limit@/: the number of items to retrieve -}
    -> m [WebKit.WebHistoryItem.WebHistoryItem]
    {- ^ __Returns:__ a 'GI.GLib.Structs.List.List' of items preceding the current item, limited by /@limit@/ -}
webBackForwardListGetBackListWithLimit webBackForwardList limit = liftIO $ do
    webBackForwardList' <- unsafeManagedPtrCastPtr webBackForwardList
    result <- webkit_web_back_forward_list_get_back_list_with_limit webBackForwardList' limit
    result' <- unpackGList result
    result'' <- mapM (newObject WebKit.WebHistoryItem.WebHistoryItem) result'
    g_list_free result
    touchManagedPtr webBackForwardList
    return result''

data WebBackForwardListGetBackListWithLimitMethodInfo
instance (signature ~ (Int32 -> m [WebKit.WebHistoryItem.WebHistoryItem]), MonadIO m, IsWebBackForwardList a) => O.MethodInfo WebBackForwardListGetBackListWithLimitMethodInfo a signature where
    overloadedMethod _ = webBackForwardListGetBackListWithLimit

-- method WebBackForwardList::get_current_item
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_back_forward_list", argType = TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebBackForwardList", 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_back_forward_list_get_current_item" webkit_web_back_forward_list_get_current_item :: 
    Ptr WebBackForwardList ->               -- web_back_forward_list : TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"})
    IO (Ptr WebKit.WebHistoryItem.WebHistoryItem)

{- |
Returns the current item.

Returns a NULL value if the back forward list is empty
-}
webBackForwardListGetCurrentItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebBackForwardList a) =>
    a
    {- ^ /@webBackForwardList@/: a 'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList' -}
    -> m WebKit.WebHistoryItem.WebHistoryItem
    {- ^ __Returns:__ a 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' -}
webBackForwardListGetCurrentItem webBackForwardList = liftIO $ do
    webBackForwardList' <- unsafeManagedPtrCastPtr webBackForwardList
    result <- webkit_web_back_forward_list_get_current_item webBackForwardList'
    checkUnexpectedReturnNULL "webBackForwardListGetCurrentItem" result
    result' <- (newObject WebKit.WebHistoryItem.WebHistoryItem) result
    touchManagedPtr webBackForwardList
    return result'

data WebBackForwardListGetCurrentItemMethodInfo
instance (signature ~ (m WebKit.WebHistoryItem.WebHistoryItem), MonadIO m, IsWebBackForwardList a) => O.MethodInfo WebBackForwardListGetCurrentItemMethodInfo a signature where
    overloadedMethod _ = webBackForwardListGetCurrentItem

-- method WebBackForwardList::get_forward_item
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_back_forward_list", argType = TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebBackForwardList", 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_back_forward_list_get_forward_item" webkit_web_back_forward_list_get_forward_item :: 
    Ptr WebBackForwardList ->               -- web_back_forward_list : TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"})
    IO (Ptr WebKit.WebHistoryItem.WebHistoryItem)

{- |
Returns the item that succeeds the current item.

Returns a NULL value if there nothing that succeeds the current item
-}
webBackForwardListGetForwardItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebBackForwardList a) =>
    a
    {- ^ /@webBackForwardList@/: a 'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList' -}
    -> m WebKit.WebHistoryItem.WebHistoryItem
    {- ^ __Returns:__ a 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' -}
webBackForwardListGetForwardItem webBackForwardList = liftIO $ do
    webBackForwardList' <- unsafeManagedPtrCastPtr webBackForwardList
    result <- webkit_web_back_forward_list_get_forward_item webBackForwardList'
    checkUnexpectedReturnNULL "webBackForwardListGetForwardItem" result
    result' <- (newObject WebKit.WebHistoryItem.WebHistoryItem) result
    touchManagedPtr webBackForwardList
    return result'

data WebBackForwardListGetForwardItemMethodInfo
instance (signature ~ (m WebKit.WebHistoryItem.WebHistoryItem), MonadIO m, IsWebBackForwardList a) => O.MethodInfo WebBackForwardListGetForwardItemMethodInfo a signature where
    overloadedMethod _ = webBackForwardListGetForwardItem

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

foreign import ccall "webkit_web_back_forward_list_get_forward_length" webkit_web_back_forward_list_get_forward_length :: 
    Ptr WebBackForwardList ->               -- web_back_forward_list : TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"})
    IO Int32

{- |
Returns the number of items that succeed the current item.
-}
webBackForwardListGetForwardLength ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebBackForwardList a) =>
    a
    {- ^ /@webBackForwardList@/: a 'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList' -}
    -> m Int32
    {- ^ __Returns:__ a @/gint/@ corresponding to the nuber of items succeeding the current item -}
webBackForwardListGetForwardLength webBackForwardList = liftIO $ do
    webBackForwardList' <- unsafeManagedPtrCastPtr webBackForwardList
    result <- webkit_web_back_forward_list_get_forward_length webBackForwardList'
    touchManagedPtr webBackForwardList
    return result

data WebBackForwardListGetForwardLengthMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsWebBackForwardList a) => O.MethodInfo WebBackForwardListGetForwardLengthMethodInfo a signature where
    overloadedMethod _ = webBackForwardListGetForwardLength

-- method WebBackForwardList::get_forward_list_with_limit
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_back_forward_list", argType = TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebBackForwardList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "limit", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the number of items to retrieve", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TGList (TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"})))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_back_forward_list_get_forward_list_with_limit" webkit_web_back_forward_list_get_forward_list_with_limit :: 
    Ptr WebBackForwardList ->               -- web_back_forward_list : TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"})
    Int32 ->                                -- limit : TBasicType TInt
    IO (Ptr (GList (Ptr WebKit.WebHistoryItem.WebHistoryItem)))

{- |
Returns a list of items that succeed the current item, limited by /@limit@/
-}
webBackForwardListGetForwardListWithLimit ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebBackForwardList a) =>
    a
    {- ^ /@webBackForwardList@/: a 'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList' -}
    -> Int32
    {- ^ /@limit@/: the number of items to retrieve -}
    -> m [WebKit.WebHistoryItem.WebHistoryItem]
    {- ^ __Returns:__ a 'GI.GLib.Structs.List.List' of items succeeding the current item, limited by /@limit@/ -}
webBackForwardListGetForwardListWithLimit webBackForwardList limit = liftIO $ do
    webBackForwardList' <- unsafeManagedPtrCastPtr webBackForwardList
    result <- webkit_web_back_forward_list_get_forward_list_with_limit webBackForwardList' limit
    result' <- unpackGList result
    result'' <- mapM (newObject WebKit.WebHistoryItem.WebHistoryItem) result'
    g_list_free result
    touchManagedPtr webBackForwardList
    return result''

data WebBackForwardListGetForwardListWithLimitMethodInfo
instance (signature ~ (Int32 -> m [WebKit.WebHistoryItem.WebHistoryItem]), MonadIO m, IsWebBackForwardList a) => O.MethodInfo WebBackForwardListGetForwardListWithLimitMethodInfo a signature where
    overloadedMethod _ = webBackForwardListGetForwardListWithLimit

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

foreign import ccall "webkit_web_back_forward_list_get_limit" webkit_web_back_forward_list_get_limit :: 
    Ptr WebBackForwardList ->               -- web_back_forward_list : TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"})
    IO Int32

{- |
Returns the maximum limit of the back forward list.
-}
webBackForwardListGetLimit ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebBackForwardList a) =>
    a
    {- ^ /@webBackForwardList@/: a 'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList' -}
    -> m Int32
    {- ^ __Returns:__ a @/gint/@ indicating the number of 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' the back forward list can hold -}
webBackForwardListGetLimit webBackForwardList = liftIO $ do
    webBackForwardList' <- unsafeManagedPtrCastPtr webBackForwardList
    result <- webkit_web_back_forward_list_get_limit webBackForwardList'
    touchManagedPtr webBackForwardList
    return result

data WebBackForwardListGetLimitMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsWebBackForwardList a) => O.MethodInfo WebBackForwardListGetLimitMethodInfo a signature where
    overloadedMethod _ = webBackForwardListGetLimit

-- method WebBackForwardList::get_nth_item
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_back_forward_list", argType = TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebBackForwardList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "index", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the index of the item", 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_back_forward_list_get_nth_item" webkit_web_back_forward_list_get_nth_item :: 
    Ptr WebBackForwardList ->               -- web_back_forward_list : TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"})
    Int32 ->                                -- index : TBasicType TInt
    IO (Ptr WebKit.WebHistoryItem.WebHistoryItem)

{- |
Returns the item at a given index relative to the current item.
-}
webBackForwardListGetNthItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebBackForwardList a) =>
    a
    {- ^ /@webBackForwardList@/: a 'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList' -}
    -> Int32
    {- ^ /@index@/: the index of the item -}
    -> m WebKit.WebHistoryItem.WebHistoryItem
    {- ^ __Returns:__ the 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' located at the specified index relative to the current item -}
webBackForwardListGetNthItem webBackForwardList index = liftIO $ do
    webBackForwardList' <- unsafeManagedPtrCastPtr webBackForwardList
    result <- webkit_web_back_forward_list_get_nth_item webBackForwardList' index
    checkUnexpectedReturnNULL "webBackForwardListGetNthItem" result
    result' <- (newObject WebKit.WebHistoryItem.WebHistoryItem) result
    touchManagedPtr webBackForwardList
    return result'

data WebBackForwardListGetNthItemMethodInfo
instance (signature ~ (Int32 -> m WebKit.WebHistoryItem.WebHistoryItem), MonadIO m, IsWebBackForwardList a) => O.MethodInfo WebBackForwardListGetNthItemMethodInfo a signature where
    overloadedMethod _ = webBackForwardListGetNthItem

-- method WebBackForwardList::go_back
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_back_forward_list", argType = TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebBackForwardList", 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_back_forward_list_go_back" webkit_web_back_forward_list_go_back :: 
    Ptr WebBackForwardList ->               -- web_back_forward_list : TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"})
    IO ()

{- |
Steps backward in the back forward list
-}
webBackForwardListGoBack ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebBackForwardList a) =>
    a
    {- ^ /@webBackForwardList@/: a 'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList' -}
    -> m ()
webBackForwardListGoBack webBackForwardList = liftIO $ do
    webBackForwardList' <- unsafeManagedPtrCastPtr webBackForwardList
    webkit_web_back_forward_list_go_back webBackForwardList'
    touchManagedPtr webBackForwardList
    return ()

data WebBackForwardListGoBackMethodInfo
instance (signature ~ (m ()), MonadIO m, IsWebBackForwardList a) => O.MethodInfo WebBackForwardListGoBackMethodInfo a signature where
    overloadedMethod _ = webBackForwardListGoBack

-- method WebBackForwardList::go_forward
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_back_forward_list", argType = TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebBackForwardList", 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_back_forward_list_go_forward" webkit_web_back_forward_list_go_forward :: 
    Ptr WebBackForwardList ->               -- web_back_forward_list : TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"})
    IO ()

{- |
Steps forward in the back forward list
-}
webBackForwardListGoForward ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebBackForwardList a) =>
    a
    {- ^ /@webBackForwardList@/: a 'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList' -}
    -> m ()
webBackForwardListGoForward webBackForwardList = liftIO $ do
    webBackForwardList' <- unsafeManagedPtrCastPtr webBackForwardList
    webkit_web_back_forward_list_go_forward webBackForwardList'
    touchManagedPtr webBackForwardList
    return ()

data WebBackForwardListGoForwardMethodInfo
instance (signature ~ (m ()), MonadIO m, IsWebBackForwardList a) => O.MethodInfo WebBackForwardListGoForwardMethodInfo a signature where
    overloadedMethod _ = webBackForwardListGoForward

-- method WebBackForwardList::go_to_item
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_back_forward_list", argType = TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebBackForwardList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "history_item", argType = TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitWebHistoryItem to go to", 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_back_forward_list_go_to_item" webkit_web_back_forward_list_go_to_item :: 
    Ptr WebBackForwardList ->               -- web_back_forward_list : TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"})
    Ptr WebKit.WebHistoryItem.WebHistoryItem -> -- history_item : TInterface (Name {namespace = "WebKit", name = "WebHistoryItem"})
    IO ()

{- |
Go to the specified /@webHistoryItem@/ in the back forward list
-}
webBackForwardListGoToItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebBackForwardList a, WebKit.WebHistoryItem.IsWebHistoryItem b) =>
    a
    {- ^ /@webBackForwardList@/: a 'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList' -}
    -> b
    {- ^ /@historyItem@/: the 'GI.WebKit.Objects.WebHistoryItem.WebHistoryItem' to go to -}
    -> m ()
webBackForwardListGoToItem webBackForwardList historyItem = liftIO $ do
    webBackForwardList' <- unsafeManagedPtrCastPtr webBackForwardList
    historyItem' <- unsafeManagedPtrCastPtr historyItem
    webkit_web_back_forward_list_go_to_item webBackForwardList' historyItem'
    touchManagedPtr webBackForwardList
    touchManagedPtr historyItem
    return ()

data WebBackForwardListGoToItemMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsWebBackForwardList a, WebKit.WebHistoryItem.IsWebHistoryItem b) => O.MethodInfo WebBackForwardListGoToItemMethodInfo a signature where
    overloadedMethod _ = webBackForwardListGoToItem

-- method WebBackForwardList::set_limit
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "web_back_forward_list", argType = TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebBackForwardList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "limit", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the limit to set the back forward list to", 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_back_forward_list_set_limit" webkit_web_back_forward_list_set_limit :: 
    Ptr WebBackForwardList ->               -- web_back_forward_list : TInterface (Name {namespace = "WebKit", name = "WebBackForwardList"})
    Int32 ->                                -- limit : TBasicType TInt
    IO ()

{- |
Sets the maximum limit of the back forward list. If the back forward list
exceeds its capacity, items will be removed everytime a new item has been
added.
-}
webBackForwardListSetLimit ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebBackForwardList a) =>
    a
    {- ^ /@webBackForwardList@/: a 'GI.WebKit.Objects.WebBackForwardList.WebBackForwardList' -}
    -> Int32
    {- ^ /@limit@/: the limit to set the back forward list to -}
    -> m ()
webBackForwardListSetLimit webBackForwardList limit = liftIO $ do
    webBackForwardList' <- unsafeManagedPtrCastPtr webBackForwardList
    webkit_web_back_forward_list_set_limit webBackForwardList' limit
    touchManagedPtr webBackForwardList
    return ()

data WebBackForwardListSetLimitMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsWebBackForwardList a) => O.MethodInfo WebBackForwardListSetLimitMethodInfo a signature where
    overloadedMethod _ = webBackForwardListSetLimit