{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}

module GI.GtkSource.Interfaces.CompletionProposal
    ( 

-- * Exported types
    CompletionProposal(..)                  ,
    noCompletionProposal                    ,
    IsCompletionProposal                    ,
    toCompletionProposal                    ,


 -- * Methods
-- ** changed #method:changed#
    CompletionProposalChangedMethodInfo     ,
    completionProposalChanged               ,


-- ** equal #method:equal#
    CompletionProposalEqualMethodInfo       ,
    completionProposalEqual                 ,


-- ** getGicon #method:getGicon#
    CompletionProposalGetGiconMethodInfo    ,
    completionProposalGetGicon              ,


-- ** getIcon #method:getIcon#
    CompletionProposalGetIconMethodInfo     ,
    completionProposalGetIcon               ,


-- ** getIconName #method:getIconName#
    CompletionProposalGetIconNameMethodInfo ,
    completionProposalGetIconName           ,


-- ** getInfo #method:getInfo#
    CompletionProposalGetInfoMethodInfo     ,
    completionProposalGetInfo               ,


-- ** getLabel #method:getLabel#
    CompletionProposalGetLabelMethodInfo    ,
    completionProposalGetLabel              ,


-- ** getMarkup #method:getMarkup#
    CompletionProposalGetMarkupMethodInfo   ,
    completionProposalGetMarkup             ,


-- ** getText #method:getText#
    CompletionProposalGetTextMethodInfo     ,
    completionProposalGetText               ,


-- ** hash #method:hash#
    CompletionProposalHashMethodInfo        ,
    completionProposalHash                  ,




 -- * Signals
-- ** changed #signal:changed#
    C_CompletionProposalChangedCallback     ,
    CompletionProposalChangedCallback       ,
    CompletionProposalChangedSignalInfo     ,
    afterCompletionProposalChanged          ,
    genClosure_CompletionProposalChanged    ,
    mk_CompletionProposalChangedCallback    ,
    noCompletionProposalChangedCallback     ,
    onCompletionProposalChanged             ,
    wrap_CompletionProposalChangedCallback  ,




    ) 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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.GObject.Objects.Object as GObject.Object
import qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
import qualified GI.Gio.Interfaces.Icon as Gio.Icon

-- interface CompletionProposal 
newtype CompletionProposal = CompletionProposal (ManagedPtr CompletionProposal)
noCompletionProposal :: Maybe CompletionProposal
noCompletionProposal = Nothing

-- signal CompletionProposal::changed
type CompletionProposalChangedCallback =
    IO ()

noCompletionProposalChangedCallback :: Maybe CompletionProposalChangedCallback
noCompletionProposalChangedCallback = Nothing

type C_CompletionProposalChangedCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_CompletionProposalChangedCallback :: C_CompletionProposalChangedCallback -> IO (FunPtr C_CompletionProposalChangedCallback)

genClosure_CompletionProposalChanged :: CompletionProposalChangedCallback -> IO Closure
genClosure_CompletionProposalChanged cb = do
    let cb' = wrap_CompletionProposalChangedCallback cb
    mk_CompletionProposalChangedCallback cb' >>= newCClosure


wrap_CompletionProposalChangedCallback ::
    CompletionProposalChangedCallback ->
    Ptr () ->
    Ptr () ->
    IO ()
wrap_CompletionProposalChangedCallback _cb _ _ = do
    _cb 


onCompletionProposalChanged :: (IsCompletionProposal a, MonadIO m) => a -> CompletionProposalChangedCallback -> m SignalHandlerId
onCompletionProposalChanged obj cb = liftIO $ do
    let cb' = wrap_CompletionProposalChangedCallback cb
    cb'' <- mk_CompletionProposalChangedCallback cb'
    connectSignalFunPtr obj "changed" cb'' SignalConnectBefore

afterCompletionProposalChanged :: (IsCompletionProposal a, MonadIO m) => a -> CompletionProposalChangedCallback -> m SignalHandlerId
afterCompletionProposalChanged obj cb = liftIO $ do
    let cb' = wrap_CompletionProposalChangedCallback cb
    cb'' <- mk_CompletionProposalChangedCallback cb'
    connectSignalFunPtr obj "changed" cb'' SignalConnectAfter


data CompletionProposalChangedSignalInfo
instance SignalInfo CompletionProposalChangedSignalInfo where
    type HaskellCallbackType CompletionProposalChangedSignalInfo = CompletionProposalChangedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_CompletionProposalChangedCallback cb
        cb'' <- mk_CompletionProposalChangedCallback cb'
        connectSignalFunPtr obj "changed" cb'' connectMode

