{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- A t'GI.Gtk.Objects.ToggleAction.ToggleAction' corresponds roughly to a t'GI.Gtk.Objects.CheckMenuItem.CheckMenuItem'. It has an
-- “active” state specifying whether the action has been checked or not.

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

module GI.Gtk.Objects.ToggleAction
    ( 

-- * Exported types
    ToggleAction(..)                        ,
    IsToggleAction                          ,
    toToggleAction                          ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [activate]("GI.Gtk.Objects.Action#g:method:activate"), [addChild]("GI.Gtk.Interfaces.Buildable#g:method:addChild"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [blockActivate]("GI.Gtk.Objects.Action#g:method:blockActivate"), [connectAccelerator]("GI.Gtk.Objects.Action#g:method:connectAccelerator"), [constructChild]("GI.Gtk.Interfaces.Buildable#g:method:constructChild"), [createIcon]("GI.Gtk.Objects.Action#g:method:createIcon"), [createMenu]("GI.Gtk.Objects.Action#g:method:createMenu"), [createMenuItem]("GI.Gtk.Objects.Action#g:method:createMenuItem"), [createToolItem]("GI.Gtk.Objects.Action#g:method:createToolItem"), [customFinished]("GI.Gtk.Interfaces.Buildable#g:method:customFinished"), [customTagEnd]("GI.Gtk.Interfaces.Buildable#g:method:customTagEnd"), [customTagStart]("GI.Gtk.Interfaces.Buildable#g:method:customTagStart"), [disconnectAccelerator]("GI.Gtk.Objects.Action#g:method:disconnectAccelerator"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [isSensitive]("GI.Gtk.Objects.Action#g:method:isSensitive"), [isVisible]("GI.Gtk.Objects.Action#g:method:isVisible"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [parserFinished]("GI.Gtk.Interfaces.Buildable#g:method:parserFinished"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [toggled]("GI.Gtk.Objects.ToggleAction#g:method:toggled"), [unblockActivate]("GI.Gtk.Objects.Action#g:method:unblockActivate"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getAccelClosure]("GI.Gtk.Objects.Action#g:method:getAccelClosure"), [getAccelPath]("GI.Gtk.Objects.Action#g:method:getAccelPath"), [getActive]("GI.Gtk.Objects.ToggleAction#g:method:getActive"), [getAlwaysShowImage]("GI.Gtk.Objects.Action#g:method:getAlwaysShowImage"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getDrawAsRadio]("GI.Gtk.Objects.ToggleAction#g:method:getDrawAsRadio"), [getGicon]("GI.Gtk.Objects.Action#g:method:getGicon"), [getIconName]("GI.Gtk.Objects.Action#g:method:getIconName"), [getInternalChild]("GI.Gtk.Interfaces.Buildable#g:method:getInternalChild"), [getIsImportant]("GI.Gtk.Objects.Action#g:method:getIsImportant"), [getLabel]("GI.Gtk.Objects.Action#g:method:getLabel"), [getName]("GI.Gtk.Objects.Action#g:method:getName"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getProxies]("GI.Gtk.Objects.Action#g:method:getProxies"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getSensitive]("GI.Gtk.Objects.Action#g:method:getSensitive"), [getShortLabel]("GI.Gtk.Objects.Action#g:method:getShortLabel"), [getStockId]("GI.Gtk.Objects.Action#g:method:getStockId"), [getTooltip]("GI.Gtk.Objects.Action#g:method:getTooltip"), [getVisible]("GI.Gtk.Objects.Action#g:method:getVisible"), [getVisibleHorizontal]("GI.Gtk.Objects.Action#g:method:getVisibleHorizontal"), [getVisibleVertical]("GI.Gtk.Objects.Action#g:method:getVisibleVertical").
-- 
-- ==== Setters
-- [setAccelGroup]("GI.Gtk.Objects.Action#g:method:setAccelGroup"), [setAccelPath]("GI.Gtk.Objects.Action#g:method:setAccelPath"), [setActive]("GI.Gtk.Objects.ToggleAction#g:method:setActive"), [setAlwaysShowImage]("GI.Gtk.Objects.Action#g:method:setAlwaysShowImage"), [setBuildableProperty]("GI.Gtk.Interfaces.Buildable#g:method:setBuildableProperty"), [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setDrawAsRadio]("GI.Gtk.Objects.ToggleAction#g:method:setDrawAsRadio"), [setGicon]("GI.Gtk.Objects.Action#g:method:setGicon"), [setIconName]("GI.Gtk.Objects.Action#g:method:setIconName"), [setIsImportant]("GI.Gtk.Objects.Action#g:method:setIsImportant"), [setLabel]("GI.Gtk.Objects.Action#g:method:setLabel"), [setName]("GI.Gtk.Interfaces.Buildable#g:method:setName"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty"), [setSensitive]("GI.Gtk.Objects.Action#g:method:setSensitive"), [setShortLabel]("GI.Gtk.Objects.Action#g:method:setShortLabel"), [setStockId]("GI.Gtk.Objects.Action#g:method:setStockId"), [setTooltip]("GI.Gtk.Objects.Action#g:method:setTooltip"), [setVisible]("GI.Gtk.Objects.Action#g:method:setVisible"), [setVisibleHorizontal]("GI.Gtk.Objects.Action#g:method:setVisibleHorizontal"), [setVisibleVertical]("GI.Gtk.Objects.Action#g:method:setVisibleVertical").

#if defined(ENABLE_OVERLOADING)
    ResolveToggleActionMethod               ,
#endif

-- ** getActive #method:getActive#

#if defined(ENABLE_OVERLOADING)
    ToggleActionGetActiveMethodInfo         ,
#endif
    toggleActionGetActive                   ,


-- ** getDrawAsRadio #method:getDrawAsRadio#

#if defined(ENABLE_OVERLOADING)
    ToggleActionGetDrawAsRadioMethodInfo    ,
#endif
    toggleActionGetDrawAsRadio              ,


-- ** new #method:new#

    toggleActionNew                         ,


-- ** setActive #method:setActive#

#if defined(ENABLE_OVERLOADING)
    ToggleActionSetActiveMethodInfo         ,
#endif
    toggleActionSetActive                   ,


-- ** setDrawAsRadio #method:setDrawAsRadio#

#if defined(ENABLE_OVERLOADING)
    ToggleActionSetDrawAsRadioMethodInfo    ,
#endif
    toggleActionSetDrawAsRadio              ,


-- ** toggled #method:toggled#

#if defined(ENABLE_OVERLOADING)
    ToggleActionToggledMethodInfo           ,
#endif
    toggleActionToggled                     ,




 -- * Properties


-- ** active #attr:active#
-- | Whether the toggle action should be active.
-- 
-- /Since: 2.10/

#if defined(ENABLE_OVERLOADING)
    ToggleActionActivePropertyInfo          ,
#endif
    constructToggleActionActive             ,
    getToggleActionActive                   ,
    setToggleActionActive                   ,
#if defined(ENABLE_OVERLOADING)
    toggleActionActive                      ,
#endif


-- ** drawAsRadio #attr:drawAsRadio#
-- | Whether the proxies for this action look like radio action proxies.
-- 
-- This is an appearance property and thus only applies if
-- t'GI.Gtk.Interfaces.Activatable.Activatable':@/use-action-appearance/@ is 'P.True'.

#if defined(ENABLE_OVERLOADING)
    ToggleActionDrawAsRadioPropertyInfo     ,
#endif
    constructToggleActionDrawAsRadio        ,
    getToggleActionDrawAsRadio              ,
    setToggleActionDrawAsRadio              ,
#if defined(ENABLE_OVERLOADING)
    toggleActionDrawAsRadio                 ,
#endif




 -- * Signals


-- ** toggled #signal:toggled#

    ToggleActionToggledCallback             ,
#if defined(ENABLE_OVERLOADING)
    ToggleActionToggledSignalInfo           ,
#endif
    afterToggleActionToggled                ,
    onToggleActionToggled                   ,




    ) 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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 Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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 GHC.Records as R

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Buildable as Gtk.Buildable
import {-# SOURCE #-} qualified GI.Gtk.Objects.Action as Gtk.Action

-- | Memory-managed wrapper type.
newtype ToggleAction = ToggleAction (SP.ManagedPtr ToggleAction)
    deriving (ToggleAction -> ToggleAction -> Bool
(ToggleAction -> ToggleAction -> Bool)
-> (ToggleAction -> ToggleAction -> Bool) -> Eq ToggleAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ToggleAction -> ToggleAction -> Bool
== :: ToggleAction -> ToggleAction -> Bool
$c/= :: ToggleAction -> ToggleAction -> Bool
/= :: ToggleAction -> ToggleAction -> Bool
Eq)

instance SP.ManagedPtrNewtype ToggleAction where
    toManagedPtr :: ToggleAction -> ManagedPtr ToggleAction
toManagedPtr (ToggleAction ManagedPtr ToggleAction
p) = ManagedPtr ToggleAction
p

foreign import ccall "gtk_toggle_action_get_type"
    c_gtk_toggle_action_get_type :: IO B.Types.GType

instance B.Types.TypedObject ToggleAction where
    glibType :: IO GType
glibType = IO GType
c_gtk_toggle_action_get_type

instance B.Types.GObject ToggleAction

-- | Type class for types which can be safely cast to `ToggleAction`, for instance with `toToggleAction`.
class (SP.GObject o, O.IsDescendantOf ToggleAction o) => IsToggleAction o
instance (SP.GObject o, O.IsDescendantOf ToggleAction o) => IsToggleAction o

instance O.HasParentTypes ToggleAction
type instance O.ParentTypes ToggleAction = '[Gtk.Action.Action, GObject.Object.Object, Gtk.Buildable.Buildable]

-- | Cast to `ToggleAction`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toToggleAction :: (MIO.MonadIO m, IsToggleAction o) => o -> m ToggleAction
toToggleAction :: forall (m :: * -> *) o.
(MonadIO m, IsToggleAction o) =>
o -> m ToggleAction
toToggleAction = IO ToggleAction -> m ToggleAction
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO ToggleAction -> m ToggleAction)
-> (o -> IO ToggleAction) -> o -> m ToggleAction
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr ToggleAction -> ToggleAction) -> o -> IO ToggleAction
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr ToggleAction -> ToggleAction
ToggleAction

-- | Convert 'ToggleAction' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe ToggleAction) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_toggle_action_get_type
    gvalueSet_ :: Ptr GValue -> Maybe ToggleAction -> IO ()
gvalueSet_ Ptr GValue
gv Maybe ToggleAction
P.Nothing = Ptr GValue -> Ptr ToggleAction -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr ToggleAction
forall a. Ptr a
FP.nullPtr :: FP.Ptr ToggleAction)
    gvalueSet_ Ptr GValue
gv (P.Just ToggleAction
obj) = ToggleAction -> (Ptr ToggleAction -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr ToggleAction
obj (Ptr GValue -> Ptr ToggleAction -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe ToggleAction)
gvalueGet_ Ptr GValue
gv = do
        Ptr ToggleAction
ptr <- Ptr GValue -> IO (Ptr ToggleAction)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr ToggleAction)
        if Ptr ToggleAction
ptr Ptr ToggleAction -> Ptr ToggleAction -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr ToggleAction
forall a. Ptr a
FP.nullPtr
        then ToggleAction -> Maybe ToggleAction
forall a. a -> Maybe a
P.Just (ToggleAction -> Maybe ToggleAction)
-> IO ToggleAction -> IO (Maybe ToggleAction)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr ToggleAction -> ToggleAction)
-> Ptr ToggleAction -> IO ToggleAction
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr ToggleAction -> ToggleAction
ToggleAction Ptr ToggleAction
ptr
        else Maybe ToggleAction -> IO (Maybe ToggleAction)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ToggleAction
forall a. Maybe a
P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveToggleActionMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveToggleActionMethod "activate" o = Gtk.Action.ActionActivateMethodInfo
    ResolveToggleActionMethod "addChild" o = Gtk.Buildable.BuildableAddChildMethodInfo
    ResolveToggleActionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveToggleActionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveToggleActionMethod "blockActivate" o = Gtk.Action.ActionBlockActivateMethodInfo
    ResolveToggleActionMethod "connectAccelerator" o = Gtk.Action.ActionConnectAcceleratorMethodInfo
    ResolveToggleActionMethod "constructChild" o = Gtk.Buildable.BuildableConstructChildMethodInfo
    ResolveToggleActionMethod "createIcon" o = Gtk.Action.ActionCreateIconMethodInfo
    ResolveToggleActionMethod "createMenu" o = Gtk.Action.ActionCreateMenuMethodInfo
    ResolveToggleActionMethod "createMenuItem" o = Gtk.Action.ActionCreateMenuItemMethodInfo
    ResolveToggleActionMethod "createToolItem" o = Gtk.Action.ActionCreateToolItemMethodInfo
    ResolveToggleActionMethod "customFinished" o = Gtk.Buildable.BuildableCustomFinishedMethodInfo
    ResolveToggleActionMethod "customTagEnd" o = Gtk.Buildable.BuildableCustomTagEndMethodInfo
    ResolveToggleActionMethod "customTagStart" o = Gtk.Buildable.BuildableCustomTagStartMethodInfo
    ResolveToggleActionMethod "disconnectAccelerator" o = Gtk.Action.ActionDisconnectAcceleratorMethodInfo
    ResolveToggleActionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveToggleActionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveToggleActionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveToggleActionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveToggleActionMethod "isSensitive" o = Gtk.Action.ActionIsSensitiveMethodInfo
    ResolveToggleActionMethod "isVisible" o = Gtk.Action.ActionIsVisibleMethodInfo
    ResolveToggleActionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveToggleActionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveToggleActionMethod "parserFinished" o = Gtk.Buildable.BuildableParserFinishedMethodInfo
    ResolveToggleActionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveToggleActionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveToggleActionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveToggleActionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveToggleActionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveToggleActionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveToggleActionMethod "toggled" o = ToggleActionToggledMethodInfo
    ResolveToggleActionMethod "unblockActivate" o = Gtk.Action.ActionUnblockActivateMethodInfo
    ResolveToggleActionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveToggleActionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveToggleActionMethod "getAccelClosure" o = Gtk.Action.ActionGetAccelClosureMethodInfo
    ResolveToggleActionMethod "getAccelPath" o = Gtk.Action.ActionGetAccelPathMethodInfo
    ResolveToggleActionMethod "getActive" o = ToggleActionGetActiveMethodInfo
    ResolveToggleActionMethod "getAlwaysShowImage" o = Gtk.Action.ActionGetAlwaysShowImageMethodInfo
    ResolveToggleActionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveToggleActionMethod "getDrawAsRadio" o = ToggleActionGetDrawAsRadioMethodInfo
    ResolveToggleActionMethod "getGicon" o = Gtk.Action.ActionGetGiconMethodInfo
    ResolveToggleActionMethod "getIconName" o = Gtk.Action.ActionGetIconNameMethodInfo
    ResolveToggleActionMethod "getInternalChild" o = Gtk.Buildable.BuildableGetInternalChildMethodInfo
    ResolveToggleActionMethod "getIsImportant" o = Gtk.Action.ActionGetIsImportantMethodInfo
    ResolveToggleActionMethod "getLabel" o = Gtk.Action.ActionGetLabelMethodInfo
    ResolveToggleActionMethod "getName" o = Gtk.Action.ActionGetNameMethodInfo
    ResolveToggleActionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveToggleActionMethod "getProxies" o = Gtk.Action.ActionGetProxiesMethodInfo
    ResolveToggleActionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveToggleActionMethod "getSensitive" o = Gtk.Action.ActionGetSensitiveMethodInfo
    ResolveToggleActionMethod "getShortLabel" o = Gtk.Action.ActionGetShortLabelMethodInfo
    ResolveToggleActionMethod "getStockId" o = Gtk.Action.ActionGetStockIdMethodInfo
    ResolveToggleActionMethod "getTooltip" o = Gtk.Action.ActionGetTooltipMethodInfo
    ResolveToggleActionMethod "getVisible" o = Gtk.Action.ActionGetVisibleMethodInfo
    ResolveToggleActionMethod "getVisibleHorizontal" o = Gtk.Action.ActionGetVisibleHorizontalMethodInfo
    ResolveToggleActionMethod "getVisibleVertical" o = Gtk.Action.ActionGetVisibleVerticalMethodInfo
    ResolveToggleActionMethod "setAccelGroup" o = Gtk.Action.ActionSetAccelGroupMethodInfo
    ResolveToggleActionMethod "setAccelPath" o = Gtk.Action.ActionSetAccelPathMethodInfo
    ResolveToggleActionMethod "setActive" o = ToggleActionSetActiveMethodInfo
    ResolveToggleActionMethod "setAlwaysShowImage" o = Gtk.Action.ActionSetAlwaysShowImageMethodInfo
    ResolveToggleActionMethod "setBuildableProperty" o = Gtk.Buildable.BuildableSetBuildablePropertyMethodInfo
    ResolveToggleActionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveToggleActionMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveToggleActionMethod "setDrawAsRadio" o = ToggleActionSetDrawAsRadioMethodInfo
    ResolveToggleActionMethod "setGicon" o = Gtk.Action.ActionSetGiconMethodInfo
    ResolveToggleActionMethod "setIconName" o = Gtk.Action.ActionSetIconNameMethodInfo
    ResolveToggleActionMethod "setIsImportant" o = Gtk.Action.ActionSetIsImportantMethodInfo
    ResolveToggleActionMethod "setLabel" o = Gtk.Action.ActionSetLabelMethodInfo
    ResolveToggleActionMethod "setName" o = Gtk.Buildable.BuildableSetNameMethodInfo
    ResolveToggleActionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveToggleActionMethod "setSensitive" o = Gtk.Action.ActionSetSensitiveMethodInfo
    ResolveToggleActionMethod "setShortLabel" o = Gtk.Action.ActionSetShortLabelMethodInfo
    ResolveToggleActionMethod "setStockId" o = Gtk.Action.ActionSetStockIdMethodInfo
    ResolveToggleActionMethod "setTooltip" o = Gtk.Action.ActionSetTooltipMethodInfo
    ResolveToggleActionMethod "setVisible" o = Gtk.Action.ActionSetVisibleMethodInfo
    ResolveToggleActionMethod "setVisibleHorizontal" o = Gtk.Action.ActionSetVisibleHorizontalMethodInfo
    ResolveToggleActionMethod "setVisibleVertical" o = Gtk.Action.ActionSetVisibleVerticalMethodInfo
    ResolveToggleActionMethod l o = O.MethodResolutionFailed l o

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

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveToggleActionMethod t ToggleAction, O.OverloadedMethod info ToggleAction p, R.HasField t ToggleAction p) => R.HasField t ToggleAction p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveToggleActionMethod t ToggleAction, O.OverloadedMethodInfo info ToggleAction) => OL.IsLabel t (O.MethodProxy info ToggleAction) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif

