{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- 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                      ,
    noRepoFinderConfig                      ,


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#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.ManagedPtr as B.ManagedPtr
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 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 GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.RepoFinder as OSTree.RepoFinder

-- | Memory-managed wrapper type.
newtype RepoFinderConfig = RepoFinderConfig (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)
foreign import ccall "ostree_repo_finder_config_get_type"
    c_ostree_repo_finder_config_get_type :: IO GType

instance GObject RepoFinderConfig where
    gobjectType :: IO GType
gobjectType = IO GType
c_ostree_repo_finder_config_get_type
    

-- | Convert 'RepoFinderConfig' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue RepoFinderConfig where
    toGValue :: RepoFinderConfig -> IO GValue
toGValue o :: RepoFinderConfig
o = do
        GType
gtype <- IO GType
c_ostree_repo_finder_config_get_type
        RepoFinderConfig
-> (Ptr RepoFinderConfig -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr RepoFinderConfig
o (GType
-> (GValue -> Ptr RepoFinderConfig -> IO ())
-> Ptr RepoFinderConfig
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr RepoFinderConfig -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
        
    fromGValue :: GValue -> IO RepoFinderConfig
fromGValue gv :: GValue
gv = do
        Ptr RepoFinderConfig
ptr <- GValue -> IO (Ptr RepoFinderConfig)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr RepoFinderConfig)
        (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
        
    

-- | Type class for types which can be safely cast to `RepoFinderConfig`, for instance with `toRepoFinderConfig`.
class (GObject o, O.IsDescendantOf RepoFinderConfig o) => IsRepoFinderConfig o
instance (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 :: (MonadIO m, IsRepoFinderConfig o) => o -> m RepoFinderConfig
toRepoFinderConfig :: o -> m RepoFinderConfig
toRepoFinderConfig = IO RepoFinderConfig -> m RepoFinderConfig
forall (m :: * -> *) a. MonadIO m => IO a -> m a
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, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr RepoFinderConfig -> RepoFinderConfig
RepoFinderConfig

-- | A convenience alias for `Nothing` :: `Maybe` `RepoFinderConfig`.
noRepoFinderConfig :: Maybe RepoFinderConfig
noRepoFinderConfig :: Maybe RepoFinderConfig
noRepoFinderConfig = Maybe RepoFinderConfig
forall a. Maybe a
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.MethodInfo 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

#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 :: 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 "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