{- |
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.Actionable
    ( 

-- * Exported types
    Actionable(..)                          ,
    noActionable                            ,
    ActionableK                             ,
    toActionable                            ,


 -- * Methods
-- ** actionableGetActionName
    actionableGetActionName                 ,


-- ** actionableGetActionTargetValue
    actionableGetActionTargetValue          ,


-- ** actionableSetActionName
    actionableSetActionName                 ,


-- ** actionableSetActionTargetValue
    actionableSetActionTargetValue          ,


-- ** actionableSetDetailedActionName
    actionableSetDetailedActionName         ,




 -- * Properties
-- ** ActionName
    ActionableActionNamePropertyInfo        ,
    constructActionableActionName           ,
    getActionableActionName                 ,
    setActionableActionName                 ,


-- ** ActionTarget
    ActionableActionTargetPropertyInfo      ,
    constructActionableActionTarget         ,
    getActionableActionTarget               ,
    setActionableActionTarget               ,




    ) 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
import qualified GI.GObject as GObject

-- interface Actionable 

newtype Actionable = Actionable (ForeignPtr Actionable)
noActionable :: Maybe Actionable
noActionable = Nothing

-- VVV Prop "action-name"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]

getActionableActionName :: (MonadIO m, ActionableK o) => o -> m T.Text
getActionableActionName obj = liftIO $ getObjectPropertyString obj "action-name"

setActionableActionName :: (MonadIO m, ActionableK o) => o -> T.Text -> m ()
setActionableActionName obj val = liftIO $ setObjectPropertyString obj "action-name" val

constructActionableActionName :: T.Text -> IO ([Char], GValue)
constructActionableActionName val = constructObjectPropertyString "action-name" val

data ActionableActionNamePropertyInfo
instance AttrInfo ActionableActionNamePropertyInfo where
    type AttrAllowedOps ActionableActionNamePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint ActionableActionNamePropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint ActionableActionNamePropertyInfo = ActionableK
    type AttrGetType ActionableActionNamePropertyInfo = T.Text
    type AttrLabel ActionableActionNamePropertyInfo = "Actionable::action-name"
    attrGet _ = getActionableActionName
    attrSet _ = setActionableActionName
    attrConstruct _ = constructActionableActionName

-- VVV Prop "action-target"
   -- Type: TVariant
   -- Flags: [PropertyReadable,PropertyWritable]

getActionableActionTarget :: (MonadIO m, ActionableK o) => o -> m GVariant
getActionableActionTarget obj = liftIO $ getObjectPropertyVariant obj "action-target"

setActionableActionTarget :: (MonadIO m, ActionableK o) => o -> GVariant -> m ()
setActionableActionTarget obj val = liftIO $ setObjectPropertyVariant obj "action-target" val

constructActionableActionTarget :: GVariant -> IO ([Char], GValue)
constructActionableActionTarget val = constructObjectPropertyVariant "action-target" val

data ActionableActionTargetPropertyInfo
instance AttrInfo ActionableActionTargetPropertyInfo where
    type AttrAllowedOps ActionableActionTargetPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint ActionableActionTargetPropertyInfo = (~) GVariant
    type AttrBaseTypeConstraint ActionableActionTargetPropertyInfo = ActionableK
    type AttrGetType ActionableActionTargetPropertyInfo = GVariant
    type AttrLabel ActionableActionTargetPropertyInfo = "Actionable::action-target"
    attrGet _ = getActionableActionTarget
    attrSet _ = setActionableActionTarget
    attrConstruct _ = constructActionableActionTarget

