module GI.Atk.Interfaces.Selection
    ( 
    Selection(..)                           ,
    noSelection                             ,
    IsSelection                             ,
    toSelection                             ,
 
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    SelectionAddSelectionMethodInfo         ,
#endif
    selectionAddSelection                   ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    SelectionClearSelectionMethodInfo       ,
#endif
    selectionClearSelection                 ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    SelectionGetSelectionCountMethodInfo    ,
#endif
    selectionGetSelectionCount              ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    SelectionIsChildSelectedMethodInfo      ,
#endif
    selectionIsChildSelected                ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    SelectionRefSelectionMethodInfo         ,
#endif
    selectionRefSelection                   ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    SelectionRemoveSelectionMethodInfo      ,
#endif
    selectionRemoveSelection                ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    SelectionSelectAllSelectionMethodInfo   ,
#endif
    selectionSelectAllSelection             ,
 
    C_SelectionSelectionChangedCallback     ,
    SelectionSelectionChangedCallback       ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    SelectionSelectionChangedSignalInfo     ,
#endif
    afterSelectionSelectionChanged          ,
    genClosure_SelectionSelectionChanged    ,
    mk_SelectionSelectionChangedCallback    ,
    noSelectionSelectionChangedCallback     ,
    onSelectionSelectionChanged             ,
    wrap_SelectionSelectionChangedCallback  ,
    ) 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.Atk.Objects.Object as Atk.Object
import qualified GI.GObject.Objects.Object as GObject.Object
newtype Selection = Selection (ManagedPtr Selection)
noSelection :: Maybe Selection
noSelection = Nothing
type SelectionSelectionChangedCallback =
    IO ()
noSelectionSelectionChangedCallback :: Maybe SelectionSelectionChangedCallback
noSelectionSelectionChangedCallback = Nothing
type C_SelectionSelectionChangedCallback =
    Ptr () ->                               
    Ptr () ->                               
    IO ()
foreign import ccall "wrapper"
    mk_SelectionSelectionChangedCallback :: C_SelectionSelectionChangedCallback -> IO (FunPtr C_SelectionSelectionChangedCallback)
genClosure_SelectionSelectionChanged :: SelectionSelectionChangedCallback -> IO Closure
genClosure_SelectionSelectionChanged cb = do
    let cb' = wrap_SelectionSelectionChangedCallback cb
    mk_SelectionSelectionChangedCallback cb' >>= newCClosure
wrap_SelectionSelectionChangedCallback ::
    SelectionSelectionChangedCallback ->
    Ptr () ->
    Ptr () ->
    IO ()
wrap_SelectionSelectionChangedCallback _cb _ _ = do
    _cb 
onSelectionSelectionChanged :: (IsSelection a, MonadIO m) => a -> SelectionSelectionChangedCallback -> m SignalHandlerId
onSelectionSelectionChanged obj cb = liftIO $ do
    let cb' = wrap_SelectionSelectionChangedCallback cb
    cb'' <- mk_SelectionSelectionChangedCallback cb'
    connectSignalFunPtr obj "selection-changed" cb'' SignalConnectBefore
afterSelectionSelectionChanged :: (IsSelection a, MonadIO m) => a -> SelectionSelectionChangedCallback -> m SignalHandlerId
afterSelectionSelectionChanged obj cb = liftIO $ do
    let cb' = wrap_SelectionSelectionChangedCallback cb
    cb'' <- mk_SelectionSelectionChangedCallback cb'
    connectSignalFunPtr obj "selection-changed" cb'' SignalConnectAfter
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SelectionSelectionChangedSignalInfo
instance SignalInfo SelectionSelectionChangedSignalInfo where
    type HaskellCallbackType SelectionSelectionChangedSignalInfo = SelectionSelectionChangedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_SelectionSelectionChangedCallback cb
        cb'' <- mk_SelectionSelectionChangedCallback cb'
        connectSignalFunPtr obj "selection-changed" cb'' connectMode
