{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- /No description available in the introspection data./

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

module GI.OSTree.Objects.RepoFinderConfig
    ( 

-- * Exported types
    RepoFinderConfig(..)                    ,
    IsRepoFinderConfig                      ,
    toRepoFinderConfig                      ,


 -- * 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"), [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"), [resolveAsync]("GI.OSTree.Interfaces.RepoFinder#g:method:resolveAsync"), [resolveFinish]("GI.OSTree.Interfaces.RepoFinder#g:method:resolveFinish"), [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"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata").
-- 
-- ==== 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").

#if defined(ENABLE_OVERLOADING)
    ResolveRepoFinderConfigMethod           ,
#endif

-- ** new #method:new#

    repoFinderConfigNew                     ,




    ) 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.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.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.OSTree.Interfaces.RepoFinder as OSTree.RepoFinder

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

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

foreign import ccall "ostree_repo_finder_config_get_type"
    c_ostree_repo_finder_config_get_type :: IO B.Types.GType

instance B.Types.TypedObject RepoFinderConfig where
    glibType :: IO GType
glibType = IO GType
c_ostree_repo_finder_config_get_type

instance B.Types.GObject RepoFinderConfig

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

instance O.HasParentTypes RepoFinderConfig
type instance O.ParentTypes RepoFinderConfig = '[GObject.Object.Object, OSTree.RepoFinder.RepoFinder]

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

-- | Convert 'RepoFinderConfig' 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 RepoFinderConfig) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ostree_repo_finder_config_get_type
    gvalueSet_ :: Ptr GValue -> Maybe RepoFinderConfig -> IO ()
gvalueSet_ Ptr GValue
gv Maybe RepoFinderConfig
P.Nothing = Ptr GValue -> Ptr RepoFinderConfig -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr RepoFinderConfig
forall a. Ptr a
FP.nullPtr :: FP.Ptr RepoFinderConfig)
    gvalueSet_ Ptr GValue
gv (P.Just RepoFinderConfig
obj) = RepoFinderConfig -> (Ptr RepoFinderConfig -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr RepoFinderConfig
obj (Ptr GValue -> Ptr RepoFinderConfig -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe RepoFinderConfig)
gvalueGet_ Ptr GValue
gv = do
        Ptr RepoFinderConfig
ptr <- Ptr GValue -> IO (Ptr RepoFinderConfig)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr RepoFinderConfig)
        if Ptr RepoFinderConfig
ptr Ptr RepoFinderConfig -> Ptr RepoFinderConfig -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr RepoFinderConfig
forall a. Ptr a
FP.nullPtr
        then RepoFinderConfig -> Maybe RepoFinderConfig
forall a. a -> Maybe a
P.Just (RepoFinderConfig -> Maybe RepoFinderConfig)
-> IO RepoFinderConfig -> IO (Maybe RepoFinderConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr RepoFinderConfig -> RepoFinderConfig)
-> Ptr RepoFinderConfig -> IO RepoFinderConfig
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr RepoFinderConfig -> RepoFinderConfig
RepoFinderConfig Ptr RepoFinderConfig
ptr
        else Maybe RepoFinderConfig -> IO (Maybe RepoFinderConfig)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe RepoFinderConfig
forall a. Maybe a
P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveRepoFinderConfigMethod (t :: Symbol) (o :: *) :: * where
    ResolveRepoFinderConfigMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveRepoFinderConfigMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveRepoFinderConfigMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveRepoFinderConfigMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveRepoFinderConfigMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveRepoFinderConfigMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveRepoFinderConfigMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveRepoFinderConfigMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveRepoFinderConfigMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveRepoFinderConfigMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveRepoFinderConfigMethod "resolveAsync" o = OSTree.RepoFinder.RepoFinderResolveAsyncMethodInfo
    ResolveRepoFinderConfigMethod "resolveFinish" o = OSTree.RepoFinder.RepoFinderResolveFinishMethodInfo
    ResolveRepoFinderConfigMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveRepoFinderConfigMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveRepoFinderConfigMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveRepoFinderConfigMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveRepoFinderConfigMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveRepoFinderConfigMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveRepoFinderConfigMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveRepoFinderConfigMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveRepoFinderConfigMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveRepoFinderConfigMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveRepoFinderConfigMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveRepoFinderConfigMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveRepoFinderConfigMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList RepoFinderConfig
type instance O.AttributeList RepoFinderConfig = RepoFinderConfigAttributeList
type RepoFinderConfigAttributeList = ('[ ] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList RepoFinderConfig = RepoFinderConfigSignalList
type RepoFinderConfigSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

-- method RepoFinderConfig::new
-- method type : Constructor
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "OSTree" , name = "RepoFinderConfig" })
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_finder_config_new" ostree_repo_finder_config_new :: 
    IO (Ptr RepoFinderConfig)

-- | Create a new t'GI.OSTree.Objects.RepoFinderConfig.RepoFinderConfig'.
-- 
-- /Since: 2018.6/
repoFinderConfigNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m RepoFinderConfig
    -- ^ __Returns:__ a new t'GI.OSTree.Objects.RepoFinderConfig.RepoFinderConfig'
repoFinderConfigNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
m RepoFinderConfig
repoFinderConfigNew  = IO RepoFinderConfig -> m RepoFinderConfig
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RepoFinderConfig -> m RepoFinderConfig)
-> IO RepoFinderConfig -> m RepoFinderConfig
forall a b. (a -> b) -> a -> b
$ do
    Ptr RepoFinderConfig
result <- IO (Ptr RepoFinderConfig)
ostree_repo_finder_config_new
    Text -> Ptr RepoFinderConfig -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"repoFinderConfigNew" Ptr RepoFinderConfig
result
    RepoFinderConfig
result' <- ((ManagedPtr RepoFinderConfig -> RepoFinderConfig)
-> Ptr RepoFinderConfig -> IO RepoFinderConfig
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr RepoFinderConfig -> RepoFinderConfig
RepoFinderConfig) Ptr RepoFinderConfig
result
    RepoFinderConfig -> IO RepoFinderConfig
forall (m :: * -> *) a. Monad m => a -> m a
return RepoFinderConfig
result'

#if defined(ENABLE_OVERLOADING)
#endif