{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- /No description available in the introspection data./

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.WebKit2.Objects.EditorState
    ( 

-- * Exported types
    EditorState(..)                         ,
    IsEditorState                           ,
    toEditorState                           ,
    noEditorState                           ,


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#if defined(ENABLE_OVERLOADING)
    ResolveEditorStateMethod                ,
#endif


-- ** getTypingAttributes #method:getTypingAttributes#

#if defined(ENABLE_OVERLOADING)
    EditorStateGetTypingAttributesMethodInfo,
#endif
    editorStateGetTypingAttributes          ,


-- ** isCopyAvailable #method:isCopyAvailable#

#if defined(ENABLE_OVERLOADING)
    EditorStateIsCopyAvailableMethodInfo    ,
#endif
    editorStateIsCopyAvailable              ,


-- ** isCutAvailable #method:isCutAvailable#

#if defined(ENABLE_OVERLOADING)
    EditorStateIsCutAvailableMethodInfo     ,
#endif
    editorStateIsCutAvailable               ,


-- ** isPasteAvailable #method:isPasteAvailable#

#if defined(ENABLE_OVERLOADING)
    EditorStateIsPasteAvailableMethodInfo   ,
#endif
    editorStateIsPasteAvailable             ,


-- ** isRedoAvailable #method:isRedoAvailable#

#if defined(ENABLE_OVERLOADING)
    EditorStateIsRedoAvailableMethodInfo    ,
#endif
    editorStateIsRedoAvailable              ,


-- ** isUndoAvailable #method:isUndoAvailable#

#if defined(ENABLE_OVERLOADING)
    EditorStateIsUndoAvailableMethodInfo    ,
#endif
    editorStateIsUndoAvailable              ,




 -- * Properties
-- ** typingAttributes #attr:typingAttributes#
-- | Bitmask of t'GI.WebKit2.Flags.EditorTypingAttributes' flags.
-- See 'GI.WebKit2.Objects.EditorState.editorStateGetTypingAttributes' for more information.
-- 
-- /Since: 2.10/

#if defined(ENABLE_OVERLOADING)
    EditorStateTypingAttributesPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
    editorStateTypingAttributes             ,
#endif
    getEditorStateTypingAttributes          ,




    ) 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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
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 GHC.OverloadedLabels as OL

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

-- | Memory-managed wrapper type.
newtype EditorState = EditorState (ManagedPtr EditorState)
    deriving (EditorState -> EditorState -> Bool
(EditorState -> EditorState -> Bool)
-> (EditorState -> EditorState -> Bool) -> Eq EditorState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EditorState -> EditorState -> Bool
$c/= :: EditorState -> EditorState -> Bool
== :: EditorState -> EditorState -> Bool
$c== :: EditorState -> EditorState -> Bool
Eq)
foreign import ccall "webkit_editor_state_get_type"
    c_webkit_editor_state_get_type :: IO GType

instance GObject EditorState where
    gobjectType :: IO GType
gobjectType = IO GType
c_webkit_editor_state_get_type
    

-- | Convert 'EditorState' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue EditorState where
    toGValue :: EditorState -> IO GValue
toGValue o :: EditorState
o = do
        GType
gtype <- IO GType
c_webkit_editor_state_get_type
        EditorState -> (Ptr EditorState -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr EditorState
o (GType
-> (GValue -> Ptr EditorState -> IO ())
-> Ptr EditorState
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr EditorState -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
        
    fromGValue :: GValue -> IO EditorState
fromGValue gv :: GValue
gv = do
        Ptr EditorState
ptr <- GValue -> IO (Ptr EditorState)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr EditorState)
        (ManagedPtr EditorState -> EditorState)
-> Ptr EditorState -> IO EditorState
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr EditorState -> EditorState
EditorState Ptr EditorState
ptr
        
    

-- | Type class for types which can be safely cast to `EditorState`, for instance with `toEditorState`.
class (GObject o, O.IsDescendantOf EditorState o) => IsEditorState o
instance (GObject o, O.IsDescendantOf EditorState o) => IsEditorState o

instance O.HasParentTypes EditorState
type instance O.ParentTypes EditorState = '[GObject.Object.Object]

-- | Cast to `EditorState`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toEditorState :: (MonadIO m, IsEditorState o) => o -> m EditorState
toEditorState :: o -> m EditorState
toEditorState = IO EditorState -> m EditorState
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EditorState -> m EditorState)
-> (o -> IO EditorState) -> o -> m EditorState
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr EditorState -> EditorState) -> o -> IO EditorState
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr EditorState -> EditorState
EditorState