type instance O.SignalList Selection = SelectionSignalList
type SelectionSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo), '("selectionChanged", SelectionSelectionChangedSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "atk_selection_get_type"
    c_atk_selection_get_type :: IO GType
instance GObject Selection where
    gobjectType _ = c_atk_selection_get_type
    
class GObject o => IsSelection o
#if MIN_VERSION_base(4,9,0)
instance  (GObject a, O.UnknownAncestorError Selection a) =>
    IsSelection a
#endif
instance IsSelection Selection
instance GObject.Object.IsObject Selection
toSelection :: (MonadIO m, IsSelection o) => o -> m Selection
toSelection = liftIO . unsafeCastTo Selection
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList Selection
type instance O.AttributeList Selection = SelectionAttributeList
type SelectionAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveSelectionMethod (t :: Symbol) (o :: *) :: * where
    ResolveSelectionMethod "addSelection" o = SelectionAddSelectionMethodInfo
    ResolveSelectionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveSelectionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveSelectionMethod "clearSelection" o = SelectionClearSelectionMethodInfo
    ResolveSelectionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveSelectionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveSelectionMethod "isChildSelected" o = SelectionIsChildSelectedMethodInfo
    ResolveSelectionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveSelectionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveSelectionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveSelectionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveSelectionMethod "refSelection" o = SelectionRefSelectionMethodInfo
    ResolveSelectionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveSelectionMethod "removeSelection" o = SelectionRemoveSelectionMethodInfo
    ResolveSelectionMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveSelectionMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveSelectionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveSelectionMethod "selectAllSelection" o = SelectionSelectAllSelectionMethodInfo
    ResolveSelectionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveSelectionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveSelectionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveSelectionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveSelectionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveSelectionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveSelectionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveSelectionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveSelectionMethod "getSelectionCount" o = SelectionGetSelectionCountMethodInfo
    ResolveSelectionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveSelectionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveSelectionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSelectionMethod t Selection, O.MethodInfo info Selection p) => O.IsLabelProxy t (Selection -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveSelectionMethod t Selection, O.MethodInfo info Selection p) => O.IsLabel t (Selection -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif
foreign import ccall "atk_selection_add_selection" atk_selection_add_selection :: 
    Ptr Selection ->                        
    Int32 ->                                
    IO CInt
selectionAddSelection ::
    (B.CallStack.HasCallStack, MonadIO m, IsSelection a) =>
    a
    
    -> Int32
    
    -> m Bool
    
selectionAddSelection selection i = liftIO $ do
    selection' <- unsafeManagedPtrCastPtr selection
    result <- atk_selection_add_selection selection' i
    let result' = (/= 0) result
    touchManagedPtr selection
    return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SelectionAddSelectionMethodInfo
instance (signature ~ (Int32 -> m Bool), MonadIO m, IsSelection a) => O.MethodInfo SelectionAddSelectionMethodInfo a signature where
    overloadedMethod _ = selectionAddSelection
#endif
foreign import ccall "atk_selection_clear_selection" atk_selection_clear_selection :: 
    Ptr Selection ->                        
    IO CInt
selectionClearSelection ::
    (B.CallStack.HasCallStack, MonadIO m, IsSelection a) =>
    a
    
    -> m Bool
    
selectionClearSelection selection = liftIO $ do
    selection' <- unsafeManagedPtrCastPtr selection
    result <- atk_selection_clear_selection selection'
    let result' = (/= 0) result
    touchManagedPtr selection
    return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SelectionClearSelectionMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSelection a) => O.MethodInfo SelectionClearSelectionMethodInfo a signature where
    overloadedMethod _ = selectionClearSelection
#endif
foreign import ccall "atk_selection_get_selection_count" atk_selection_get_selection_count :: 
    Ptr Selection ->                        
    IO Int32
selectionGetSelectionCount ::
    (B.CallStack.HasCallStack, MonadIO m, IsSelection a) =>
    a
    
    -> m Int32
    