type instance O.SignalList CompletionProposal = CompletionProposalSignalList
type CompletionProposalSignalList = ('[ '("changed", CompletionProposalChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

foreign import ccall "gtk_source_completion_proposal_get_type"
    c_gtk_source_completion_proposal_get_type :: IO GType

instance GObject CompletionProposal where
    gobjectType _ = c_gtk_source_completion_proposal_get_type
    

class GObject o => IsCompletionProposal o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError CompletionProposal a) =>
    IsCompletionProposal a
#endif
instance IsCompletionProposal CompletionProposal
instance GObject.Object.IsObject CompletionProposal

toCompletionProposal :: IsCompletionProposal o => o -> IO CompletionProposal
toCompletionProposal = unsafeCastTo CompletionProposal

instance O.HasAttributeList CompletionProposal
type instance O.AttributeList CompletionProposal = CompletionProposalAttributeList
type CompletionProposalAttributeList = ('[ ] :: [(Symbol, *)])

type family ResolveCompletionProposalMethod (t :: Symbol) (o :: *) :: * where
    ResolveCompletionProposalMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveCompletionProposalMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveCompletionProposalMethod "changed" o = CompletionProposalChangedMethodInfo
    ResolveCompletionProposalMethod "equal" o = CompletionProposalEqualMethodInfo
    ResolveCompletionProposalMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveCompletionProposalMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveCompletionProposalMethod "hash" o = CompletionProposalHashMethodInfo
    ResolveCompletionProposalMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveCompletionProposalMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveCompletionProposalMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveCompletionProposalMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveCompletionProposalMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveCompletionProposalMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveCompletionProposalMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveCompletionProposalMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveCompletionProposalMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveCompletionProposalMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveCompletionProposalMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveCompletionProposalMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveCompletionProposalMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveCompletionProposalMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveCompletionProposalMethod "getGicon" o = CompletionProposalGetGiconMethodInfo
    ResolveCompletionProposalMethod "getIcon" o = CompletionProposalGetIconMethodInfo
    ResolveCompletionProposalMethod "getIconName" o = CompletionProposalGetIconNameMethodInfo
    ResolveCompletionProposalMethod "getInfo" o = CompletionProposalGetInfoMethodInfo
    ResolveCompletionProposalMethod "getLabel" o = CompletionProposalGetLabelMethodInfo
    ResolveCompletionProposalMethod "getMarkup" o = CompletionProposalGetMarkupMethodInfo
    ResolveCompletionProposalMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveCompletionProposalMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveCompletionProposalMethod "getText" o = CompletionProposalGetTextMethodInfo
    ResolveCompletionProposalMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveCompletionProposalMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveCompletionProposalMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveCompletionProposalMethod t CompletionProposal, O.MethodInfo info CompletionProposal p) => O.IsLabelProxy t (CompletionProposal -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveCompletionProposalMethod t CompletionProposal, O.MethodInfo info CompletionProposal p) => O.IsLabel t (CompletionProposal -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

-- method CompletionProposal::changed
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "proposal", argType = TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSourceCompletionProposal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_changed" gtk_source_completion_proposal_changed :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO ()

{- |
Emits the \"changed\" signal on /@proposal@/. This should be called by
implementations whenever the name, icon or info of the proposal has
changed.
-}
completionProposalChanged ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    {- ^ /@proposal@/: a 'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'. -}
    -> m ()
completionProposalChanged proposal = liftIO $ do
    proposal' <- unsafeManagedPtrCastPtr proposal
    gtk_source_completion_proposal_changed proposal'
    touchManagedPtr proposal
    return ()

data CompletionProposalChangedMethodInfo
instance (signature ~ (m ()), MonadIO m, IsCompletionProposal a) => O.MethodInfo CompletionProposalChangedMethodInfo a signature where
    overloadedMethod _ = completionProposalChanged

-- method CompletionProposal::equal
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "proposal", argType = TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSourceCompletionProposal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "other", argType = TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSourceCompletionProposal.", 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_source_completion_proposal_equal" gtk_source_completion_proposal_equal :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    Ptr CompletionProposal ->               -- other : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO CInt

{- |
Get whether two proposal objects are the same.  This is used to (together
with 'GI.GtkSource.Interfaces.CompletionProposal.completionProposalHash') to match proposals in the
completion model. By default, it uses direct equality ('GI.GLib.Functions.directEqual').
-}
completionProposalEqual ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a, IsCompletionProposal b) =>
    a
    {- ^ /@proposal@/: a 'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'. -}
    -> b
    {- ^ /@other@/: a 'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'. -}
    -> m Bool
    {- ^ __Returns:__ 'True' if /@proposal@/ and /@object@/ are the same proposal -}
completionProposalEqual proposal other = liftIO $ do
    proposal' <- unsafeManagedPtrCastPtr proposal
    other' <- unsafeManagedPtrCastPtr other
    result <- gtk_source_completion_proposal_equal proposal' other'
    let result' = (/= 0) result
    touchManagedPtr proposal
    touchManagedPtr other
    return result'

data CompletionProposalEqualMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsCompletionProposal a, IsCompletionProposal b) => O.MethodInfo CompletionProposalEqualMethodInfo a signature where
    overloadedMethod _ = completionProposalEqual

