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

module GI.Gtk.Interfaces.TreeDragDest
    ( 

-- * Exported types
    TreeDragDest(..)                        ,
    noTreeDragDest                          ,
    TreeDragDestK                           ,


 -- * Methods
-- ** treeDragDestDragDataReceived
    treeDragDestDragDataReceived            ,


-- ** treeDragDestRowDropPossible
    treeDragDestRowDropPossible             ,




    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.Gtk.Types
import GI.Gtk.Callbacks

-- interface TreeDragDest 

newtype TreeDragDest = TreeDragDest (ForeignPtr TreeDragDest)
noTreeDragDest :: Maybe TreeDragDest
noTreeDragDest = Nothing

type instance AttributeList TreeDragDest = TreeDragDestAttributeList
type TreeDragDestAttributeList = ('[ ] :: [(Symbol, *)])

type instance SignalList TreeDragDest = TreeDragDestSignalList
type TreeDragDestSignalList = ('[ ] :: [(Symbol, *)])

class ForeignPtrNewtype a => TreeDragDestK a
instance (ForeignPtrNewtype o, IsDescendantOf TreeDragDest o) => TreeDragDestK o
type instance ParentTypes TreeDragDest = TreeDragDestParentTypes
type TreeDragDestParentTypes = '[]

-- method TreeDragDest::drag_data_received
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "TreeDragDest", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "dest", argType = TInterface "Gtk" "TreePath", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "selection_data", argType = TInterface "Gtk" "SelectionData", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "TreeDragDest", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "dest", argType = TInterface "Gtk" "TreePath", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "selection_data", argType = TInterface "Gtk" "SelectionData", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : False
-- Skip return : False

foreign import ccall "gtk_tree_drag_dest_drag_data_received" gtk_tree_drag_dest_drag_data_received :: 
    Ptr TreeDragDest ->                     -- _obj : TInterface "Gtk" "TreeDragDest"
    Ptr TreePath ->                         -- dest : TInterface "Gtk" "TreePath"
    Ptr SelectionData ->                    -- selection_data : TInterface "Gtk" "SelectionData"
    IO CInt


treeDragDestDragDataReceived ::
    (MonadIO m, TreeDragDestK a) =>
    a ->                                    -- _obj
    TreePath ->                             -- dest
    SelectionData ->                        -- selection_data
    m Bool
treeDragDestDragDataReceived _obj dest selection_data = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let dest' = unsafeManagedPtrGetPtr dest
    let selection_data' = unsafeManagedPtrGetPtr selection_data
    result <- gtk_tree_drag_dest_drag_data_received _obj' dest' selection_data'
    let result' = (/= 0) result
    touchManagedPtr _obj
    touchManagedPtr dest
    touchManagedPtr selection_data
    return result'

-- method TreeDragDest::row_drop_possible
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "TreeDragDest", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "dest_path", argType = TInterface "Gtk" "TreePath", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "selection_data", argType = TInterface "Gtk" "SelectionData", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "TreeDragDest", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "dest_path", argType = TInterface "Gtk" "TreePath", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "selection_data", argType = TInterface "Gtk" "SelectionData", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : False
-- Skip return : False

foreign import ccall "gtk_tree_drag_dest_row_drop_possible" gtk_tree_drag_dest_row_drop_possible :: 
    Ptr TreeDragDest ->                     -- _obj : TInterface "Gtk" "TreeDragDest"
    Ptr TreePath ->                         -- dest_path : TInterface "Gtk" "TreePath"
    Ptr SelectionData ->                    -- selection_data : TInterface "Gtk" "SelectionData"
    IO CInt


treeDragDestRowDropPossible ::
    (MonadIO m, TreeDragDestK a) =>
    a ->                                    -- _obj
    TreePath ->                             -- dest_path
    SelectionData ->                        -- selection_data
    m Bool
treeDragDestRowDropPossible _obj dest_path selection_data = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let dest_path' = unsafeManagedPtrGetPtr dest_path
    let selection_data' = unsafeManagedPtrGetPtr selection_data
    result <- gtk_tree_drag_dest_row_drop_possible _obj' dest_path' selection_data'
    let result' = (/= 0) result
    touchManagedPtr _obj
    touchManagedPtr dest_path
    touchManagedPtr selection_data
    return result'