#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Ggit.Objects.CredPlaintext
(
CredPlaintext(..) ,
IsCredPlaintext ,
toCredPlaintext ,
noCredPlaintext ,
#if ENABLE_OVERLOADING
CredPlaintextGetPasswordMethodInfo ,
#endif
credPlaintextGetPassword ,
#if ENABLE_OVERLOADING
CredPlaintextGetUsernameMethodInfo ,
#endif
credPlaintextGetUsername ,
credPlaintextNew ,
#if ENABLE_OVERLOADING
CredPlaintextPasswordPropertyInfo ,
#endif
constructCredPlaintextPassword ,
#if ENABLE_OVERLOADING
credPlaintextPassword ,
#endif
getCredPlaintextPassword ,
#if ENABLE_OVERLOADING
CredPlaintextUsernamePropertyInfo ,
#endif
constructCredPlaintextUsername ,
#if ENABLE_OVERLOADING
credPlaintextUsername ,
#endif
getCredPlaintextUsername ,
) 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.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.Ggit.Objects.Cred as Ggit.Cred
import {-# SOURCE #-} qualified GI.Ggit.Objects.Native as Ggit.Native
import {-# SOURCE #-} qualified GI.Ggit.Objects.ObjectFactoryBase as Ggit.ObjectFactoryBase
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
newtype CredPlaintext = CredPlaintext (ManagedPtr CredPlaintext)
foreign import ccall "ggit_cred_plaintext_get_type"
c_ggit_cred_plaintext_get_type :: IO GType
instance GObject CredPlaintext where
gobjectType = c_ggit_cred_plaintext_get_type
class (GObject o, O.IsDescendantOf CredPlaintext o) => IsCredPlaintext o
instance (GObject o, O.IsDescendantOf CredPlaintext o) => IsCredPlaintext o
instance O.HasParentTypes CredPlaintext
type instance O.ParentTypes CredPlaintext = '[Ggit.Cred.Cred, Ggit.Native.Native, Ggit.ObjectFactoryBase.ObjectFactoryBase, GObject.Object.Object, Gio.Initable.Initable]
toCredPlaintext :: (MonadIO m, IsCredPlaintext o) => o -> m CredPlaintext
toCredPlaintext = liftIO . unsafeCastTo CredPlaintext
noCredPlaintext :: Maybe CredPlaintext
noCredPlaintext = Nothing
#if ENABLE_OVERLOADING
type family ResolveCredPlaintextMethod (t :: Symbol) (o :: *) :: * where
ResolveCredPlaintextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveCredPlaintextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveCredPlaintextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveCredPlaintextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveCredPlaintextMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveCredPlaintextMethod "init" o = Gio.Initable.InitableInitMethodInfo
ResolveCredPlaintextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveCredPlaintextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveCredPlaintextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveCredPlaintextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveCredPlaintextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveCredPlaintextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveCredPlaintextMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveCredPlaintextMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveCredPlaintextMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveCredPlaintextMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveCredPlaintextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveCredPlaintextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveCredPlaintextMethod "getPassword" o = CredPlaintextGetPasswordMethodInfo
ResolveCredPlaintextMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveCredPlaintextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveCredPlaintextMethod "getUsername" o = CredPlaintextGetUsernameMethodInfo
ResolveCredPlaintextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveCredPlaintextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveCredPlaintextMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveCredPlaintextMethod t CredPlaintext, O.MethodInfo info CredPlaintext p) => OL.IsLabel t (CredPlaintext -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
getCredPlaintextPassword :: (MonadIO m, IsCredPlaintext o) => o -> m T.Text
getCredPlaintextPassword obj = liftIO $ checkUnexpectedNothing "getCredPlaintextPassword" $ B.Properties.getObjectPropertyString obj "password"
constructCredPlaintextPassword :: (IsCredPlaintext o) => T.Text -> IO (GValueConstruct o)
constructCredPlaintextPassword val = B.Properties.constructObjectPropertyString "password" (Just val)
#if ENABLE_OVERLOADING
data CredPlaintextPasswordPropertyInfo
instance AttrInfo CredPlaintextPasswordPropertyInfo where
type AttrAllowedOps CredPlaintextPasswordPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint CredPlaintextPasswordPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint CredPlaintextPasswordPropertyInfo = IsCredPlaintext
type AttrGetType CredPlaintextPasswordPropertyInfo = T.Text
type AttrLabel CredPlaintextPasswordPropertyInfo = "password"
type AttrOrigin CredPlaintextPasswordPropertyInfo = CredPlaintext
attrGet _ = getCredPlaintextPassword
attrSet _ = undefined
attrConstruct _ = constructCredPlaintextPassword
attrClear _ = undefined
#endif
getCredPlaintextUsername :: (MonadIO m, IsCredPlaintext o) => o -> m T.Text
getCredPlaintextUsername obj = liftIO $ checkUnexpectedNothing "getCredPlaintextUsername" $ B.Properties.getObjectPropertyString obj "username"
constructCredPlaintextUsername :: (IsCredPlaintext o) => T.Text -> IO (GValueConstruct o)
constructCredPlaintextUsername val = B.Properties.constructObjectPropertyString "username" (Just val)
#if ENABLE_OVERLOADING
data CredPlaintextUsernamePropertyInfo
instance AttrInfo CredPlaintextUsernamePropertyInfo where
type AttrAllowedOps CredPlaintextUsernamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint CredPlaintextUsernamePropertyInfo = (~) T.Text
type AttrBaseTypeConstraint CredPlaintextUsernamePropertyInfo = IsCredPlaintext
type AttrGetType CredPlaintextUsernamePropertyInfo = T.Text
type AttrLabel CredPlaintextUsernamePropertyInfo = "username"
type AttrOrigin CredPlaintextUsernamePropertyInfo = CredPlaintext
attrGet _ = getCredPlaintextUsername
attrSet _ = undefined
attrConstruct _ = constructCredPlaintextUsername
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList CredPlaintext
type instance O.AttributeList CredPlaintext = CredPlaintextAttributeList
type CredPlaintextAttributeList = ('[ '("native", Ggit.Native.NativeNativePropertyInfo), '("password", CredPlaintextPasswordPropertyInfo), '("username", CredPlaintextUsernamePropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
credPlaintextPassword :: AttrLabelProxy "password"
credPlaintextPassword = AttrLabelProxy
credPlaintextUsername :: AttrLabelProxy "username"
credPlaintextUsername = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList CredPlaintext = CredPlaintextSignalList
type CredPlaintextSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "ggit_cred_plaintext_new" ggit_cred_plaintext_new ::
CString ->
CString ->
Ptr (Ptr GError) ->
IO (Ptr CredPlaintext)
credPlaintextNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> T.Text
-> m CredPlaintext
credPlaintextNew username password = liftIO $ do
username' <- textToCString username
password' <- textToCString password
onException (do
result <- propagateGError $ ggit_cred_plaintext_new username' password'
checkUnexpectedReturnNULL "credPlaintextNew" result
result' <- (wrapObject CredPlaintext) result
freeMem username'
freeMem password'
return result'
) (do
freeMem username'
freeMem password'
)
#if ENABLE_OVERLOADING
#endif
foreign import ccall "ggit_cred_plaintext_get_password" ggit_cred_plaintext_get_password ::
Ptr CredPlaintext ->
IO CString
credPlaintextGetPassword ::
(B.CallStack.HasCallStack, MonadIO m, IsCredPlaintext a) =>
a
-> m T.Text
credPlaintextGetPassword cred = liftIO $ do
cred' <- unsafeManagedPtrCastPtr cred
result <- ggit_cred_plaintext_get_password cred'
checkUnexpectedReturnNULL "credPlaintextGetPassword" result
result' <- cstringToText result
touchManagedPtr cred
return result'
#if ENABLE_OVERLOADING
data CredPlaintextGetPasswordMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCredPlaintext a) => O.MethodInfo CredPlaintextGetPasswordMethodInfo a signature where
overloadedMethod _ = credPlaintextGetPassword
#endif
foreign import ccall "ggit_cred_plaintext_get_username" ggit_cred_plaintext_get_username ::
Ptr CredPlaintext ->
IO CString
credPlaintextGetUsername ::
(B.CallStack.HasCallStack, MonadIO m, IsCredPlaintext a) =>
a
-> m T.Text
credPlaintextGetUsername cred = liftIO $ do
cred' <- unsafeManagedPtrCastPtr cred
result <- ggit_cred_plaintext_get_username cred'
checkUnexpectedReturnNULL "credPlaintextGetUsername" result
result' <- cstringToText result
touchManagedPtr cred
return result'
#if ENABLE_OVERLOADING
data CredPlaintextGetUsernameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCredPlaintext a) => O.MethodInfo CredPlaintextGetUsernameMethodInfo a signature where
overloadedMethod _ = credPlaintextGetUsername
#endif