type instance AttributeList Actionable = ActionableAttributeList
type ActionableAttributeList = ('[ '("action-name", ActionableActionNamePropertyInfo), '("action-target", ActionableActionTargetPropertyInfo), '("app-paintable", WidgetAppPaintablePropertyInfo), '("can-default", WidgetCanDefaultPropertyInfo), '("can-focus", WidgetCanFocusPropertyInfo), '("composite-child", WidgetCompositeChildPropertyInfo), '("double-buffered", WidgetDoubleBufferedPropertyInfo), '("events", WidgetEventsPropertyInfo), '("expand", WidgetExpandPropertyInfo), '("halign", WidgetHalignPropertyInfo), '("has-default", WidgetHasDefaultPropertyInfo), '("has-focus", WidgetHasFocusPropertyInfo), '("has-tooltip", WidgetHasTooltipPropertyInfo), '("height-request", WidgetHeightRequestPropertyInfo), '("hexpand", WidgetHexpandPropertyInfo), '("hexpand-set", WidgetHexpandSetPropertyInfo), '("is-focus", WidgetIsFocusPropertyInfo), '("margin", WidgetMarginPropertyInfo), '("margin-bottom", WidgetMarginBottomPropertyInfo), '("margin-end", WidgetMarginEndPropertyInfo), '("margin-left", WidgetMarginLeftPropertyInfo), '("margin-right", WidgetMarginRightPropertyInfo), '("margin-start", WidgetMarginStartPropertyInfo), '("margin-top", WidgetMarginTopPropertyInfo), '("name", WidgetNamePropertyInfo), '("no-show-all", WidgetNoShowAllPropertyInfo), '("opacity", WidgetOpacityPropertyInfo), '("parent", WidgetParentPropertyInfo), '("receives-default", WidgetReceivesDefaultPropertyInfo), '("scale-factor", WidgetScaleFactorPropertyInfo), '("sensitive", WidgetSensitivePropertyInfo), '("style", WidgetStylePropertyInfo), '("tooltip-markup", WidgetTooltipMarkupPropertyInfo), '("tooltip-text", WidgetTooltipTextPropertyInfo), '("valign", WidgetValignPropertyInfo), '("vexpand", WidgetVexpandPropertyInfo), '("vexpand-set", WidgetVexpandSetPropertyInfo), '("visible", WidgetVisiblePropertyInfo), '("width-request", WidgetWidthRequestPropertyInfo), '("window", WidgetWindowPropertyInfo)] :: [(Symbol, *)])

type instance SignalList Actionable = ActionableSignalList
type ActionableSignalList = ('[ '("accel-closures-changed", WidgetAccelClosuresChangedSignalInfo), '("button-press-event", WidgetButtonPressEventSignalInfo), '("button-release-event", WidgetButtonReleaseEventSignalInfo), '("can-activate-accel", WidgetCanActivateAccelSignalInfo), '("child-notify", WidgetChildNotifySignalInfo), '("composited-changed", WidgetCompositedChangedSignalInfo), '("configure-event", WidgetConfigureEventSignalInfo), '("damage-event", WidgetDamageEventSignalInfo), '("delete-event", WidgetDeleteEventSignalInfo), '("destroy", WidgetDestroySignalInfo), '("destroy-event", WidgetDestroyEventSignalInfo), '("direction-changed", WidgetDirectionChangedSignalInfo), '("drag-begin", WidgetDragBeginSignalInfo), '("drag-data-delete", WidgetDragDataDeleteSignalInfo), '("drag-data-get", WidgetDragDataGetSignalInfo), '("drag-data-received", WidgetDragDataReceivedSignalInfo), '("drag-drop", WidgetDragDropSignalInfo), '("drag-end", WidgetDragEndSignalInfo), '("drag-failed", WidgetDragFailedSignalInfo), '("drag-leave", WidgetDragLeaveSignalInfo), '("drag-motion", WidgetDragMotionSignalInfo), '("draw", WidgetDrawSignalInfo), '("enter-notify-event", WidgetEnterNotifyEventSignalInfo), '("event", WidgetEventSignalInfo), '("event-after", WidgetEventAfterSignalInfo), '("focus", WidgetFocusSignalInfo), '("focus-in-event", WidgetFocusInEventSignalInfo), '("focus-out-event", WidgetFocusOutEventSignalInfo), '("grab-broken-event", WidgetGrabBrokenEventSignalInfo), '("grab-focus", WidgetGrabFocusSignalInfo), '("grab-notify", WidgetGrabNotifySignalInfo), '("hide", WidgetHideSignalInfo), '("hierarchy-changed", WidgetHierarchyChangedSignalInfo), '("key-press-event", WidgetKeyPressEventSignalInfo), '("key-release-event", WidgetKeyReleaseEventSignalInfo), '("keynav-failed", WidgetKeynavFailedSignalInfo), '("leave-notify-event", WidgetLeaveNotifyEventSignalInfo), '("map", WidgetMapSignalInfo), '("map-event", WidgetMapEventSignalInfo), '("mnemonic-activate", WidgetMnemonicActivateSignalInfo), '("motion-notify-event", WidgetMotionNotifyEventSignalInfo), '("move-focus", WidgetMoveFocusSignalInfo), '("notify", GObject.ObjectNotifySignalInfo), '("parent-set", WidgetParentSetSignalInfo), '("popup-menu", WidgetPopupMenuSignalInfo), '("property-notify-event", WidgetPropertyNotifyEventSignalInfo), '("proximity-in-event", WidgetProximityInEventSignalInfo), '("proximity-out-event", WidgetProximityOutEventSignalInfo), '("query-tooltip", WidgetQueryTooltipSignalInfo), '("realize", WidgetRealizeSignalInfo), '("screen-changed", WidgetScreenChangedSignalInfo), '("scroll-event", WidgetScrollEventSignalInfo), '("selection-clear-event", WidgetSelectionClearEventSignalInfo), '("selection-get", WidgetSelectionGetSignalInfo), '("selection-notify-event", WidgetSelectionNotifyEventSignalInfo), '("selection-received", WidgetSelectionReceivedSignalInfo), '("selection-request-event", WidgetSelectionRequestEventSignalInfo), '("show", WidgetShowSignalInfo), '("show-help", WidgetShowHelpSignalInfo), '("size-allocate", WidgetSizeAllocateSignalInfo), '("state-changed", WidgetStateChangedSignalInfo), '("state-flags-changed", WidgetStateFlagsChangedSignalInfo), '("style-set", WidgetStyleSetSignalInfo), '("style-updated", WidgetStyleUpdatedSignalInfo), '("touch-event", WidgetTouchEventSignalInfo), '("unmap", WidgetUnmapSignalInfo), '("unmap-event", WidgetUnmapEventSignalInfo), '("unrealize", WidgetUnrealizeSignalInfo), '("visibility-notify-event", WidgetVisibilityNotifyEventSignalInfo), '("window-state-event", WidgetWindowStateEventSignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])

foreign import ccall "gtk_actionable_get_type"
    c_gtk_actionable_get_type :: IO GType

type instance ParentTypes Actionable = ActionableParentTypes
type ActionableParentTypes = '[Widget, GObject.Object]

instance GObject Actionable where
    gobjectIsInitiallyUnowned _ = True
    gobjectType _ = c_gtk_actionable_get_type
    

class GObject o => ActionableK o
instance (GObject o, IsDescendantOf Actionable o) => ActionableK o

toActionable :: ActionableK o => o -> IO Actionable
toActionable = unsafeCastTo Actionable

-- method Actionable::get_action_name
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Actionable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Actionable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TUTF8
-- throws : False
-- Skip return : False

foreign import ccall "gtk_actionable_get_action_name" gtk_actionable_get_action_name :: 
    Ptr Actionable ->                       -- _obj : TInterface "Gtk" "Actionable"
    IO CString


actionableGetActionName ::
    (MonadIO m, ActionableK a) =>
    a ->                                    -- _obj
    m T.Text
actionableGetActionName _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- gtk_actionable_get_action_name _obj'
    checkUnexpectedReturnNULL "gtk_actionable_get_action_name" result
    result' <- cstringToText result
    touchManagedPtr _obj
    return result'

-- method Actionable::get_action_target_value
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Actionable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Actionable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TVariant
-- throws : False
-- Skip return : False

foreign import ccall "gtk_actionable_get_action_target_value" gtk_actionable_get_action_target_value :: 
    Ptr Actionable ->                       -- _obj : TInterface "Gtk" "Actionable"
    IO (Ptr GVariant)


actionableGetActionTargetValue ::
    (MonadIO m, ActionableK a) =>
    a ->                                    -- _obj
    m GVariant
actionableGetActionTargetValue _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- gtk_actionable_get_action_target_value _obj'
    checkUnexpectedReturnNULL "gtk_actionable_get_action_target_value" result
    result' <- newGVariantFromPtr result
    touchManagedPtr _obj
    return result'

-- method Actionable::set_action_name
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Actionable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "action_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Actionable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "action_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_actionable_set_action_name" gtk_actionable_set_action_name :: 
    Ptr Actionable ->                       -- _obj : TInterface "Gtk" "Actionable"
    CString ->                              -- action_name : TBasicType TUTF8
    IO ()


actionableSetActionName ::
    (MonadIO m, ActionableK a) =>
    a ->                                    -- _obj
    T.Text ->                               -- action_name
    m ()
actionableSetActionName _obj action_name = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    action_name' <- textToCString action_name
    gtk_actionable_set_action_name _obj' action_name'
    touchManagedPtr _obj
    freeMem action_name'
    return ()

-- method Actionable::set_action_target_value
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Actionable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "target_value", argType = TVariant, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Actionable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "target_value", argType = TVariant, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_actionable_set_action_target_value" gtk_actionable_set_action_target_value :: 
    Ptr Actionable ->                       -- _obj : TInterface "Gtk" "Actionable"
    Ptr GVariant ->                         -- target_value : TVariant
    IO ()


actionableSetActionTargetValue ::
    (MonadIO m, ActionableK a) =>
    a ->                                    -- _obj
    GVariant ->                             -- target_value
    m ()
actionableSetActionTargetValue _obj target_value = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let target_value' = unsafeManagedPtrGetPtr target_value
    gtk_actionable_set_action_target_value _obj' target_value'
    touchManagedPtr _obj
    return ()

-- method Actionable::set_detailed_action_name
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Actionable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "detailed_action_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Actionable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "detailed_action_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_actionable_set_detailed_action_name" gtk_actionable_set_detailed_action_name :: 
    Ptr Actionable ->                       -- _obj : TInterface "Gtk" "Actionable"
    CString ->                              -- detailed_action_name : TBasicType TUTF8
    IO ()


actionableSetDetailedActionName ::
    (MonadIO m, ActionableK a) =>
    a ->                                    -- _obj
    T.Text ->                               -- detailed_action_name
    m ()
actionableSetDetailedActionName _obj detailed_action_name = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    detailed_action_name' <- textToCString detailed_action_name
    gtk_actionable_set_detailed_action_name _obj' detailed_action_name'
    touchManagedPtr _obj
    freeMem detailed_action_name'
    return ()