selectionGetSelectionCount selection = liftIO $ do
    selection' <- unsafeManagedPtrCastPtr selection
    result <- atk_selection_get_selection_count selection'
    touchManagedPtr selection
    return result
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SelectionGetSelectionCountMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsSelection a) => O.MethodInfo SelectionGetSelectionCountMethodInfo a signature where
    overloadedMethod _ = selectionGetSelectionCount
#endif
foreign import ccall "atk_selection_is_child_selected" atk_selection_is_child_selected :: 
    Ptr Selection ->                        
    Int32 ->                                
    IO CInt
selectionIsChildSelected ::
    (B.CallStack.HasCallStack, MonadIO m, IsSelection a) =>
    a
    
    -> Int32
    
    -> m Bool
    
selectionIsChildSelected selection i = liftIO $ do
    selection' <- unsafeManagedPtrCastPtr selection
    result <- atk_selection_is_child_selected selection' i
    let result' = (/= 0) result
    touchManagedPtr selection
    return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SelectionIsChildSelectedMethodInfo
instance (signature ~ (Int32 -> m Bool), MonadIO m, IsSelection a) => O.MethodInfo SelectionIsChildSelectedMethodInfo a signature where
    overloadedMethod _ = selectionIsChildSelected
#endif
foreign import ccall "atk_selection_ref_selection" atk_selection_ref_selection :: 
    Ptr Selection ->                        
    Int32 ->                                
    IO (Ptr Atk.Object.Object)
selectionRefSelection ::
    (B.CallStack.HasCallStack, MonadIO m, IsSelection a) =>
    a
    
    -> Int32
    
    -> m (Maybe Atk.Object.Object)
    
selectionRefSelection selection i = liftIO $ do
    selection' <- unsafeManagedPtrCastPtr selection
    result <- atk_selection_ref_selection selection' i
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapObject Atk.Object.Object) result'
        return result''
    touchManagedPtr selection
    return maybeResult
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SelectionRefSelectionMethodInfo
instance (signature ~ (Int32 -> m (Maybe Atk.Object.Object)), MonadIO m, IsSelection a) => O.MethodInfo SelectionRefSelectionMethodInfo a signature where
    overloadedMethod _ = selectionRefSelection
#endif
foreign import ccall "atk_selection_remove_selection" atk_selection_remove_selection :: 
    Ptr Selection ->                        
    Int32 ->                                
    IO CInt
selectionRemoveSelection ::
    (B.CallStack.HasCallStack, MonadIO m, IsSelection a) =>
    a
    
    -> Int32
    
    -> m Bool
    
selectionRemoveSelection selection i = liftIO $ do
    selection' <- unsafeManagedPtrCastPtr selection
    result <- atk_selection_remove_selection selection' i
    let result' = (/= 0) result
    touchManagedPtr selection
    return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SelectionRemoveSelectionMethodInfo
instance (signature ~ (Int32 -> m Bool), MonadIO m, IsSelection a) => O.MethodInfo SelectionRemoveSelectionMethodInfo a signature where
    overloadedMethod _ = selectionRemoveSelection
#endif
foreign import ccall "atk_selection_select_all_selection" atk_selection_select_all_selection :: 
    Ptr Selection ->                        
    IO CInt
selectionSelectAllSelection ::
    (B.CallStack.HasCallStack, MonadIO m, IsSelection a) =>
    a
    
    -> m Bool
    
selectionSelectAllSelection selection = liftIO $ do
    selection' <- unsafeManagedPtrCastPtr selection
    result <- atk_selection_select_all_selection selection'
    let result' = (/= 0) result
    touchManagedPtr selection
    return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SelectionSelectAllSelectionMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSelection a) => O.MethodInfo SelectionSelectAllSelectionMethodInfo a signature where
    overloadedMethod _ = selectionSelectAllSelection
#endif