-- | A convenience alias for `Nothing` :: `Maybe` `EditorState`.
noEditorState :: Maybe EditorState
noEditorState :: Maybe EditorState
noEditorState = Maybe EditorState
forall a. Maybe a
Nothing

#if defined(ENABLE_OVERLOADING)
type family ResolveEditorStateMethod (t :: Symbol) (o :: *) :: * where
    ResolveEditorStateMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveEditorStateMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveEditorStateMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveEditorStateMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveEditorStateMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveEditorStateMethod "isCopyAvailable" o = EditorStateIsCopyAvailableMethodInfo
    ResolveEditorStateMethod "isCutAvailable" o = EditorStateIsCutAvailableMethodInfo
    ResolveEditorStateMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveEditorStateMethod "isPasteAvailable" o = EditorStateIsPasteAvailableMethodInfo
    ResolveEditorStateMethod "isRedoAvailable" o = EditorStateIsRedoAvailableMethodInfo
    ResolveEditorStateMethod "isUndoAvailable" o = EditorStateIsUndoAvailableMethodInfo
    ResolveEditorStateMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveEditorStateMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveEditorStateMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveEditorStateMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveEditorStateMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveEditorStateMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveEditorStateMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveEditorStateMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveEditorStateMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveEditorStateMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveEditorStateMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveEditorStateMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveEditorStateMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveEditorStateMethod "getTypingAttributes" o = EditorStateGetTypingAttributesMethodInfo
    ResolveEditorStateMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveEditorStateMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveEditorStateMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveEditorStateMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveEditorStateMethod t EditorState, O.MethodInfo info EditorState p) => OL.IsLabel t (EditorState -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#endif

-- VVV Prop "typing-attributes"
   -- Type: TBasicType TUInt
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

-- | Get the value of the “@typing-attributes@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' editorState #typingAttributes
-- @
getEditorStateTypingAttributes :: (MonadIO m, IsEditorState o) => o -> m Word32
getEditorStateTypingAttributes :: o -> m Word32
getEditorStateTypingAttributes obj :: o
obj = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word32
forall a. GObject a => a -> String -> IO Word32
B.Properties.getObjectPropertyUInt32 o
obj "typing-attributes"

#if defined(ENABLE_OVERLOADING)
data EditorStateTypingAttributesPropertyInfo
instance AttrInfo EditorStateTypingAttributesPropertyInfo where
    type AttrAllowedOps EditorStateTypingAttributesPropertyInfo = '[ 'AttrGet]
    type AttrBaseTypeConstraint EditorStateTypingAttributesPropertyInfo = IsEditorState
    type AttrSetTypeConstraint EditorStateTypingAttributesPropertyInfo = (~) ()
    type AttrTransferTypeConstraint EditorStateTypingAttributesPropertyInfo = (~) ()
    type AttrTransferType EditorStateTypingAttributesPropertyInfo = ()
    type AttrGetType EditorStateTypingAttributesPropertyInfo = Word32
    type AttrLabel EditorStateTypingAttributesPropertyInfo = "typing-attributes"
    type AttrOrigin EditorStateTypingAttributesPropertyInfo = EditorState
    attrGet = getEditorStateTypingAttributes
    attrSet = undefined
    attrTransfer _ = undefined
    attrConstruct = undefined
    attrClear = undefined
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList EditorState
type instance O.AttributeList EditorState = EditorStateAttributeList
type EditorStateAttributeList = ('[ '("typingAttributes", EditorStateTypingAttributesPropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
editorStateTypingAttributes :: AttrLabelProxy "typingAttributes"
editorStateTypingAttributes = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList EditorState = EditorStateSignalList
type EditorStateSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

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

foreign import ccall "webkit_editor_state_get_typing_attributes" webkit_editor_state_get_typing_attributes :: 
    Ptr EditorState ->                      -- editor_state : TInterface (Name {namespace = "WebKit2", name = "EditorState"})
    IO Word32

-- | Gets the typing attributes at the current cursor position.
-- If there is a selection, this returns the typing attributes
-- of the selected text. Note that in case of a selection,
-- typing attributes are considered active only when they are
-- present throughout the selection.
-- 
-- /Since: 2.10/
editorStateGetTypingAttributes ::
    (B.CallStack.HasCallStack, MonadIO m, IsEditorState a) =>
    a
    -- ^ /@editorState@/: a t'GI.WebKit2.Objects.EditorState.EditorState'
    -> m Word32
    -- ^ __Returns:__ a bitmask of t'GI.WebKit2.Flags.EditorTypingAttributes' flags
editorStateGetTypingAttributes :: a -> m Word32
editorStateGetTypingAttributes editorState :: a
editorState = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Ptr EditorState
editorState' <- a -> IO (Ptr EditorState)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editorState
    Word32
result <- Ptr EditorState -> IO Word32
webkit_editor_state_get_typing_attributes Ptr EditorState
editorState'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editorState
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

#if defined(ENABLE_OVERLOADING)
data EditorStateGetTypingAttributesMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsEditorState a) => O.MethodInfo EditorStateGetTypingAttributesMethodInfo a signature where
    overloadedMethod = editorStateGetTypingAttributes

#endif

-- method EditorState::is_copy_available
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "editor_state"
--           , argType =
--               TInterface Name { namespace = "WebKit2" , name = "EditorState" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #WebKitEditorState"
--                 , 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_editor_state_is_copy_available" webkit_editor_state_is_copy_available :: 
    Ptr EditorState ->                      -- editor_state : TInterface (Name {namespace = "WebKit2", name = "EditorState"})
    IO CInt

-- | Gets whether a copy command can be issued.
-- 
-- /Since: 2.20/
editorStateIsCopyAvailable ::
    (B.CallStack.HasCallStack, MonadIO m, IsEditorState a) =>
    a
    -- ^ /@editorState@/: a t'GI.WebKit2.Objects.EditorState.EditorState'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if copy is currently available
editorStateIsCopyAvailable :: a -> m Bool
editorStateIsCopyAvailable editorState :: a
editorState = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr EditorState
editorState' <- a -> IO (Ptr EditorState)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editorState
    CInt
result <- Ptr EditorState -> IO CInt
webkit_editor_state_is_copy_available Ptr EditorState
editorState'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editorState
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data EditorStateIsCopyAvailableMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsEditorState a) => O.MethodInfo EditorStateIsCopyAvailableMethodInfo a signature where
    overloadedMethod = editorStateIsCopyAvailable

#endif

-- method EditorState::is_cut_available
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "editor_state"
--           , argType =
--               TInterface Name { namespace = "WebKit2" , name = "EditorState" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #WebKitEditorState"
--                 , 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_editor_state_is_cut_available" webkit_editor_state_is_cut_available :: 
    Ptr EditorState ->                      -- editor_state : TInterface (Name {namespace = "WebKit2", name = "EditorState"})
    IO CInt

-- | Gets whether a cut command can be issued.
-- 
-- /Since: 2.20/
editorStateIsCutAvailable ::
    (B.CallStack.HasCallStack, MonadIO m, IsEditorState a) =>
    a
    -- ^ /@editorState@/: a t'GI.WebKit2.Objects.EditorState.EditorState'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if cut is currently available
editorStateIsCutAvailable :: a -> m Bool
editorStateIsCutAvailable editorState :: a
editorState = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr EditorState
editorState' <- a -> IO (Ptr EditorState)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editorState
    CInt
result <- Ptr EditorState -> IO CInt
webkit_editor_state_is_cut_available Ptr EditorState
editorState'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editorState
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data EditorStateIsCutAvailableMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsEditorState a) => O.MethodInfo EditorStateIsCutAvailableMethodInfo a signature where
    overloadedMethod = editorStateIsCutAvailable

#endif

-- method EditorState::is_paste_available
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "editor_state"
--           , argType =
--               TInterface Name { namespace = "WebKit2" , name = "EditorState" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #WebKitEditorState"
--                 , 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_editor_state_is_paste_available" webkit_editor_state_is_paste_available :: 
    Ptr EditorState ->                      -- editor_state : TInterface (Name {namespace = "WebKit2", name = "EditorState"})
    IO CInt

-- | Gets whether a paste command can be issued.
-- 
-- /Since: 2.20/
editorStateIsPasteAvailable ::
    (B.CallStack.HasCallStack, MonadIO m, IsEditorState a) =>
    a
    -- ^ /@editorState@/: a t'GI.WebKit2.Objects.EditorState.EditorState'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if paste is currently available
editorStateIsPasteAvailable :: a -> m Bool
editorStateIsPasteAvailable editorState :: a
editorState = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr EditorState
editorState' <- a -> IO (Ptr EditorState)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editorState
    CInt
result <- Ptr EditorState -> IO CInt
webkit_editor_state_is_paste_available Ptr EditorState
editorState'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editorState
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data EditorStateIsPasteAvailableMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsEditorState a) => O.MethodInfo EditorStateIsPasteAvailableMethodInfo a signature where
    overloadedMethod = editorStateIsPasteAvailable

#endif

-- method EditorState::is_redo_available
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "editor_state"
--           , argType =
--               TInterface Name { namespace = "WebKit2" , name = "EditorState" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #WebKitEditorState"
--                 , 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_editor_state_is_redo_available" webkit_editor_state_is_redo_available :: 
    Ptr EditorState ->                      -- editor_state : TInterface (Name {namespace = "WebKit2", name = "EditorState"})
    IO CInt

-- | Gets whether a redo command can be issued.
-- 
-- /Since: 2.20/
editorStateIsRedoAvailable ::
    (B.CallStack.HasCallStack, MonadIO m, IsEditorState a) =>
    a
    -- ^ /@editorState@/: a t'GI.WebKit2.Objects.EditorState.EditorState'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if redo is currently available
editorStateIsRedoAvailable :: a -> m Bool
editorStateIsRedoAvailable editorState :: a
editorState = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr EditorState
editorState' <- a -> IO (Ptr EditorState)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editorState
    CInt
result <- Ptr EditorState -> IO CInt
webkit_editor_state_is_redo_available Ptr EditorState
editorState'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editorState
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data EditorStateIsRedoAvailableMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsEditorState a) => O.MethodInfo EditorStateIsRedoAvailableMethodInfo a signature where
    overloadedMethod = editorStateIsRedoAvailable

#endif

-- method EditorState::is_undo_available
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "editor_state"
--           , argType =
--               TInterface Name { namespace = "WebKit2" , name = "EditorState" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #WebKitEditorState"
--                 , 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_editor_state_is_undo_available" webkit_editor_state_is_undo_available :: 
    Ptr EditorState ->                      -- editor_state : TInterface (Name {namespace = "WebKit2", name = "EditorState"})
    IO CInt

-- | Gets whether an undo command can be issued.
-- 
-- /Since: 2.20/
editorStateIsUndoAvailable ::
    (B.CallStack.HasCallStack, MonadIO m, IsEditorState a) =>
    a
    -- ^ /@editorState@/: a t'GI.WebKit2.Objects.EditorState.EditorState'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if undo is currently available
editorStateIsUndoAvailable :: a -> m Bool
editorStateIsUndoAvailable editorState :: a
editorState = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr EditorState
editorState' <- a -> IO (Ptr EditorState)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editorState
    CInt
result <- Ptr EditorState -> IO CInt
webkit_editor_state_is_undo_available Ptr EditorState
editorState'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editorState
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data EditorStateIsUndoAvailableMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsEditorState a) => O.MethodInfo EditorStateIsUndoAvailableMethodInfo a signature where
    overloadedMethod = editorStateIsUndoAvailable

#endif