-- signal ToggleAction::toggled
{-# DEPRECATED ToggleActionToggledCallback ["(Since version 3.10)"] #-}
-- | Should be connected if you wish to perform an action
-- whenever the t'GI.Gtk.Objects.ToggleAction.ToggleAction' state is changed.
type ToggleActionToggledCallback =
    IO ()

type C_ToggleActionToggledCallback =
    Ptr ToggleAction ->                     -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_ToggleActionToggledCallback`.
foreign import ccall "wrapper"
    mk_ToggleActionToggledCallback :: C_ToggleActionToggledCallback -> IO (FunPtr C_ToggleActionToggledCallback)

wrap_ToggleActionToggledCallback :: 
    GObject a => (a -> ToggleActionToggledCallback) ->
    C_ToggleActionToggledCallback
wrap_ToggleActionToggledCallback :: forall a.
GObject a =>
(a -> IO ()) -> C_ToggleActionToggledCallback
wrap_ToggleActionToggledCallback a -> IO ()
gi'cb Ptr ToggleAction
gi'selfPtr Ptr ()
_ = do
    Ptr ToggleAction -> (ToggleAction -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr ToggleAction
gi'selfPtr ((ToggleAction -> IO ()) -> IO ())
-> (ToggleAction -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ToggleAction
gi'self -> a -> IO ()
gi'cb (ToggleAction -> a
forall a b. Coercible a b => a -> b
Coerce.coerce ToggleAction
gi'self) 


-- | Connect a signal handler for the [toggled](#signal:toggled) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' toggleAction #toggled callback
-- @
-- 
-- 
onToggleActionToggled :: (IsToggleAction a, MonadIO m) => a -> ((?self :: a) => ToggleActionToggledCallback) -> m SignalHandlerId
onToggleActionToggled :: forall a (m :: * -> *).
(IsToggleAction a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onToggleActionToggled a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
    let wrapped' :: C_ToggleActionToggledCallback
wrapped' = (a -> IO ()) -> C_ToggleActionToggledCallback
forall a.
GObject a =>
(a -> IO ()) -> C_ToggleActionToggledCallback
wrap_ToggleActionToggledCallback a -> IO ()
wrapped
    FunPtr C_ToggleActionToggledCallback
wrapped'' <- C_ToggleActionToggledCallback
-> IO (FunPtr C_ToggleActionToggledCallback)
mk_ToggleActionToggledCallback C_ToggleActionToggledCallback
wrapped'
    a
-> Text
-> FunPtr C_ToggleActionToggledCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"toggled" FunPtr C_ToggleActionToggledCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [toggled](#signal:toggled) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' toggleAction #toggled callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterToggleActionToggled :: (IsToggleAction a, MonadIO m) => a -> ((?self :: a) => ToggleActionToggledCallback) -> m SignalHandlerId
afterToggleActionToggled :: forall a (m :: * -> *).
(IsToggleAction a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterToggleActionToggled a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
    let wrapped' :: C_ToggleActionToggledCallback
wrapped' = (a -> IO ()) -> C_ToggleActionToggledCallback
forall a.
GObject a =>
(a -> IO ()) -> C_ToggleActionToggledCallback
wrap_ToggleActionToggledCallback a -> IO ()
wrapped
    FunPtr C_ToggleActionToggledCallback
wrapped'' <- C_ToggleActionToggledCallback
-> IO (FunPtr C_ToggleActionToggledCallback)
mk_ToggleActionToggledCallback C_ToggleActionToggledCallback
wrapped'
    a
-> Text
-> FunPtr C_ToggleActionToggledCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"toggled" FunPtr C_ToggleActionToggledCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data ToggleActionToggledSignalInfo
instance SignalInfo ToggleActionToggledSignalInfo where
    type HaskellCallbackType ToggleActionToggledSignalInfo = ToggleActionToggledCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_ToggleActionToggledCallback cb
        cb'' <- mk_ToggleActionToggledCallback cb'
        connectSignalFunPtr obj "toggled" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.ToggleAction::toggled"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-ToggleAction.html#g:signal:toggled"})

#endif

-- VVV Prop "active"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

-- | Get the value of the “@active@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' toggleAction #active
-- @
getToggleActionActive :: (MonadIO m, IsToggleAction o) => o -> m Bool
getToggleActionActive :: forall (m :: * -> *) o.
(MonadIO m, IsToggleAction o) =>
o -> m Bool
getToggleActionActive o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"active"

-- | Set the value of the “@active@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' toggleAction [ #active 'Data.GI.Base.Attributes.:=' value ]
-- @
setToggleActionActive :: (MonadIO m, IsToggleAction o) => o -> Bool -> m ()
setToggleActionActive :: forall (m :: * -> *) o.
(MonadIO m, IsToggleAction o) =>
o -> Bool -> m ()
setToggleActionActive o
obj Bool
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"active" Bool
val

-- | Construct a `GValueConstruct` with valid value for the “@active@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructToggleActionActive :: (IsToggleAction o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructToggleActionActive :: forall o (m :: * -> *).
(IsToggleAction o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructToggleActionActive Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"active" Bool
val

#if defined(ENABLE_OVERLOADING)
data ToggleActionActivePropertyInfo
instance AttrInfo ToggleActionActivePropertyInfo where
    type AttrAllowedOps ToggleActionActivePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint ToggleActionActivePropertyInfo = IsToggleAction
    type AttrSetTypeConstraint ToggleActionActivePropertyInfo = (~) Bool
    type AttrTransferTypeConstraint ToggleActionActivePropertyInfo = (~) Bool
    type AttrTransferType ToggleActionActivePropertyInfo = Bool
    type AttrGetType ToggleActionActivePropertyInfo = Bool
    type AttrLabel ToggleActionActivePropertyInfo = "active"
    type AttrOrigin ToggleActionActivePropertyInfo = ToggleAction
    attrGet = getToggleActionActive
    attrSet = setToggleActionActive
    attrTransfer _ v = do
        return v
    attrConstruct = constructToggleActionActive
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.ToggleAction.active"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-ToggleAction.html#g:attr:active"
        })
#endif

-- VVV Prop "draw-as-radio"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

-- | Get the value of the “@draw-as-radio@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' toggleAction #drawAsRadio
-- @
getToggleActionDrawAsRadio :: (MonadIO m, IsToggleAction o) => o -> m Bool
getToggleActionDrawAsRadio :: forall (m :: * -> *) o.
(MonadIO m, IsToggleAction o) =>
o -> m Bool
getToggleActionDrawAsRadio o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"draw-as-radio"

-- | Set the value of the “@draw-as-radio@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' toggleAction [ #drawAsRadio 'Data.GI.Base.Attributes.:=' value ]
-- @
setToggleActionDrawAsRadio :: (MonadIO m, IsToggleAction o) => o -> Bool -> m ()
setToggleActionDrawAsRadio :: forall (m :: * -> *) o.
(MonadIO m, IsToggleAction o) =>
o -> Bool -> m ()
setToggleActionDrawAsRadio o
obj Bool
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"draw-as-radio" Bool
val

-- | Construct a `GValueConstruct` with valid value for the “@draw-as-radio@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructToggleActionDrawAsRadio :: (IsToggleAction o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructToggleActionDrawAsRadio :: forall o (m :: * -> *).
(IsToggleAction o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructToggleActionDrawAsRadio Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"draw-as-radio" Bool
val

#if defined(ENABLE_OVERLOADING)
data ToggleActionDrawAsRadioPropertyInfo
instance AttrInfo ToggleActionDrawAsRadioPropertyInfo where
    type AttrAllowedOps ToggleActionDrawAsRadioPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint ToggleActionDrawAsRadioPropertyInfo = IsToggleAction
    type AttrSetTypeConstraint ToggleActionDrawAsRadioPropertyInfo = (~) Bool
    type AttrTransferTypeConstraint ToggleActionDrawAsRadioPropertyInfo = (~) Bool
    type AttrTransferType ToggleActionDrawAsRadioPropertyInfo = Bool
    type AttrGetType ToggleActionDrawAsRadioPropertyInfo = Bool
    type AttrLabel ToggleActionDrawAsRadioPropertyInfo = "draw-as-radio"
    type AttrOrigin ToggleActionDrawAsRadioPropertyInfo = ToggleAction
    attrGet = getToggleActionDrawAsRadio
    attrSet = setToggleActionDrawAsRadio
    attrTransfer _ v = do
        return v
    attrConstruct = constructToggleActionDrawAsRadio
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.ToggleAction.drawAsRadio"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-ToggleAction.html#g:attr:drawAsRadio"
        })
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList ToggleAction
type instance O.AttributeList ToggleAction = ToggleActionAttributeList
type ToggleActionAttributeList = ('[ '("actionGroup", Gtk.Action.ActionActionGroupPropertyInfo), '("active", ToggleActionActivePropertyInfo), '("alwaysShowImage", Gtk.Action.ActionAlwaysShowImagePropertyInfo), '("drawAsRadio", ToggleActionDrawAsRadioPropertyInfo), '("gicon", Gtk.Action.ActionGiconPropertyInfo), '("hideIfEmpty", Gtk.Action.ActionHideIfEmptyPropertyInfo), '("iconName", Gtk.Action.ActionIconNamePropertyInfo), '("isImportant", Gtk.Action.ActionIsImportantPropertyInfo), '("label", Gtk.Action.ActionLabelPropertyInfo), '("name", Gtk.Action.ActionNamePropertyInfo), '("sensitive", Gtk.Action.ActionSensitivePropertyInfo), '("shortLabel", Gtk.Action.ActionShortLabelPropertyInfo), '("stockId", Gtk.Action.ActionStockIdPropertyInfo), '("tooltip", Gtk.Action.ActionTooltipPropertyInfo), '("visible", Gtk.Action.ActionVisiblePropertyInfo), '("visibleHorizontal", Gtk.Action.ActionVisibleHorizontalPropertyInfo), '("visibleOverflown", Gtk.Action.ActionVisibleOverflownPropertyInfo), '("visibleVertical", Gtk.Action.ActionVisibleVerticalPropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
toggleActionActive :: AttrLabelProxy "active"
toggleActionActive = AttrLabelProxy

toggleActionDrawAsRadio :: AttrLabelProxy "drawAsRadio"
toggleActionDrawAsRadio = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList ToggleAction = ToggleActionSignalList
type ToggleActionSignalList = ('[ '("activate", Gtk.Action.ActionActivateSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("toggled", ToggleActionToggledSignalInfo)] :: [(Symbol, DK.Type)])

#endif

-- method ToggleAction::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A unique name for the action"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "label"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "The label displayed in menu items and on buttons,\n        or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "tooltip"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A tooltip for the action, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "stock_id"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "The stock icon to display in widgets representing\n           the action, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gtk" , name = "ToggleAction" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_toggle_action_new" gtk_toggle_action_new :: 
    CString ->                              -- name : TBasicType TUTF8
    CString ->                              -- label : TBasicType TUTF8
    CString ->                              -- tooltip : TBasicType TUTF8
    CString ->                              -- stock_id : TBasicType TUTF8
    IO (Ptr ToggleAction)

{-# DEPRECATED toggleActionNew ["(Since version 3.10)"] #-}
-- | Creates a new t'GI.Gtk.Objects.ToggleAction.ToggleAction' object. To add the action to
-- a t'GI.Gtk.Objects.ActionGroup.ActionGroup' and set the accelerator for the action,
-- call 'GI.Gtk.Objects.ActionGroup.actionGroupAddActionWithAccel'.
-- 
-- /Since: 2.4/
toggleActionNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@name@/: A unique name for the action
    -> Maybe (T.Text)
    -- ^ /@label@/: The label displayed in menu items and on buttons,
    --         or 'P.Nothing'
    -> Maybe (T.Text)
    -- ^ /@tooltip@/: A tooltip for the action, or 'P.Nothing'
    -> Maybe (T.Text)
    -- ^ /@stockId@/: The stock icon to display in widgets representing
    --            the action, or 'P.Nothing'
    -> m ToggleAction
    -- ^ __Returns:__ a new t'GI.Gtk.Objects.ToggleAction.ToggleAction'
toggleActionNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> Maybe Text -> Maybe Text -> Maybe Text -> m ToggleAction
toggleActionNew Text
name Maybe Text
label Maybe Text
tooltip Maybe Text
stockId = IO ToggleAction -> m ToggleAction
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ToggleAction -> m ToggleAction)
-> IO ToggleAction -> m ToggleAction
forall a b. (a -> b) -> a -> b
$ do
    CString
name' <- Text -> IO CString
textToCString Text
name
    CString
maybeLabel <- case Maybe Text
label of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
        Just Text
jLabel -> do
            CString
jLabel' <- Text -> IO CString
textToCString Text
jLabel
            CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jLabel'
    CString
maybeTooltip <- case Maybe Text
tooltip of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
        Just Text
jTooltip -> do
            CString
jTooltip' <- Text -> IO CString
textToCString Text
jTooltip
            CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jTooltip'
    CString
maybeStockId <- case Maybe Text
stockId of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
        Just Text
jStockId -> do
            CString
jStockId' <- Text -> IO CString
textToCString Text
jStockId
            CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jStockId'
    Ptr ToggleAction
result <- CString -> CString -> CString -> CString -> IO (Ptr ToggleAction)
gtk_toggle_action_new CString
name' CString
maybeLabel CString
maybeTooltip CString
maybeStockId
    Text -> Ptr ToggleAction -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"toggleActionNew" Ptr ToggleAction
result
    ToggleAction
result' <- ((ManagedPtr ToggleAction -> ToggleAction)
-> Ptr ToggleAction -> IO ToggleAction
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr ToggleAction -> ToggleAction
ToggleAction) Ptr ToggleAction
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeLabel
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeTooltip
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeStockId
    ToggleAction -> IO ToggleAction
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ToggleAction
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method ToggleAction::get_active
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "action"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "ToggleAction" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the action object" , 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 "gtk_toggle_action_get_active" gtk_toggle_action_get_active :: 
    Ptr ToggleAction ->                     -- action : TInterface (Name {namespace = "Gtk", name = "ToggleAction"})
    IO CInt

{-# DEPRECATED toggleActionGetActive ["(Since version 3.10)"] #-}
-- | Returns the checked state of the toggle action.
-- 
-- /Since: 2.4/
toggleActionGetActive ::
    (B.CallStack.HasCallStack, MonadIO m, IsToggleAction a) =>
    a
    -- ^ /@action@/: the action object
    -> m Bool
    -- ^ __Returns:__ the checked state of the toggle action
toggleActionGetActive :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsToggleAction a) =>
a -> m Bool
toggleActionGetActive a
action = IO Bool -> m Bool
forall a. IO a -> m a
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 ToggleAction
action' <- a -> IO (Ptr ToggleAction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
    CInt
result <- Ptr ToggleAction -> IO CInt
gtk_toggle_action_get_active Ptr ToggleAction
action'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
action
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data ToggleActionGetActiveMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsToggleAction a) => O.OverloadedMethod ToggleActionGetActiveMethodInfo a signature where
    overloadedMethod = toggleActionGetActive

instance O.OverloadedMethodInfo ToggleActionGetActiveMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.ToggleAction.toggleActionGetActive",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-ToggleAction.html#v:toggleActionGetActive"
        })


#endif

-- method ToggleAction::get_draw_as_radio
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "action"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "ToggleAction" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the action object" , 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 "gtk_toggle_action_get_draw_as_radio" gtk_toggle_action_get_draw_as_radio :: 
    Ptr ToggleAction ->                     -- action : TInterface (Name {namespace = "Gtk", name = "ToggleAction"})
    IO CInt

{-# DEPRECATED toggleActionGetDrawAsRadio ["(Since version 3.10)"] #-}
-- | Returns whether the action should have proxies like a radio action.
-- 
-- /Since: 2.4/
toggleActionGetDrawAsRadio ::
    (B.CallStack.HasCallStack, MonadIO m, IsToggleAction a) =>
    a
    -- ^ /@action@/: the action object
    -> m Bool
    -- ^ __Returns:__ whether the action should have proxies like a radio action.
toggleActionGetDrawAsRadio :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsToggleAction a) =>
a -> m Bool
toggleActionGetDrawAsRadio a
action = IO Bool -> m Bool
forall a. IO a -> m a
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 ToggleAction
action' <- a -> IO (Ptr ToggleAction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
    CInt
result <- Ptr ToggleAction -> IO CInt
gtk_toggle_action_get_draw_as_radio Ptr ToggleAction
action'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
action
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data ToggleActionGetDrawAsRadioMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsToggleAction a) => O.OverloadedMethod ToggleActionGetDrawAsRadioMethodInfo a signature where
    overloadedMethod = toggleActionGetDrawAsRadio

instance O.OverloadedMethodInfo ToggleActionGetDrawAsRadioMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.ToggleAction.toggleActionGetDrawAsRadio",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-ToggleAction.html#v:toggleActionGetDrawAsRadio"
        })


#endif

-- method ToggleAction::set_active
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "action"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "ToggleAction" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the action object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "is_active"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "whether the action should be checked or not"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_toggle_action_set_active" gtk_toggle_action_set_active :: 
    Ptr ToggleAction ->                     -- action : TInterface (Name {namespace = "Gtk", name = "ToggleAction"})
    CInt ->                                 -- is_active : TBasicType TBoolean
    IO ()

{-# DEPRECATED toggleActionSetActive ["(Since version 3.10)"] #-}
-- | Sets the checked state on the toggle action.
-- 
-- /Since: 2.4/
toggleActionSetActive ::
    (B.CallStack.HasCallStack, MonadIO m, IsToggleAction a) =>
    a
    -- ^ /@action@/: the action object
    -> Bool
    -- ^ /@isActive@/: whether the action should be checked or not
    -> m ()
toggleActionSetActive :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsToggleAction a) =>
a -> Bool -> m ()
toggleActionSetActive a
action Bool
isActive = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr ToggleAction
action' <- a -> IO (Ptr ToggleAction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
    let isActive' :: CInt
isActive' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
isActive
    Ptr ToggleAction -> CInt -> IO ()
gtk_toggle_action_set_active Ptr ToggleAction
action' CInt
isActive'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
action
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ToggleActionSetActiveMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsToggleAction a) => O.OverloadedMethod ToggleActionSetActiveMethodInfo a signature where
    overloadedMethod = toggleActionSetActive

instance O.OverloadedMethodInfo ToggleActionSetActiveMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.ToggleAction.toggleActionSetActive",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-ToggleAction.html#v:toggleActionSetActive"
        })


#endif

-- method ToggleAction::set_draw_as_radio
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "action"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "ToggleAction" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the action object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "draw_as_radio"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "whether the action should have proxies like a radio\n   action"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_toggle_action_set_draw_as_radio" gtk_toggle_action_set_draw_as_radio :: 
    Ptr ToggleAction ->                     -- action : TInterface (Name {namespace = "Gtk", name = "ToggleAction"})
    CInt ->                                 -- draw_as_radio : TBasicType TBoolean
    IO ()

{-# DEPRECATED toggleActionSetDrawAsRadio ["(Since version 3.10)"] #-}
-- | Sets whether the action should have proxies like a radio action.
-- 
-- /Since: 2.4/
toggleActionSetDrawAsRadio ::
    (B.CallStack.HasCallStack, MonadIO m, IsToggleAction a) =>
    a
    -- ^ /@action@/: the action object
    -> Bool
    -- ^ /@drawAsRadio@/: whether the action should have proxies like a radio
    --    action
    -> m ()
toggleActionSetDrawAsRadio :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsToggleAction a) =>
a -> Bool -> m ()
toggleActionSetDrawAsRadio a
action Bool
drawAsRadio = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr ToggleAction
action' <- a -> IO (Ptr ToggleAction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
    let drawAsRadio' :: CInt
drawAsRadio' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
drawAsRadio
    Ptr ToggleAction -> CInt -> IO ()
gtk_toggle_action_set_draw_as_radio Ptr ToggleAction
action' CInt
drawAsRadio'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
action
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ToggleActionSetDrawAsRadioMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsToggleAction a) => O.OverloadedMethod ToggleActionSetDrawAsRadioMethodInfo a signature where
    overloadedMethod = toggleActionSetDrawAsRadio

instance O.OverloadedMethodInfo ToggleActionSetDrawAsRadioMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.ToggleAction.toggleActionSetDrawAsRadio",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-ToggleAction.html#v:toggleActionSetDrawAsRadio"
        })


#endif

-- method ToggleAction::toggled
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "action"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "ToggleAction" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the action object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_toggle_action_toggled" gtk_toggle_action_toggled :: 
    Ptr ToggleAction ->                     -- action : TInterface (Name {namespace = "Gtk", name = "ToggleAction"})
    IO ()

{-# DEPRECATED toggleActionToggled ["(Since version 3.10)"] #-}
-- | Emits the “toggled” signal on the toggle action.
-- 
-- /Since: 2.4/
toggleActionToggled ::
    (B.CallStack.HasCallStack, MonadIO m, IsToggleAction a) =>
    a
    -- ^ /@action@/: the action object
    -> m ()
toggleActionToggled :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsToggleAction a) =>
a -> m ()
toggleActionToggled a
action = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr ToggleAction
action' <- a -> IO (Ptr ToggleAction)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
action
    Ptr ToggleAction -> IO ()
gtk_toggle_action_toggled Ptr ToggleAction
action'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
action
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data ToggleActionToggledMethodInfo
instance (signature ~ (m ()), MonadIO m, IsToggleAction a) => O.OverloadedMethod ToggleActionToggledMethodInfo a signature where
    overloadedMethod = toggleActionToggled

instance O.OverloadedMethodInfo ToggleActionToggledMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.ToggleAction.toggleActionToggled",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-ToggleAction.html#v:toggleActionToggled"
        })


#endif