-- method CompletionProposal::get_gicon
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "proposal", argType = TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSourceCompletionProposal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "Icon"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_get_gicon" gtk_source_completion_proposal_get_gicon :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO (Ptr Gio.Icon.Icon)

{- |
Gets the 'GI.Gio.Interfaces.Icon.Icon' for the icon of /@proposal@/.

@since 3.18
-}
completionProposalGetGicon ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    {- ^ /@proposal@/: a 'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'. -}
    -> m (Maybe Gio.Icon.Icon)
    {- ^ __Returns:__ A 'GI.Gio.Interfaces.Icon.Icon' with the icon of /@proposal@/. -}
completionProposalGetGicon proposal = liftIO $ do
    proposal' <- unsafeManagedPtrCastPtr proposal
    result <- gtk_source_completion_proposal_get_gicon proposal'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newObject Gio.Icon.Icon) result'
        return result''
    touchManagedPtr proposal
    return maybeResult

data CompletionProposalGetGiconMethodInfo
instance (signature ~ (m (Maybe Gio.Icon.Icon)), MonadIO m, IsCompletionProposal a) => O.MethodInfo CompletionProposalGetGiconMethodInfo a signature where
    overloadedMethod _ = completionProposalGetGicon

-- method CompletionProposal::get_icon
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "proposal", argType = TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSourceCompletionProposal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GdkPixbuf", name = "Pixbuf"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_get_icon" gtk_source_completion_proposal_get_icon :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO (Ptr GdkPixbuf.Pixbuf.Pixbuf)

{- |
Gets the 'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf' for the icon of /@proposal@/.
-}
completionProposalGetIcon ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    {- ^ /@proposal@/: a 'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'. -}
    -> m (Maybe GdkPixbuf.Pixbuf.Pixbuf)
    {- ^ __Returns:__ A 'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf' with the icon of /@proposal@/. -}
completionProposalGetIcon proposal = liftIO $ do
    proposal' <- unsafeManagedPtrCastPtr proposal
    result <- gtk_source_completion_proposal_get_icon proposal'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newObject GdkPixbuf.Pixbuf.Pixbuf) result'
        return result''
    touchManagedPtr proposal
    return maybeResult

data CompletionProposalGetIconMethodInfo
instance (signature ~ (m (Maybe GdkPixbuf.Pixbuf.Pixbuf)), MonadIO m, IsCompletionProposal a) => O.MethodInfo CompletionProposalGetIconMethodInfo a signature where
    overloadedMethod _ = completionProposalGetIcon

-- method CompletionProposal::get_icon_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "proposal", argType = TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSourceCompletionProposal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_get_icon_name" gtk_source_completion_proposal_get_icon_name :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO CString

{- |
Gets the icon name of /@proposal@/.

@since 3.18
-}
completionProposalGetIconName ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    {- ^ /@proposal@/: a 'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'. -}
    -> m (Maybe T.Text)
    {- ^ __Returns:__ The icon name of /@proposal@/. -}
completionProposalGetIconName proposal = liftIO $ do
    proposal' <- unsafeManagedPtrCastPtr proposal
    result <- gtk_source_completion_proposal_get_icon_name proposal'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- cstringToText result'
        return result''
    touchManagedPtr proposal
    return maybeResult

data CompletionProposalGetIconNameMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsCompletionProposal a) => O.MethodInfo CompletionProposalGetIconNameMethodInfo a signature where
    overloadedMethod _ = completionProposalGetIconName

-- method CompletionProposal::get_info
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "proposal", argType = TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSourceCompletionProposal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_get_info" gtk_source_completion_proposal_get_info :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO CString

{- |
Gets extra information associated to the proposal. This information will be
used to present the user with extra, detailed information about the
selected proposal. The returned string must be freed with 'GI.GLib.Functions.free'.
-}
completionProposalGetInfo ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    {- ^ /@proposal@/: a 'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'. -}
    -> m (Maybe T.Text)
    {- ^ __Returns:__ a newly-allocated string containing
extra information of /@proposal@/ or 'Nothing' if no extra information is associated
to /@proposal@/. -}
completionProposalGetInfo proposal = liftIO $ do
    proposal' <- unsafeManagedPtrCastPtr proposal
    result <- gtk_source_completion_proposal_get_info proposal'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- cstringToText result'
        freeMem result'
        return result''
    touchManagedPtr proposal
    return maybeResult

data CompletionProposalGetInfoMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsCompletionProposal a) => O.MethodInfo CompletionProposalGetInfoMethodInfo a signature where
    overloadedMethod _ = completionProposalGetInfo

-- method CompletionProposal::get_label
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "proposal", argType = TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSourceCompletionProposal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_get_label" gtk_source_completion_proposal_get_label :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO CString

{- |
Gets the label of /@proposal@/. The label is shown in the list of proposals as
plain text. If you need any markup (such as bold or italic text), you have
to implement 'GI.GtkSource.Interfaces.CompletionProposal.completionProposalGetMarkup'. The returned string
must be freed with 'GI.GLib.Functions.free'.
-}
completionProposalGetLabel ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    {- ^ /@proposal@/: a 'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'. -}
    -> m T.Text
    {- ^ __Returns:__ a new string containing the label of /@proposal@/. -}
completionProposalGetLabel proposal = liftIO $ do
    proposal' <- unsafeManagedPtrCastPtr proposal
    result <- gtk_source_completion_proposal_get_label proposal'
    checkUnexpectedReturnNULL "completionProposalGetLabel" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr proposal
    return result'

data CompletionProposalGetLabelMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCompletionProposal a) => O.MethodInfo CompletionProposalGetLabelMethodInfo a signature where
    overloadedMethod _ = completionProposalGetLabel

-- method CompletionProposal::get_markup
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "proposal", argType = TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSourceCompletionProposal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_get_markup" gtk_source_completion_proposal_get_markup :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO CString

{- |
Gets the label of /@proposal@/ with markup. The label is shown in the list of
proposals and may contain markup. This will be used instead of
'GI.GtkSource.Interfaces.CompletionProposal.completionProposalGetLabel' if implemented. The returned string
must be freed with 'GI.GLib.Functions.free'.
-}
completionProposalGetMarkup ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    {- ^ /@proposal@/: a 'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'. -}
    -> m T.Text
    {- ^ __Returns:__ a new string containing the label of /@proposal@/ with markup. -}
completionProposalGetMarkup proposal = liftIO $ do
    proposal' <- unsafeManagedPtrCastPtr proposal
    result <- gtk_source_completion_proposal_get_markup proposal'
    checkUnexpectedReturnNULL "completionProposalGetMarkup" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr proposal
    return result'

data CompletionProposalGetMarkupMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCompletionProposal a) => O.MethodInfo CompletionProposalGetMarkupMethodInfo a signature where
    overloadedMethod _ = completionProposalGetMarkup

-- method CompletionProposal::get_text
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "proposal", argType = TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSourceCompletionProposal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_get_text" gtk_source_completion_proposal_get_text :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO CString

{- |
Gets the text of /@proposal@/. The text that is inserted into
the text buffer when the proposal is activated by the default activation.
You are free to implement a custom activation handler in the provider and
not implement this function. For more information, see
'GI.GtkSource.Interfaces.CompletionProvider.completionProviderActivateProposal'. The returned string must
be freed with 'GI.GLib.Functions.free'.
-}
completionProposalGetText ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    {- ^ /@proposal@/: a 'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'. -}
    -> m T.Text
    {- ^ __Returns:__ a new string containing the text of /@proposal@/. -}
completionProposalGetText proposal = liftIO $ do
    proposal' <- unsafeManagedPtrCastPtr proposal
    result <- gtk_source_completion_proposal_get_text proposal'
    checkUnexpectedReturnNULL "completionProposalGetText" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr proposal
    return result'

data CompletionProposalGetTextMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCompletionProposal a) => O.MethodInfo CompletionProposalGetTextMethodInfo a signature where
    overloadedMethod _ = completionProposalGetText

-- method CompletionProposal::hash
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "proposal", argType = TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSourceCompletionProposal.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_hash" gtk_source_completion_proposal_hash :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO Word32

{- |
Get the hash value of /@proposal@/. This is used to (together with
'GI.GtkSource.Interfaces.CompletionProposal.completionProposalEqual') to match proposals in the completion
model. By default, it uses a direct hash ('GI.GLib.Functions.directHash').
-}
completionProposalHash ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    {- ^ /@proposal@/: a 'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'. -}
    -> m Word32
    {- ^ __Returns:__ The hash value of /@proposal@/. -}
completionProposalHash proposal = liftIO $ do
    proposal' <- unsafeManagedPtrCastPtr proposal
    result <- gtk_source_completion_proposal_hash proposal'
    touchManagedPtr proposal
    return result

data CompletionProposalHashMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsCompletionProposal a) => O.MethodInfo CompletionProposalHashMethodInfo a signature where
    overloadedMethod _ = completionProposalHash