    {-# LANGUAGE TypeApplications #-}

    -- | Copyright  : Will Thompson and Iñaki García Etxebarria
    -- License    : LGPL-2.1
    -- Maintainer : Iñaki García Etxebarria
    --
    -- Applies a gives sorter to the levels in a tree.
    --
    -- Here is an example for setting up a column view with a tree model and
    -- a @GtkTreeListSorter@:
    --
    --
    -- === /c code/
    -- >column_sorter = gtk_column_view_get_sorter (view);
    -- >sorter = gtk_tree_list_row_sorter_new (g_object_ref (column_sorter));
    -- >sort_model = gtk_sort_list_model_new (tree_model, sorter);
    -- >selection = gtk_single_selection_new (sort_model);
    -- >gtk_column_view_set_model (view, G_LIST_MODEL (selection));
    --

    #if !defined(__HADDOCK_VERSION__)
    #define ENABLE_OVERLOADING
    #endif

    module GI.Gtk.Objects.TreeListRowSorter
        (

    -- * Exported types
        TreeListRowSorter(..)                   ,
        IsTreeListRowSorter                     ,
        toTreeListRowSorter                     ,

     -- * Methods
    -- |
    --
    --  === __Click to display all available methods, including inherited ones__
    -- ==== Methods
    -- [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [changed]("GI.Gtk.Objects.Sorter#g:method:changed"), [compare]("GI.Gtk.Objects.Sorter#g:method:compare"), [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"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [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"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
    --
    -- ==== Getters
    -- [getData]("GI.GObject.Objects.Object#g:method:getData"), [getOrder]("GI.Gtk.Objects.Sorter#g:method:getOrder"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getSorter]("GI.Gtk.Objects.TreeListRowSorter#g:method:getSorter").
    --
    -- ==== Setters
    -- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty"), [setSorter]("GI.Gtk.Objects.TreeListRowSorter#g:method:setSorter").

    #if defined(ENABLE_OVERLOADING)
        ResolveTreeListRowSorterMethod          ,
    #endif

    -- ** getSorter #method:getSorter#

    #if defined(ENABLE_OVERLOADING)
        TreeListRowSorterGetSorterMethodInfo    ,
    #endif
        treeListRowSorterGetSorter              ,

    -- ** new #method:new#

        treeListRowSorterNew                    ,

    -- ** setSorter #method:setSorter#

    #if defined(ENABLE_OVERLOADING)
        TreeListRowSorterSetSorterMethodInfo    ,
    #endif
        treeListRowSorterSetSorter              ,

     -- * Properties

    -- ** sorter #attr:sorter#
    -- | The underlying sorter

    #if defined(ENABLE_OVERLOADING)
        TreeListRowSorterSorterPropertyInfo     ,
    #endif
        clearTreeListRowSorterSorter            ,
        constructTreeListRowSorterSorter        ,
        getTreeListRowSorterSorter              ,
        setTreeListRowSorterSorter              ,
    #if defined(ENABLE_OVERLOADING)
        treeListRowSorterSorter                 ,
    #endif

        ) 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 Data.Word as DW
    import qualified Data.Int as DI
    import qualified System.Posix.Types as SPT
    import qualified Foreign.C.Types as FCT

    -- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
    #if MIN_VERSION_base(4,18,0)
    import qualified GI.GObject.Objects.Object as GObject.Object
    import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
    import {-# SOURCE #-} qualified GI.Gtk.Objects.Sorter as Gtk.Sorter

    #else
    import qualified GI.GObject.Objects.Object as GObject.Object
    import {-# SOURCE #-} qualified GI.Gtk.Objects.Sorter as Gtk.Sorter

    #endif

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

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

    foreign import ccall "gtk_tree_list_row_sorter_get_type"
        c_gtk_tree_list_row_sorter_get_type :: IO B.Types.GType

    instance B.Types.TypedObject TreeListRowSorter where
        glibType :: IO GType
    glibType = IO GType
    c_gtk_tree_list_row_sorter_get_type

    instance B.Types.GObject TreeListRowSorter

    -- | Type class for types which can be safely cast to t'TreeListRowSorter', for instance with `toTreeListRowSorter`.
    class (SP.GObject o, O.IsDescendantOf TreeListRowSorter o) => IsTreeListRowSorter o
    instance (SP.GObject o, O.IsDescendantOf TreeListRowSorter o) => IsTreeListRowSorter o

    instance O.HasParentTypes TreeListRowSorter
    type instance O.ParentTypes TreeListRowSorter = '[Gtk.Sorter.Sorter, GObject.Object.Object]

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

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

    #if defined(ENABLE_OVERLOADING)
    type family ResolveTreeListRowSorterMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
        ResolveTreeListRowSorterMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
        ResolveTreeListRowSorterMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
        ResolveTreeListRowSorterMethod "changed" o = Gtk.Sorter.SorterChangedMethodInfo
        ResolveTreeListRowSorterMethod "compare" o = Gtk.Sorter.SorterCompareMethodInfo
        ResolveTreeListRowSorterMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
        ResolveTreeListRowSorterMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
        ResolveTreeListRowSorterMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
        ResolveTreeListRowSorterMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
        ResolveTreeListRowSorterMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
        ResolveTreeListRowSorterMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
        ResolveTreeListRowSorterMethod "ref" o = GObject.Object.ObjectRefMethodInfo
        ResolveTreeListRowSorterMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
        ResolveTreeListRowSorterMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
        ResolveTreeListRowSorterMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
        ResolveTreeListRowSorterMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
        ResolveTreeListRowSorterMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
        ResolveTreeListRowSorterMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
        ResolveTreeListRowSorterMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
        ResolveTreeListRowSorterMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
        ResolveTreeListRowSorterMethod "getOrder" o = Gtk.Sorter.SorterGetOrderMethodInfo
        ResolveTreeListRowSorterMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
        ResolveTreeListRowSorterMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
        ResolveTreeListRowSorterMethod "getSorter" o = TreeListRowSorterGetSorterMethodInfo
        ResolveTreeListRowSorterMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
        ResolveTreeListRowSorterMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
        ResolveTreeListRowSorterMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
        ResolveTreeListRowSorterMethod "setSorter" o = TreeListRowSorterSetSorterMethodInfo
        ResolveTreeListRowSorterMethod l o = O.MethodResolutionFailed l o

    instance (info ~ ResolveTreeListRowSorterMethod t TreeListRowSorter, O.OverloadedMethod info TreeListRowSorter p) => OL.IsLabel t (TreeListRowSorter -> 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 ~ ResolveTreeListRowSorterMethod t TreeListRowSorter, O.OverloadedMethod info TreeListRowSorter p, R.HasField t TreeListRowSorter p) => R.HasField t TreeListRowSorter p where
        getField = O.overloadedMethod @info

    #endif

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

    #endif

    -- VVV Prop "sorter"
       -- Type: TInterface (Name {namespace = "Gtk", name = "Sorter"})
       -- Flags: [PropertyReadable,PropertyWritable]
       -- Nullable: (Just True,Just True)

    -- | Get the value of the “@sorter@” property.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' treeListRowSorter #sorter
    -- @
    getTreeListRowSorterSorter :: (MonadIO m, IsTreeListRowSorter o) => o -> m (Maybe Gtk.Sorter.Sorter)
    getTreeListRowSorterSorter :: forall (m :: * -> *) o.
    (MonadIO m, IsTreeListRowSorter o) =>
    o -> m (Maybe Sorter)
    getTreeListRowSorterSorter o
    obj = IO (Maybe Sorter) -> m (Maybe Sorter)
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    MIO.liftIO (IO (Maybe Sorter) -> m (Maybe Sorter))
    -> IO (Maybe Sorter) -> m (Maybe Sorter)
    forall a b. (a -> b) -> a -> b
    $ o -> String -> (ManagedPtr Sorter -> Sorter) -> IO (Maybe Sorter)
    forall a b.
    (GObject a, GObject b) =>
    a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
    B.Properties.getObjectPropertyObject o
    obj String
    "sorter" ManagedPtr Sorter -> Sorter
    Gtk.Sorter.Sorter

    -- | Set the value of the “@sorter@” property.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' treeListRowSorter [ #sorter 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setTreeListRowSorterSorter :: (MonadIO m, IsTreeListRowSorter o, Gtk.Sorter.IsSorter a) => o -> a -> m ()
    setTreeListRowSorterSorter :: forall (m :: * -> *) o a.
    (MonadIO m, IsTreeListRowSorter o, IsSorter a) =>
    o -> a -> m ()
    setTreeListRowSorterSorter o
    obj a
    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 -> Maybe a -> IO ()
    forall a b.
    (GObject a, GObject b) =>
    a -> String -> Maybe b -> IO ()
    B.Properties.setObjectPropertyObject o
    obj String
    "sorter" (a -> Maybe a
    forall a. a -> Maybe a
    Just a
    val)

    -- | Construct a t'GValueConstruct' with valid value for the “@sorter@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
    constructTreeListRowSorterSorter :: (IsTreeListRowSorter o, MIO.MonadIO m, Gtk.Sorter.IsSorter a) => a -> m (GValueConstruct o)
    constructTreeListRowSorterSorter :: forall o (m :: * -> *) a.
    (IsTreeListRowSorter o, MonadIO m, IsSorter a) =>
    a -> m (GValueConstruct o)
    constructTreeListRowSorterSorter a
    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 -> Maybe a -> IO (GValueConstruct o)
    forall a o.
    GObject a =>
    String -> Maybe a -> IO (GValueConstruct o)
    B.Properties.constructObjectPropertyObject String
    "sorter" (a -> Maybe a
    forall a. a -> Maybe a
    P.Just a
    val)

    -- | Set the value of the “@sorter@” property to `Nothing`.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.clear' #sorter
    -- @
    clearTreeListRowSorterSorter :: (MonadIO m, IsTreeListRowSorter o) => o -> m ()
    clearTreeListRowSorterSorter :: forall (m :: * -> *) o.
    (MonadIO m, IsTreeListRowSorter o) =>
    o -> m ()
    clearTreeListRowSorterSorter o
    obj = 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
    $ o -> String -> Maybe Sorter -> IO ()
    forall a b.
    (GObject a, GObject b) =>
    a -> String -> Maybe b -> IO ()
    B.Properties.setObjectPropertyObject o
    obj String
    "sorter" (Maybe Sorter
    forall a. Maybe a
    Nothing :: Maybe Gtk.Sorter.Sorter)

    #if defined(ENABLE_OVERLOADING)
    data TreeListRowSorterSorterPropertyInfo
    instance AttrInfo TreeListRowSorterSorterPropertyInfo where
        type AttrAllowedOps TreeListRowSorterSorterPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
        type AttrBaseTypeConstraint TreeListRowSorterSorterPropertyInfo = IsTreeListRowSorter
        type AttrSetTypeConstraint TreeListRowSorterSorterPropertyInfo = Gtk.Sorter.IsSorter
        type AttrTransferTypeConstraint TreeListRowSorterSorterPropertyInfo = Gtk.Sorter.IsSorter
        type AttrTransferType TreeListRowSorterSorterPropertyInfo = Gtk.Sorter.Sorter
        type AttrGetType TreeListRowSorterSorterPropertyInfo = (Maybe Gtk.Sorter.Sorter)
        type AttrLabel TreeListRowSorterSorterPropertyInfo = "sorter"
        type AttrOrigin TreeListRowSorterSorterPropertyInfo = TreeListRowSorter
        attrGet = getTreeListRowSorterSorter
        attrSet = setTreeListRowSorterSorter
        attrPut = undefined
        attrTransfer _ v = do
            unsafeCastTo Gtk.Sorter.Sorter v
        attrConstruct = constructTreeListRowSorterSorter
        attrClear = clearTreeListRowSorterSorter
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.TreeListRowSorter.sorter"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-TreeListRowSorter.html#g:attr:sorter"
            })
    #endif

    #if defined(ENABLE_OVERLOADING)
    instance O.HasAttributeList TreeListRowSorter
    type instance O.AttributeList TreeListRowSorter = TreeListRowSorterAttributeList
    type TreeListRowSorterAttributeList = ('[ '("sorter", TreeListRowSorterSorterPropertyInfo)] :: [(Symbol, DK.Type)])
    #endif

    #if defined(ENABLE_OVERLOADING)
    treeListRowSorterSorter :: AttrLabelProxy "sorter"
    treeListRowSorterSorter = AttrLabelProxy

    #endif

    #if defined(ENABLE_OVERLOADING)
    type instance O.SignalList TreeListRowSorter = TreeListRowSorterSignalList
    type TreeListRowSorterSignalList = ('[ '("changed", Gtk.Sorter.SorterChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])

    #endif

    -- method TreeListRowSorter::new
    -- method type : Constructor
    -- Args: [ Arg
    --           { argCName = "sorter"
    --           , argType = TInterface Name { namespace = "Gtk" , name = "Sorter" }
    --           , argCType = Just "GtkSorter*"
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GtkSorter`" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferEverything
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just
    --               (TInterface
    --                  Name { namespace = "Gtk" , name = "TreeListRowSorter" })
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_tree_list_row_sorter_new" gtk_tree_list_row_sorter_new ::
        Ptr Gtk.Sorter.Sorter ->                -- sorter : TInterface (Name {namespace = "Gtk", name = "Sorter"})
        IO (Ptr TreeListRowSorter)

    -- | Create a special-purpose sorter that applies the sorting
    -- of /@sorter@/ to the levels of a @GtkTreeListModel@.
    --
    -- Note that this sorter relies on [TreeListModel:passthrough]("GI.Gtk.Objects.TreeListModel#g:attr:passthrough")
    -- being 'P.False' as it can only sort t'GI.Gtk.Objects.TreeListRow.TreeListRow's.
    treeListRowSorterNew ::
        (B.CallStack.HasCallStack, MonadIO m, Gtk.Sorter.IsSorter a) =>
        Maybe (a)
        -- ^ /@sorter@/: a @GtkSorter@
        -> m TreeListRowSorter
        -- ^ __Returns:__ a new @GtkTreeListRowSorter@
    treeListRowSorterNew :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsSorter a) =>
    Maybe a -> m TreeListRowSorter
    treeListRowSorterNew Maybe a
    sorter = IO TreeListRowSorter -> m TreeListRowSorter
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO TreeListRowSorter -> m TreeListRowSorter)
    -> IO TreeListRowSorter -> m TreeListRowSorter
    forall a b. (a -> b) -> a -> b
    $ do
        maybeSorter <- case Maybe a
    sorter of
            Maybe a
    Nothing -> Ptr Sorter -> IO (Ptr Sorter)
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Ptr Sorter
    forall a. Ptr a
    FP.nullPtr
            Just a
    jSorter -> do
                jSorter' <- a -> IO (Ptr Sorter)
    forall a b. (HasCallStack, GObject a) => a -> IO (Ptr b)
    B.ManagedPtr.disownObject a
    jSorter
                return jSorter'
        result <- gtk_tree_list_row_sorter_new maybeSorter
        checkUnexpectedReturnNULL "treeListRowSorterNew" result
        result' <- (wrapObject TreeListRowSorter) result
        whenJust sorter touchManagedPtr
        return result'

    #if defined(ENABLE_OVERLOADING)
    #endif

    -- method TreeListRowSorter::get_sorter
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "self"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "TreeListRowSorter" }
    --           , argCType = Just "GtkTreeListRowSorter*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GtkTreeListRowSorter`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TInterface Name { namespace = "Gtk" , name = "Sorter" })
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_tree_list_row_sorter_get_sorter" gtk_tree_list_row_sorter_get_sorter ::
        Ptr TreeListRowSorter ->                -- self : TInterface (Name {namespace = "Gtk", name = "TreeListRowSorter"})
        IO (Ptr Gtk.Sorter.Sorter)

    -- | Returns the sorter used by /@self@/.
    treeListRowSorterGetSorter ::
        (B.CallStack.HasCallStack, MonadIO m, IsTreeListRowSorter a) =>
        a
        -- ^ /@self@/: a @GtkTreeListRowSorter@
        -> m (Maybe Gtk.Sorter.Sorter)
        -- ^ __Returns:__ the sorter used
    treeListRowSorterGetSorter :: forall (m :: * -> *) a.
    (HasCallStack, MonadIO m, IsTreeListRowSorter a) =>
    a -> m (Maybe Sorter)
    treeListRowSorterGetSorter a
    self = IO (Maybe Sorter) -> m (Maybe Sorter)
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO (Maybe Sorter) -> m (Maybe Sorter))
    -> IO (Maybe Sorter) -> m (Maybe Sorter)
    forall a b. (a -> b) -> a -> b
    $ do
        self' <- a -> IO (Ptr TreeListRowSorter)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    self
        result <- gtk_tree_list_row_sorter_get_sorter self'
        maybeResult <- convertIfNonNull result $ \Ptr Sorter
    result' -> do
            result'' <- ((ManagedPtr Sorter -> Sorter) -> Ptr Sorter -> IO Sorter
    forall a b.
    (HasCallStack, GObject a, GObject b) =>
    (ManagedPtr a -> a) -> Ptr b -> IO a
    newObject ManagedPtr Sorter -> Sorter
    Gtk.Sorter.Sorter) Ptr Sorter
    result'
            return result''
        touchManagedPtr self
        return maybeResult

    #if defined(ENABLE_OVERLOADING)
    data TreeListRowSorterGetSorterMethodInfo
    instance (signature ~ (m (Maybe Gtk.Sorter.Sorter)), MonadIO m, IsTreeListRowSorter a) => O.OverloadedMethod TreeListRowSorterGetSorterMethodInfo a signature where
        overloadedMethod = treeListRowSorterGetSorter

    instance O.OverloadedMethodInfo TreeListRowSorterGetSorterMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.TreeListRowSorter.treeListRowSorterGetSorter",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-TreeListRowSorter.html#v:treeListRowSorterGetSorter"
            })

    #endif

    -- method TreeListRowSorter::set_sorter
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "self"
    --           , argType =
    --               TInterface Name { namespace = "Gtk" , name = "TreeListRowSorter" }
    --           , argCType = Just "GtkTreeListRowSorter*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GtkTreeListRowSorter`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "sorter"
    --           , argType = TInterface Name { namespace = "Gtk" , name = "Sorter" }
    --           , argCType = Just "GtkSorter*"
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "The sorter to use" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "gtk_tree_list_row_sorter_set_sorter" gtk_tree_list_row_sorter_set_sorter ::
        Ptr TreeListRowSorter ->                -- self : TInterface (Name {namespace = "Gtk", name = "TreeListRowSorter"})
        Ptr Gtk.Sorter.Sorter ->                -- sorter : TInterface (Name {namespace = "Gtk", name = "Sorter"})
        IO ()

    -- | Sets the sorter to use for items with the same parent.
    --
    -- This sorter will be passed the [TreeListRow:item]("GI.Gtk.Objects.TreeListRow#g:attr:item") of
    -- the tree list rows passed to /@self@/.
    treeListRowSorterSetSorter ::
        (B.CallStack.HasCallStack, MonadIO m, IsTreeListRowSorter a, Gtk.Sorter.IsSorter b) =>
        a
        -- ^ /@self@/: a @GtkTreeListRowSorter@
        -> Maybe (b)
        -- ^ /@sorter@/: The sorter to use
        -> m ()
    treeListRowSorterSetSorter :: forall (m :: * -> *) a b.
    (HasCallStack, MonadIO m, IsTreeListRowSorter a, IsSorter b) =>
    a -> Maybe b -> m ()
    treeListRowSorterSetSorter a
    self Maybe b
    sorter = 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
        self' <- a -> IO (Ptr TreeListRowSorter)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr a
    self
        maybeSorter <- case sorter of
            Maybe b
    Nothing -> Ptr Sorter -> IO (Ptr Sorter)
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Ptr Sorter
    forall a. Ptr a
    FP.nullPtr
            Just b
    jSorter -> do
                jSorter' <- b -> IO (Ptr Sorter)
    forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
    unsafeManagedPtrCastPtr b
    jSorter
                return jSorter'
        gtk_tree_list_row_sorter_set_sorter self' maybeSorter
        touchManagedPtr self
        whenJust sorter touchManagedPtr
        return ()

    #if defined(ENABLE_OVERLOADING)
    data TreeListRowSorterSetSorterMethodInfo
    instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsTreeListRowSorter a, Gtk.Sorter.IsSorter b) => O.OverloadedMethod TreeListRowSorterSetSorterMethodInfo a signature where
        overloadedMethod = treeListRowSorterSetSorter

    instance O.OverloadedMethodInfo TreeListRowSorterSetSorterMethodInfo a where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gtk.Objects.TreeListRowSorter.treeListRowSorterSetSorter",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk4-4.0.12/docs/GI-Gtk-Objects-TreeListRowSorter.html#v:treeListRowSorterSetSorter"
            })

    #endif