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

'GI.Gtk.Objects.EntryCompletion.EntryCompletion' is an auxiliary object to be used in conjunction with
'GI.Gtk.Objects.Entry.Entry' to provide the completion functionality. It implements the
'GI.Gtk.Interfaces.CellLayout.CellLayout' interface, to allow the user to add extra cells to the
'GI.Gtk.Objects.TreeView.TreeView' with completion matches.

“Completion functionality” means that when the user modifies the text
in the entry, 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' checks which rows in the model match
the current content of the entry, and displays a list of matches.
By default, the matching is done by comparing the entry text
case-insensitively against the text column of the model (see
'GI.Gtk.Objects.EntryCompletion.entryCompletionSetTextColumn'), but this can be overridden
with a custom match function (see 'GI.Gtk.Objects.EntryCompletion.entryCompletionSetMatchFunc').

When the user selects a completion, the content of the entry is
updated. By default, the content of the entry is replaced by the
text column of the model, but this can be overridden by connecting
to the 'GI.Gtk.Objects.EntryCompletion.EntryCompletion'::@/match-selected/@ signal and updating the
entry in the signal handler. Note that you should return 'True' from
the signal handler to suppress the default behaviour.

To add completion functionality to an entry, use 'GI.Gtk.Objects.Entry.entrySetCompletion'.

In addition to regular completion matches, which will be inserted into the
entry when they are selected, 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' also allows to display
“actions” in the popup window. Their appearance is similar to menuitems,
to differentiate them clearly from completion strings. When an action is
selected, the 'GI.Gtk.Objects.EntryCompletion.EntryCompletion'::@/action-activated/@ signal is emitted.

GtkEntryCompletion uses a 'GI.Gtk.Objects.TreeModelFilter.TreeModelFilter' model to represent the
subset of the entire model that is currently matching. While the
GtkEntryCompletion signals 'GI.Gtk.Objects.EntryCompletion.EntryCompletion'::@/match-selected/@ and
'GI.Gtk.Objects.EntryCompletion.EntryCompletion'::@/cursor-on-match/@ take the original model and an
iter pointing to that model as arguments, other callbacks and signals
(such as @/GtkCellLayoutDataFuncs/@ or 'GI.Gtk.Objects.CellArea.CellArea'::@/apply-attributes/@)
will generally take the filter model as argument. As long as you are
only calling @/gtk_tree_model_get()/@, this will make no difference to
you. If for some reason, you need the original model, use
'GI.Gtk.Objects.TreeModelFilter.treeModelFilterGetModel'. Don’t forget to use
'GI.Gtk.Objects.TreeModelFilter.treeModelFilterConvertIterToChildIter' to obtain a
matching iter.
-}

module GI.Gtk.Objects.EntryCompletion
    ( 

-- * Exported types
    EntryCompletion(..)                     ,
    IsEntryCompletion                       ,
    toEntryCompletion                       ,
    noEntryCompletion                       ,


 -- * Methods
-- ** complete #method:complete#
    EntryCompletionCompleteMethodInfo       ,
    entryCompletionComplete                 ,


-- ** computePrefix #method:computePrefix#
    EntryCompletionComputePrefixMethodInfo  ,
    entryCompletionComputePrefix            ,


-- ** deleteAction #method:deleteAction#
    EntryCompletionDeleteActionMethodInfo   ,
    entryCompletionDeleteAction             ,


-- ** getCompletionPrefix #method:getCompletionPrefix#
    EntryCompletionGetCompletionPrefixMethodInfo,
    entryCompletionGetCompletionPrefix      ,


-- ** getEntry #method:getEntry#
    EntryCompletionGetEntryMethodInfo       ,
    entryCompletionGetEntry                 ,


-- ** getInlineCompletion #method:getInlineCompletion#
    EntryCompletionGetInlineCompletionMethodInfo,
    entryCompletionGetInlineCompletion      ,


-- ** getInlineSelection #method:getInlineSelection#
    EntryCompletionGetInlineSelectionMethodInfo,
    entryCompletionGetInlineSelection       ,


-- ** getMinimumKeyLength #method:getMinimumKeyLength#
    EntryCompletionGetMinimumKeyLengthMethodInfo,
    entryCompletionGetMinimumKeyLength      ,


-- ** getModel #method:getModel#
    EntryCompletionGetModelMethodInfo       ,
    entryCompletionGetModel                 ,


-- ** getPopupCompletion #method:getPopupCompletion#
    EntryCompletionGetPopupCompletionMethodInfo,
    entryCompletionGetPopupCompletion       ,


-- ** getPopupSetWidth #method:getPopupSetWidth#
    EntryCompletionGetPopupSetWidthMethodInfo,
    entryCompletionGetPopupSetWidth         ,


-- ** getPopupSingleMatch #method:getPopupSingleMatch#
    EntryCompletionGetPopupSingleMatchMethodInfo,
    entryCompletionGetPopupSingleMatch      ,


-- ** getTextColumn #method:getTextColumn#
    EntryCompletionGetTextColumnMethodInfo  ,
    entryCompletionGetTextColumn            ,


-- ** insertActionMarkup #method:insertActionMarkup#
    EntryCompletionInsertActionMarkupMethodInfo,
    entryCompletionInsertActionMarkup       ,


-- ** insertActionText #method:insertActionText#
    EntryCompletionInsertActionTextMethodInfo,
    entryCompletionInsertActionText         ,


-- ** insertPrefix #method:insertPrefix#
    EntryCompletionInsertPrefixMethodInfo   ,
    entryCompletionInsertPrefix             ,


-- ** new #method:new#
    entryCompletionNew                      ,


-- ** newWithArea #method:newWithArea#
    entryCompletionNewWithArea              ,


-- ** setInlineCompletion #method:setInlineCompletion#
    EntryCompletionSetInlineCompletionMethodInfo,
    entryCompletionSetInlineCompletion      ,


-- ** setInlineSelection #method:setInlineSelection#
    EntryCompletionSetInlineSelectionMethodInfo,
    entryCompletionSetInlineSelection       ,


-- ** setMatchFunc #method:setMatchFunc#
    EntryCompletionSetMatchFuncMethodInfo   ,
    entryCompletionSetMatchFunc             ,


-- ** setMinimumKeyLength #method:setMinimumKeyLength#
    EntryCompletionSetMinimumKeyLengthMethodInfo,
    entryCompletionSetMinimumKeyLength      ,


-- ** setModel #method:setModel#
    EntryCompletionSetModelMethodInfo       ,
    entryCompletionSetModel                 ,


-- ** setPopupCompletion #method:setPopupCompletion#
    EntryCompletionSetPopupCompletionMethodInfo,
    entryCompletionSetPopupCompletion       ,


-- ** setPopupSetWidth #method:setPopupSetWidth#
    EntryCompletionSetPopupSetWidthMethodInfo,
    entryCompletionSetPopupSetWidth         ,


-- ** setPopupSingleMatch #method:setPopupSingleMatch#
    EntryCompletionSetPopupSingleMatchMethodInfo,
    entryCompletionSetPopupSingleMatch      ,


-- ** setTextColumn #method:setTextColumn#
    EntryCompletionSetTextColumnMethodInfo  ,
    entryCompletionSetTextColumn            ,




 -- * Properties
-- ** cellArea #attr:cellArea#
    EntryCompletionCellAreaPropertyInfo     ,
    constructEntryCompletionCellArea        ,
    entryCompletionCellArea                 ,
    getEntryCompletionCellArea              ,


-- ** inlineCompletion #attr:inlineCompletion#
    EntryCompletionInlineCompletionPropertyInfo,
    constructEntryCompletionInlineCompletion,
    entryCompletionInlineCompletion         ,
    getEntryCompletionInlineCompletion      ,
    setEntryCompletionInlineCompletion      ,


-- ** inlineSelection #attr:inlineSelection#
    EntryCompletionInlineSelectionPropertyInfo,
    constructEntryCompletionInlineSelection ,
    entryCompletionInlineSelection          ,
    getEntryCompletionInlineSelection       ,
    setEntryCompletionInlineSelection       ,


-- ** minimumKeyLength #attr:minimumKeyLength#
    EntryCompletionMinimumKeyLengthPropertyInfo,
    constructEntryCompletionMinimumKeyLength,
    entryCompletionMinimumKeyLength         ,
    getEntryCompletionMinimumKeyLength      ,
    setEntryCompletionMinimumKeyLength      ,


-- ** model #attr:model#
    EntryCompletionModelPropertyInfo        ,
    clearEntryCompletionModel               ,
    constructEntryCompletionModel           ,
    entryCompletionModel                    ,
    getEntryCompletionModel                 ,
    setEntryCompletionModel                 ,


-- ** popupCompletion #attr:popupCompletion#
    EntryCompletionPopupCompletionPropertyInfo,
    constructEntryCompletionPopupCompletion ,
    entryCompletionPopupCompletion          ,
    getEntryCompletionPopupCompletion       ,
    setEntryCompletionPopupCompletion       ,


-- ** popupSetWidth #attr:popupSetWidth#
    EntryCompletionPopupSetWidthPropertyInfo,
    constructEntryCompletionPopupSetWidth   ,
    entryCompletionPopupSetWidth            ,
    getEntryCompletionPopupSetWidth         ,
    setEntryCompletionPopupSetWidth         ,


-- ** popupSingleMatch #attr:popupSingleMatch#
    EntryCompletionPopupSingleMatchPropertyInfo,
    constructEntryCompletionPopupSingleMatch,
    entryCompletionPopupSingleMatch         ,
    getEntryCompletionPopupSingleMatch      ,
    setEntryCompletionPopupSingleMatch      ,


-- ** textColumn #attr:textColumn#
    EntryCompletionTextColumnPropertyInfo   ,
    constructEntryCompletionTextColumn      ,
    entryCompletionTextColumn               ,
    getEntryCompletionTextColumn            ,
    setEntryCompletionTextColumn            ,




 -- * Signals
-- ** actionActivated #signal:actionActivated#
    C_EntryCompletionActionActivatedCallback,
    EntryCompletionActionActivatedCallback  ,
    EntryCompletionActionActivatedSignalInfo,
    afterEntryCompletionActionActivated     ,
    genClosure_EntryCompletionActionActivated,
    mk_EntryCompletionActionActivatedCallback,
    noEntryCompletionActionActivatedCallback,
    onEntryCompletionActionActivated        ,
    wrap_EntryCompletionActionActivatedCallback,


-- ** cursorOnMatch #signal:cursorOnMatch#
    C_EntryCompletionCursorOnMatchCallback  ,
    EntryCompletionCursorOnMatchCallback    ,
    EntryCompletionCursorOnMatchSignalInfo  ,
    afterEntryCompletionCursorOnMatch       ,
    genClosure_EntryCompletionCursorOnMatch ,
    mk_EntryCompletionCursorOnMatchCallback ,
    noEntryCompletionCursorOnMatchCallback  ,
    onEntryCompletionCursorOnMatch          ,
    wrap_EntryCompletionCursorOnMatchCallback,


-- ** insertPrefix #signal:insertPrefix#
    C_EntryCompletionInsertPrefixCallback   ,
    EntryCompletionInsertPrefixCallback     ,
    EntryCompletionInsertPrefixSignalInfo   ,
    afterEntryCompletionInsertPrefix        ,
    genClosure_EntryCompletionInsertPrefix  ,
    mk_EntryCompletionInsertPrefixCallback  ,
    noEntryCompletionInsertPrefixCallback   ,
    onEntryCompletionInsertPrefix           ,
    wrap_EntryCompletionInsertPrefixCallback,


-- ** matchSelected #signal:matchSelected#
    C_EntryCompletionMatchSelectedCallback  ,
    EntryCompletionMatchSelectedCallback    ,
    EntryCompletionMatchSelectedSignalInfo  ,
    afterEntryCompletionMatchSelected       ,
    genClosure_EntryCompletionMatchSelected ,
    mk_EntryCompletionMatchSelectedCallback ,
    noEntryCompletionMatchSelectedCallback  ,
    onEntryCompletionMatchSelected          ,
    wrap_EntryCompletionMatchSelectedCallback,


-- ** noMatches #signal:noMatches#
    C_EntryCompletionNoMatchesCallback      ,
    EntryCompletionNoMatchesCallback        ,
    EntryCompletionNoMatchesSignalInfo      ,
    afterEntryCompletionNoMatches           ,
    genClosure_EntryCompletionNoMatches     ,
    mk_EntryCompletionNoMatchesCallback     ,
    noEntryCompletionNoMatchesCallback      ,
    onEntryCompletionNoMatches              ,
    wrap_EntryCompletionNoMatchesCallback   ,




    ) 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.GLib.Callbacks as GLib.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gtk.Callbacks as Gtk.Callbacks
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Buildable as Gtk.Buildable
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.CellLayout as Gtk.CellLayout
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.TreeModel as Gtk.TreeModel
import {-# SOURCE #-} qualified GI.Gtk.Objects.CellArea as Gtk.CellArea
import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget
import {-# SOURCE #-} qualified GI.Gtk.Structs.TreeIter as Gtk.TreeIter

newtype EntryCompletion = EntryCompletion (ManagedPtr EntryCompletion)
foreign import ccall "gtk_entry_completion_get_type"
    c_gtk_entry_completion_get_type :: IO GType

instance GObject EntryCompletion where
    gobjectType _ = c_gtk_entry_completion_get_type
    

class GObject o => IsEntryCompletion o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError EntryCompletion a) =>
    IsEntryCompletion a
#endif
instance IsEntryCompletion EntryCompletion
instance GObject.Object.IsObject EntryCompletion
instance Gtk.Buildable.IsBuildable EntryCompletion
instance Gtk.CellLayout.IsCellLayout EntryCompletion

toEntryCompletion :: IsEntryCompletion o => o -> IO EntryCompletion
toEntryCompletion = unsafeCastTo EntryCompletion

noEntryCompletion :: Maybe EntryCompletion
noEntryCompletion = Nothing

type family ResolveEntryCompletionMethod (t :: Symbol) (o :: *) :: * where
    ResolveEntryCompletionMethod "addAttribute" o = Gtk.CellLayout.CellLayoutAddAttributeMethodInfo
    ResolveEntryCompletionMethod "addChild" o = Gtk.Buildable.BuildableAddChildMethodInfo
    ResolveEntryCompletionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveEntryCompletionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveEntryCompletionMethod "clear" o = Gtk.CellLayout.CellLayoutClearMethodInfo
    ResolveEntryCompletionMethod "clearAttributes" o = Gtk.CellLayout.CellLayoutClearAttributesMethodInfo
    ResolveEntryCompletionMethod "complete" o = EntryCompletionCompleteMethodInfo
    ResolveEntryCompletionMethod "computePrefix" o = EntryCompletionComputePrefixMethodInfo
    ResolveEntryCompletionMethod "constructChild" o = Gtk.Buildable.BuildableConstructChildMethodInfo
    ResolveEntryCompletionMethod "customFinished" o = Gtk.Buildable.BuildableCustomFinishedMethodInfo
    ResolveEntryCompletionMethod "customTagEnd" o = Gtk.Buildable.BuildableCustomTagEndMethodInfo
    ResolveEntryCompletionMethod "customTagStart" o = Gtk.Buildable.BuildableCustomTagStartMethodInfo
    ResolveEntryCompletionMethod "deleteAction" o = EntryCompletionDeleteActionMethodInfo
    ResolveEntryCompletionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveEntryCompletionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveEntryCompletionMethod "insertActionMarkup" o = EntryCompletionInsertActionMarkupMethodInfo
    ResolveEntryCompletionMethod "insertActionText" o = EntryCompletionInsertActionTextMethodInfo
    ResolveEntryCompletionMethod "insertPrefix" o = EntryCompletionInsertPrefixMethodInfo
    ResolveEntryCompletionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveEntryCompletionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveEntryCompletionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveEntryCompletionMethod "packEnd" o = Gtk.CellLayout.CellLayoutPackEndMethodInfo
    ResolveEntryCompletionMethod "packStart" o = Gtk.CellLayout.CellLayoutPackStartMethodInfo
    ResolveEntryCompletionMethod "parserFinished" o = Gtk.Buildable.BuildableParserFinishedMethodInfo
    ResolveEntryCompletionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveEntryCompletionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveEntryCompletionMethod "reorder" o = Gtk.CellLayout.CellLayoutReorderMethodInfo
    ResolveEntryCompletionMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveEntryCompletionMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveEntryCompletionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveEntryCompletionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveEntryCompletionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveEntryCompletionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveEntryCompletionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveEntryCompletionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveEntryCompletionMethod "getArea" o = Gtk.CellLayout.CellLayoutGetAreaMethodInfo
    ResolveEntryCompletionMethod "getCells" o = Gtk.CellLayout.CellLayoutGetCellsMethodInfo
    ResolveEntryCompletionMethod "getCompletionPrefix" o = EntryCompletionGetCompletionPrefixMethodInfo
    ResolveEntryCompletionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveEntryCompletionMethod "getEntry" o = EntryCompletionGetEntryMethodInfo
    ResolveEntryCompletionMethod "getInlineCompletion" o = EntryCompletionGetInlineCompletionMethodInfo
    ResolveEntryCompletionMethod "getInlineSelection" o = EntryCompletionGetInlineSelectionMethodInfo
    ResolveEntryCompletionMethod "getInternalChild" o = Gtk.Buildable.BuildableGetInternalChildMethodInfo
    ResolveEntryCompletionMethod "getMinimumKeyLength" o = EntryCompletionGetMinimumKeyLengthMethodInfo
    ResolveEntryCompletionMethod "getModel" o = EntryCompletionGetModelMethodInfo
    ResolveEntryCompletionMethod "getName" o = Gtk.Buildable.BuildableGetNameMethodInfo
    ResolveEntryCompletionMethod "getPopupCompletion" o = EntryCompletionGetPopupCompletionMethodInfo
    ResolveEntryCompletionMethod "getPopupSetWidth" o = EntryCompletionGetPopupSetWidthMethodInfo
    ResolveEntryCompletionMethod "getPopupSingleMatch" o = EntryCompletionGetPopupSingleMatchMethodInfo
    ResolveEntryCompletionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveEntryCompletionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveEntryCompletionMethod "getTextColumn" o = EntryCompletionGetTextColumnMethodInfo
    ResolveEntryCompletionMethod "setBuildableProperty" o = Gtk.Buildable.BuildableSetBuildablePropertyMethodInfo
    ResolveEntryCompletionMethod "setCellDataFunc" o = Gtk.CellLayout.CellLayoutSetCellDataFuncMethodInfo
    ResolveEntryCompletionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveEntryCompletionMethod "setInlineCompletion" o = EntryCompletionSetInlineCompletionMethodInfo
    ResolveEntryCompletionMethod "setInlineSelection" o = EntryCompletionSetInlineSelectionMethodInfo
    ResolveEntryCompletionMethod "setMatchFunc" o = EntryCompletionSetMatchFuncMethodInfo
    ResolveEntryCompletionMethod "setMinimumKeyLength" o = EntryCompletionSetMinimumKeyLengthMethodInfo
    ResolveEntryCompletionMethod "setModel" o = EntryCompletionSetModelMethodInfo
    ResolveEntryCompletionMethod "setName" o = Gtk.Buildable.BuildableSetNameMethodInfo
    ResolveEntryCompletionMethod "setPopupCompletion" o = EntryCompletionSetPopupCompletionMethodInfo
    ResolveEntryCompletionMethod "setPopupSetWidth" o = EntryCompletionSetPopupSetWidthMethodInfo
    ResolveEntryCompletionMethod "setPopupSingleMatch" o = EntryCompletionSetPopupSingleMatchMethodInfo
    ResolveEntryCompletionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveEntryCompletionMethod "setTextColumn" o = EntryCompletionSetTextColumnMethodInfo
    ResolveEntryCompletionMethod l o = O.MethodResolutionFailed l o

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

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

-- signal EntryCompletion::action-activated
type EntryCompletionActionActivatedCallback =
    Int32 ->
    IO ()

noEntryCompletionActionActivatedCallback :: Maybe EntryCompletionActionActivatedCallback
noEntryCompletionActionActivatedCallback = Nothing

type C_EntryCompletionActionActivatedCallback =
    Ptr () ->                               -- object
    Int32 ->
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_EntryCompletionActionActivatedCallback :: C_EntryCompletionActionActivatedCallback -> IO (FunPtr C_EntryCompletionActionActivatedCallback)

genClosure_EntryCompletionActionActivated :: EntryCompletionActionActivatedCallback -> IO Closure
genClosure_EntryCompletionActionActivated cb = do
    let cb' = wrap_EntryCompletionActionActivatedCallback cb
    mk_EntryCompletionActionActivatedCallback cb' >>= newCClosure


wrap_EntryCompletionActionActivatedCallback ::
    EntryCompletionActionActivatedCallback ->
    Ptr () ->
    Int32 ->
    Ptr () ->
    IO ()
wrap_EntryCompletionActionActivatedCallback _cb _ index _ = do
    _cb  index


onEntryCompletionActionActivated :: (GObject a, MonadIO m) => a -> EntryCompletionActionActivatedCallback -> m SignalHandlerId
onEntryCompletionActionActivated obj cb = liftIO $ connectEntryCompletionActionActivated obj cb SignalConnectBefore
afterEntryCompletionActionActivated :: (GObject a, MonadIO m) => a -> EntryCompletionActionActivatedCallback -> m SignalHandlerId
afterEntryCompletionActionActivated obj cb = connectEntryCompletionActionActivated obj cb SignalConnectAfter

connectEntryCompletionActionActivated :: (GObject a, MonadIO m) =>
                                         a -> EntryCompletionActionActivatedCallback -> SignalConnectMode -> m SignalHandlerId
connectEntryCompletionActionActivated obj cb after = liftIO $ do
    let cb' = wrap_EntryCompletionActionActivatedCallback cb
    cb'' <- mk_EntryCompletionActionActivatedCallback cb'
    connectSignalFunPtr obj "action-activated" cb'' after

-- signal EntryCompletion::cursor-on-match
type EntryCompletionCursorOnMatchCallback =
    Gtk.TreeModel.TreeModel ->
    Gtk.TreeIter.TreeIter ->
    IO Bool

noEntryCompletionCursorOnMatchCallback :: Maybe EntryCompletionCursorOnMatchCallback
noEntryCompletionCursorOnMatchCallback = Nothing

type C_EntryCompletionCursorOnMatchCallback =
    Ptr () ->                               -- object
    Ptr Gtk.TreeModel.TreeModel ->
    Ptr Gtk.TreeIter.TreeIter ->
    Ptr () ->                               -- user_data
    IO CInt

foreign import ccall "wrapper"
    mk_EntryCompletionCursorOnMatchCallback :: C_EntryCompletionCursorOnMatchCallback -> IO (FunPtr C_EntryCompletionCursorOnMatchCallback)

genClosure_EntryCompletionCursorOnMatch :: EntryCompletionCursorOnMatchCallback -> IO Closure
genClosure_EntryCompletionCursorOnMatch cb = do
    let cb' = wrap_EntryCompletionCursorOnMatchCallback cb
    mk_EntryCompletionCursorOnMatchCallback cb' >>= newCClosure


wrap_EntryCompletionCursorOnMatchCallback ::
    EntryCompletionCursorOnMatchCallback ->
    Ptr () ->
    Ptr Gtk.TreeModel.TreeModel ->
    Ptr Gtk.TreeIter.TreeIter ->
    Ptr () ->
    IO CInt
wrap_EntryCompletionCursorOnMatchCallback _cb _ model iter _ = do
    model' <- (newObject Gtk.TreeModel.TreeModel) model
    iter' <- (newBoxed Gtk.TreeIter.TreeIter) iter
    result <- _cb  model' iter'
    let result' = (fromIntegral . fromEnum) result
    return result'


onEntryCompletionCursorOnMatch :: (GObject a, MonadIO m) => a -> EntryCompletionCursorOnMatchCallback -> m SignalHandlerId
onEntryCompletionCursorOnMatch obj cb = liftIO $ connectEntryCompletionCursorOnMatch obj cb SignalConnectBefore
afterEntryCompletionCursorOnMatch :: (GObject a, MonadIO m) => a -> EntryCompletionCursorOnMatchCallback -> m SignalHandlerId
afterEntryCompletionCursorOnMatch obj cb = connectEntryCompletionCursorOnMatch obj cb SignalConnectAfter

connectEntryCompletionCursorOnMatch :: (GObject a, MonadIO m) =>
                                       a -> EntryCompletionCursorOnMatchCallback -> SignalConnectMode -> m SignalHandlerId
connectEntryCompletionCursorOnMatch obj cb after = liftIO $ do
    let cb' = wrap_EntryCompletionCursorOnMatchCallback cb
    cb'' <- mk_EntryCompletionCursorOnMatchCallback cb'
    connectSignalFunPtr obj "cursor-on-match" cb'' after

-- signal EntryCompletion::insert-prefix
type EntryCompletionInsertPrefixCallback =
    T.Text ->
    IO Bool

noEntryCompletionInsertPrefixCallback :: Maybe EntryCompletionInsertPrefixCallback
noEntryCompletionInsertPrefixCallback = Nothing

type C_EntryCompletionInsertPrefixCallback =
    Ptr () ->                               -- object
    CString ->
    Ptr () ->                               -- user_data
    IO CInt

foreign import ccall "wrapper"
    mk_EntryCompletionInsertPrefixCallback :: C_EntryCompletionInsertPrefixCallback -> IO (FunPtr C_EntryCompletionInsertPrefixCallback)

genClosure_EntryCompletionInsertPrefix :: EntryCompletionInsertPrefixCallback -> IO Closure
genClosure_EntryCompletionInsertPrefix cb = do
    let cb' = wrap_EntryCompletionInsertPrefixCallback cb
    mk_EntryCompletionInsertPrefixCallback cb' >>= newCClosure


wrap_EntryCompletionInsertPrefixCallback ::
    EntryCompletionInsertPrefixCallback ->
    Ptr () ->
    CString ->
    Ptr () ->
    IO CInt
wrap_EntryCompletionInsertPrefixCallback _cb _ prefix _ = do
    prefix' <- cstringToText prefix
    result <- _cb  prefix'
    let result' = (fromIntegral . fromEnum) result
    return result'


onEntryCompletionInsertPrefix :: (GObject a, MonadIO m) => a -> EntryCompletionInsertPrefixCallback -> m SignalHandlerId
onEntryCompletionInsertPrefix obj cb = liftIO $ connectEntryCompletionInsertPrefix obj cb SignalConnectBefore
afterEntryCompletionInsertPrefix :: (GObject a, MonadIO m) => a -> EntryCompletionInsertPrefixCallback -> m SignalHandlerId
afterEntryCompletionInsertPrefix obj cb = connectEntryCompletionInsertPrefix obj cb SignalConnectAfter

connectEntryCompletionInsertPrefix :: (GObject a, MonadIO m) =>
                                      a -> EntryCompletionInsertPrefixCallback -> SignalConnectMode -> m SignalHandlerId
connectEntryCompletionInsertPrefix obj cb after = liftIO $ do
    let cb' = wrap_EntryCompletionInsertPrefixCallback cb
    cb'' <- mk_EntryCompletionInsertPrefixCallback cb'
    connectSignalFunPtr obj "insert-prefix" cb'' after

-- signal EntryCompletion::match-selected
type EntryCompletionMatchSelectedCallback =
    Gtk.TreeModel.TreeModel ->
    Gtk.TreeIter.TreeIter ->
    IO Bool

noEntryCompletionMatchSelectedCallback :: Maybe EntryCompletionMatchSelectedCallback
noEntryCompletionMatchSelectedCallback = Nothing

type C_EntryCompletionMatchSelectedCallback =
    Ptr () ->                               -- object
    Ptr Gtk.TreeModel.TreeModel ->
    Ptr Gtk.TreeIter.TreeIter ->
    Ptr () ->                               -- user_data
    IO CInt

foreign import ccall "wrapper"
    mk_EntryCompletionMatchSelectedCallback :: C_EntryCompletionMatchSelectedCallback -> IO (FunPtr C_EntryCompletionMatchSelectedCallback)

genClosure_EntryCompletionMatchSelected :: EntryCompletionMatchSelectedCallback -> IO Closure
genClosure_EntryCompletionMatchSelected cb = do
    let cb' = wrap_EntryCompletionMatchSelectedCallback cb
    mk_EntryCompletionMatchSelectedCallback cb' >>= newCClosure


wrap_EntryCompletionMatchSelectedCallback ::
    EntryCompletionMatchSelectedCallback ->
    Ptr () ->
    Ptr Gtk.TreeModel.TreeModel ->
    Ptr Gtk.TreeIter.TreeIter ->
    Ptr () ->
    IO CInt
wrap_EntryCompletionMatchSelectedCallback _cb _ model iter _ = do
    model' <- (newObject Gtk.TreeModel.TreeModel) model
    iter' <- (newBoxed Gtk.TreeIter.TreeIter) iter
    result <- _cb  model' iter'
    let result' = (fromIntegral . fromEnum) result
    return result'


onEntryCompletionMatchSelected :: (GObject a, MonadIO m) => a -> EntryCompletionMatchSelectedCallback -> m SignalHandlerId
onEntryCompletionMatchSelected obj cb = liftIO $ connectEntryCompletionMatchSelected obj cb SignalConnectBefore
afterEntryCompletionMatchSelected :: (GObject a, MonadIO m) => a -> EntryCompletionMatchSelectedCallback -> m SignalHandlerId
afterEntryCompletionMatchSelected obj cb = connectEntryCompletionMatchSelected obj cb SignalConnectAfter

connectEntryCompletionMatchSelected :: (GObject a, MonadIO m) =>
                                       a -> EntryCompletionMatchSelectedCallback -> SignalConnectMode -> m SignalHandlerId
connectEntryCompletionMatchSelected obj cb after = liftIO $ do
    let cb' = wrap_EntryCompletionMatchSelectedCallback cb
    cb'' <- mk_EntryCompletionMatchSelectedCallback cb'
    connectSignalFunPtr obj "match-selected" cb'' after

-- signal EntryCompletion::no-matches
type EntryCompletionNoMatchesCallback =
    IO ()

noEntryCompletionNoMatchesCallback :: Maybe EntryCompletionNoMatchesCallback
noEntryCompletionNoMatchesCallback = Nothing

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

foreign import ccall "wrapper"
    mk_EntryCompletionNoMatchesCallback :: C_EntryCompletionNoMatchesCallback -> IO (FunPtr C_EntryCompletionNoMatchesCallback)

genClosure_EntryCompletionNoMatches :: EntryCompletionNoMatchesCallback -> IO Closure
genClosure_EntryCompletionNoMatches cb = do
    let cb' = wrap_EntryCompletionNoMatchesCallback cb
    mk_EntryCompletionNoMatchesCallback cb' >>= newCClosure


wrap_EntryCompletionNoMatchesCallback ::
    EntryCompletionNoMatchesCallback ->
    Ptr () ->
    Ptr () ->
    IO ()
wrap_EntryCompletionNoMatchesCallback _cb _ _ = do
    _cb 


onEntryCompletionNoMatches :: (GObject a, MonadIO m) => a -> EntryCompletionNoMatchesCallback -> m SignalHandlerId
onEntryCompletionNoMatches obj cb = liftIO $ connectEntryCompletionNoMatches obj cb SignalConnectBefore
afterEntryCompletionNoMatches :: (GObject a, MonadIO m) => a -> EntryCompletionNoMatchesCallback -> m SignalHandlerId
afterEntryCompletionNoMatches obj cb = connectEntryCompletionNoMatches obj cb SignalConnectAfter

connectEntryCompletionNoMatches :: (GObject a, MonadIO m) =>
                                   a -> EntryCompletionNoMatchesCallback -> SignalConnectMode -> m SignalHandlerId
connectEntryCompletionNoMatches obj cb after = liftIO $ do
    let cb' = wrap_EntryCompletionNoMatchesCallback cb
    cb'' <- mk_EntryCompletionNoMatchesCallback cb'
    connectSignalFunPtr obj "no-matches" cb'' after

-- VVV Prop "cell-area"
   -- Type: TInterface (Name {namespace = "Gtk", name = "CellArea"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getEntryCompletionCellArea :: (MonadIO m, IsEntryCompletion o) => o -> m (Maybe Gtk.CellArea.CellArea)
getEntryCompletionCellArea obj = liftIO $ getObjectPropertyObject obj "cell-area" Gtk.CellArea.CellArea

constructEntryCompletionCellArea :: (IsEntryCompletion o, Gtk.CellArea.IsCellArea a) => a -> IO (GValueConstruct o)
constructEntryCompletionCellArea val = constructObjectPropertyObject "cell-area" (Just val)

data EntryCompletionCellAreaPropertyInfo
instance AttrInfo EntryCompletionCellAreaPropertyInfo where
    type AttrAllowedOps EntryCompletionCellAreaPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint EntryCompletionCellAreaPropertyInfo = Gtk.CellArea.IsCellArea
    type AttrBaseTypeConstraint EntryCompletionCellAreaPropertyInfo = IsEntryCompletion
    type AttrGetType EntryCompletionCellAreaPropertyInfo = (Maybe Gtk.CellArea.CellArea)
    type AttrLabel EntryCompletionCellAreaPropertyInfo = "cell-area"
    type AttrOrigin EntryCompletionCellAreaPropertyInfo = EntryCompletion
    attrGet _ = getEntryCompletionCellArea
    attrSet _ = undefined
    attrConstruct _ = constructEntryCompletionCellArea
    attrClear _ = undefined

-- VVV Prop "inline-completion"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getEntryCompletionInlineCompletion :: (MonadIO m, IsEntryCompletion o) => o -> m Bool
getEntryCompletionInlineCompletion obj = liftIO $ getObjectPropertyBool obj "inline-completion"

setEntryCompletionInlineCompletion :: (MonadIO m, IsEntryCompletion o) => o -> Bool -> m ()
setEntryCompletionInlineCompletion obj val = liftIO $ setObjectPropertyBool obj "inline-completion" val

constructEntryCompletionInlineCompletion :: (IsEntryCompletion o) => Bool -> IO (GValueConstruct o)
constructEntryCompletionInlineCompletion val = constructObjectPropertyBool "inline-completion" val

data EntryCompletionInlineCompletionPropertyInfo
instance AttrInfo EntryCompletionInlineCompletionPropertyInfo where
    type AttrAllowedOps EntryCompletionInlineCompletionPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint EntryCompletionInlineCompletionPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint EntryCompletionInlineCompletionPropertyInfo = IsEntryCompletion
    type AttrGetType EntryCompletionInlineCompletionPropertyInfo = Bool
    type AttrLabel EntryCompletionInlineCompletionPropertyInfo = "inline-completion"
    type AttrOrigin EntryCompletionInlineCompletionPropertyInfo = EntryCompletion
    attrGet _ = getEntryCompletionInlineCompletion
    attrSet _ = setEntryCompletionInlineCompletion
    attrConstruct _ = constructEntryCompletionInlineCompletion
    attrClear _ = undefined

-- VVV Prop "inline-selection"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getEntryCompletionInlineSelection :: (MonadIO m, IsEntryCompletion o) => o -> m Bool
getEntryCompletionInlineSelection obj = liftIO $ getObjectPropertyBool obj "inline-selection"

setEntryCompletionInlineSelection :: (MonadIO m, IsEntryCompletion o) => o -> Bool -> m ()
setEntryCompletionInlineSelection obj val = liftIO $ setObjectPropertyBool obj "inline-selection" val

constructEntryCompletionInlineSelection :: (IsEntryCompletion o) => Bool -> IO (GValueConstruct o)
constructEntryCompletionInlineSelection val = constructObjectPropertyBool "inline-selection" val

data EntryCompletionInlineSelectionPropertyInfo
instance AttrInfo EntryCompletionInlineSelectionPropertyInfo where
    type AttrAllowedOps EntryCompletionInlineSelectionPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint EntryCompletionInlineSelectionPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint EntryCompletionInlineSelectionPropertyInfo = IsEntryCompletion
    type AttrGetType EntryCompletionInlineSelectionPropertyInfo = Bool
    type AttrLabel EntryCompletionInlineSelectionPropertyInfo = "inline-selection"
    type AttrOrigin EntryCompletionInlineSelectionPropertyInfo = EntryCompletion
    attrGet _ = getEntryCompletionInlineSelection
    attrSet _ = setEntryCompletionInlineSelection
    attrConstruct _ = constructEntryCompletionInlineSelection
    attrClear _ = undefined

-- VVV Prop "minimum-key-length"
   -- Type: TBasicType TInt
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getEntryCompletionMinimumKeyLength :: (MonadIO m, IsEntryCompletion o) => o -> m Int32
getEntryCompletionMinimumKeyLength obj = liftIO $ getObjectPropertyInt32 obj "minimum-key-length"

setEntryCompletionMinimumKeyLength :: (MonadIO m, IsEntryCompletion o) => o -> Int32 -> m ()
setEntryCompletionMinimumKeyLength obj val = liftIO $ setObjectPropertyInt32 obj "minimum-key-length" val

constructEntryCompletionMinimumKeyLength :: (IsEntryCompletion o) => Int32 -> IO (GValueConstruct o)
constructEntryCompletionMinimumKeyLength val = constructObjectPropertyInt32 "minimum-key-length" val

data EntryCompletionMinimumKeyLengthPropertyInfo
instance AttrInfo EntryCompletionMinimumKeyLengthPropertyInfo where
    type AttrAllowedOps EntryCompletionMinimumKeyLengthPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint EntryCompletionMinimumKeyLengthPropertyInfo = (~) Int32
    type AttrBaseTypeConstraint EntryCompletionMinimumKeyLengthPropertyInfo = IsEntryCompletion
    type AttrGetType EntryCompletionMinimumKeyLengthPropertyInfo = Int32
    type AttrLabel EntryCompletionMinimumKeyLengthPropertyInfo = "minimum-key-length"
    type AttrOrigin EntryCompletionMinimumKeyLengthPropertyInfo = EntryCompletion
    attrGet _ = getEntryCompletionMinimumKeyLength
    attrSet _ = setEntryCompletionMinimumKeyLength
    attrConstruct _ = constructEntryCompletionMinimumKeyLength
    attrClear _ = undefined

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

getEntryCompletionModel :: (MonadIO m, IsEntryCompletion o) => o -> m (Maybe Gtk.TreeModel.TreeModel)
getEntryCompletionModel obj = liftIO $ getObjectPropertyObject obj "model" Gtk.TreeModel.TreeModel

setEntryCompletionModel :: (MonadIO m, IsEntryCompletion o, Gtk.TreeModel.IsTreeModel a) => o -> a -> m ()
setEntryCompletionModel obj val = liftIO $ setObjectPropertyObject obj "model" (Just val)

constructEntryCompletionModel :: (IsEntryCompletion o, Gtk.TreeModel.IsTreeModel a) => a -> IO (GValueConstruct o)
constructEntryCompletionModel val = constructObjectPropertyObject "model" (Just val)

clearEntryCompletionModel :: (MonadIO m, IsEntryCompletion o) => o -> m ()
clearEntryCompletionModel obj = liftIO $ setObjectPropertyObject obj "model" (Nothing :: Maybe Gtk.TreeModel.TreeModel)

data EntryCompletionModelPropertyInfo
instance AttrInfo EntryCompletionModelPropertyInfo where
    type AttrAllowedOps EntryCompletionModelPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint EntryCompletionModelPropertyInfo = Gtk.TreeModel.IsTreeModel
    type AttrBaseTypeConstraint EntryCompletionModelPropertyInfo = IsEntryCompletion
    type AttrGetType EntryCompletionModelPropertyInfo = (Maybe Gtk.TreeModel.TreeModel)
    type AttrLabel EntryCompletionModelPropertyInfo = "model"
    type AttrOrigin EntryCompletionModelPropertyInfo = EntryCompletion
    attrGet _ = getEntryCompletionModel
    attrSet _ = setEntryCompletionModel
    attrConstruct _ = constructEntryCompletionModel
    attrClear _ = clearEntryCompletionModel

-- VVV Prop "popup-completion"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getEntryCompletionPopupCompletion :: (MonadIO m, IsEntryCompletion o) => o -> m Bool
getEntryCompletionPopupCompletion obj = liftIO $ getObjectPropertyBool obj "popup-completion"

setEntryCompletionPopupCompletion :: (MonadIO m, IsEntryCompletion o) => o -> Bool -> m ()
setEntryCompletionPopupCompletion obj val = liftIO $ setObjectPropertyBool obj "popup-completion" val

constructEntryCompletionPopupCompletion :: (IsEntryCompletion o) => Bool -> IO (GValueConstruct o)
constructEntryCompletionPopupCompletion val = constructObjectPropertyBool "popup-completion" val

data EntryCompletionPopupCompletionPropertyInfo
instance AttrInfo EntryCompletionPopupCompletionPropertyInfo where
    type AttrAllowedOps EntryCompletionPopupCompletionPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint EntryCompletionPopupCompletionPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint EntryCompletionPopupCompletionPropertyInfo = IsEntryCompletion
    type AttrGetType EntryCompletionPopupCompletionPropertyInfo = Bool
    type AttrLabel EntryCompletionPopupCompletionPropertyInfo = "popup-completion"
    type AttrOrigin EntryCompletionPopupCompletionPropertyInfo = EntryCompletion
    attrGet _ = getEntryCompletionPopupCompletion
    attrSet _ = setEntryCompletionPopupCompletion
    attrConstruct _ = constructEntryCompletionPopupCompletion
    attrClear _ = undefined

-- VVV Prop "popup-set-width"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getEntryCompletionPopupSetWidth :: (MonadIO m, IsEntryCompletion o) => o -> m Bool
getEntryCompletionPopupSetWidth obj = liftIO $ getObjectPropertyBool obj "popup-set-width"

setEntryCompletionPopupSetWidth :: (MonadIO m, IsEntryCompletion o) => o -> Bool -> m ()
setEntryCompletionPopupSetWidth obj val = liftIO $ setObjectPropertyBool obj "popup-set-width" val

constructEntryCompletionPopupSetWidth :: (IsEntryCompletion o) => Bool -> IO (GValueConstruct o)
constructEntryCompletionPopupSetWidth val = constructObjectPropertyBool "popup-set-width" val

data EntryCompletionPopupSetWidthPropertyInfo
instance AttrInfo EntryCompletionPopupSetWidthPropertyInfo where
    type AttrAllowedOps EntryCompletionPopupSetWidthPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint EntryCompletionPopupSetWidthPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint EntryCompletionPopupSetWidthPropertyInfo = IsEntryCompletion
    type AttrGetType EntryCompletionPopupSetWidthPropertyInfo = Bool
    type AttrLabel EntryCompletionPopupSetWidthPropertyInfo = "popup-set-width"
    type AttrOrigin EntryCompletionPopupSetWidthPropertyInfo = EntryCompletion
    attrGet _ = getEntryCompletionPopupSetWidth
    attrSet _ = setEntryCompletionPopupSetWidth
    attrConstruct _ = constructEntryCompletionPopupSetWidth
    attrClear _ = undefined

-- VVV Prop "popup-single-match"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getEntryCompletionPopupSingleMatch :: (MonadIO m, IsEntryCompletion o) => o -> m Bool
getEntryCompletionPopupSingleMatch obj = liftIO $ getObjectPropertyBool obj "popup-single-match"

setEntryCompletionPopupSingleMatch :: (MonadIO m, IsEntryCompletion o) => o -> Bool -> m ()
setEntryCompletionPopupSingleMatch obj val = liftIO $ setObjectPropertyBool obj "popup-single-match" val

constructEntryCompletionPopupSingleMatch :: (IsEntryCompletion o) => Bool -> IO (GValueConstruct o)
constructEntryCompletionPopupSingleMatch val = constructObjectPropertyBool "popup-single-match" val

data EntryCompletionPopupSingleMatchPropertyInfo
instance AttrInfo EntryCompletionPopupSingleMatchPropertyInfo where
    type AttrAllowedOps EntryCompletionPopupSingleMatchPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint EntryCompletionPopupSingleMatchPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint EntryCompletionPopupSingleMatchPropertyInfo = IsEntryCompletion
    type AttrGetType EntryCompletionPopupSingleMatchPropertyInfo = Bool
    type AttrLabel EntryCompletionPopupSingleMatchPropertyInfo = "popup-single-match"
    type AttrOrigin EntryCompletionPopupSingleMatchPropertyInfo = EntryCompletion
    attrGet _ = getEntryCompletionPopupSingleMatch
    attrSet _ = setEntryCompletionPopupSingleMatch
    attrConstruct _ = constructEntryCompletionPopupSingleMatch
    attrClear _ = undefined

-- VVV Prop "text-column"
   -- Type: TBasicType TInt
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getEntryCompletionTextColumn :: (MonadIO m, IsEntryCompletion o) => o -> m Int32
getEntryCompletionTextColumn obj = liftIO $ getObjectPropertyInt32 obj "text-column"

setEntryCompletionTextColumn :: (MonadIO m, IsEntryCompletion o) => o -> Int32 -> m ()
setEntryCompletionTextColumn obj val = liftIO $ setObjectPropertyInt32 obj "text-column" val

constructEntryCompletionTextColumn :: (IsEntryCompletion o) => Int32 -> IO (GValueConstruct o)
constructEntryCompletionTextColumn val = constructObjectPropertyInt32 "text-column" val

data EntryCompletionTextColumnPropertyInfo
instance AttrInfo EntryCompletionTextColumnPropertyInfo where
    type AttrAllowedOps EntryCompletionTextColumnPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint EntryCompletionTextColumnPropertyInfo = (~) Int32
    type AttrBaseTypeConstraint EntryCompletionTextColumnPropertyInfo = IsEntryCompletion
    type AttrGetType EntryCompletionTextColumnPropertyInfo = Int32
    type AttrLabel EntryCompletionTextColumnPropertyInfo = "text-column"
    type AttrOrigin EntryCompletionTextColumnPropertyInfo = EntryCompletion
    attrGet _ = getEntryCompletionTextColumn
    attrSet _ = setEntryCompletionTextColumn
    attrConstruct _ = constructEntryCompletionTextColumn
    attrClear _ = undefined

instance O.HasAttributeList EntryCompletion
type instance O.AttributeList EntryCompletion = EntryCompletionAttributeList
type EntryCompletionAttributeList = ('[ '("cellArea", EntryCompletionCellAreaPropertyInfo), '("inlineCompletion", EntryCompletionInlineCompletionPropertyInfo), '("inlineSelection", EntryCompletionInlineSelectionPropertyInfo), '("minimumKeyLength", EntryCompletionMinimumKeyLengthPropertyInfo), '("model", EntryCompletionModelPropertyInfo), '("popupCompletion", EntryCompletionPopupCompletionPropertyInfo), '("popupSetWidth", EntryCompletionPopupSetWidthPropertyInfo), '("popupSingleMatch", EntryCompletionPopupSingleMatchPropertyInfo), '("textColumn", EntryCompletionTextColumnPropertyInfo)] :: [(Symbol, *)])

entryCompletionCellArea :: AttrLabelProxy "cellArea"
entryCompletionCellArea = AttrLabelProxy

entryCompletionInlineCompletion :: AttrLabelProxy "inlineCompletion"
entryCompletionInlineCompletion = AttrLabelProxy

entryCompletionInlineSelection :: AttrLabelProxy "inlineSelection"
entryCompletionInlineSelection = AttrLabelProxy

entryCompletionMinimumKeyLength :: AttrLabelProxy "minimumKeyLength"
entryCompletionMinimumKeyLength = AttrLabelProxy

entryCompletionModel :: AttrLabelProxy "model"
entryCompletionModel = AttrLabelProxy

entryCompletionPopupCompletion :: AttrLabelProxy "popupCompletion"
entryCompletionPopupCompletion = AttrLabelProxy

entryCompletionPopupSetWidth :: AttrLabelProxy "popupSetWidth"
entryCompletionPopupSetWidth = AttrLabelProxy

entryCompletionPopupSingleMatch :: AttrLabelProxy "popupSingleMatch"
entryCompletionPopupSingleMatch = AttrLabelProxy

entryCompletionTextColumn :: AttrLabelProxy "textColumn"
entryCompletionTextColumn = AttrLabelProxy

data EntryCompletionActionActivatedSignalInfo
instance SignalInfo EntryCompletionActionActivatedSignalInfo where
    type HaskellCallbackType EntryCompletionActionActivatedSignalInfo = EntryCompletionActionActivatedCallback
    connectSignal _ = connectEntryCompletionActionActivated

data EntryCompletionCursorOnMatchSignalInfo
instance SignalInfo EntryCompletionCursorOnMatchSignalInfo where
    type HaskellCallbackType EntryCompletionCursorOnMatchSignalInfo = EntryCompletionCursorOnMatchCallback
    connectSignal _ = connectEntryCompletionCursorOnMatch

data EntryCompletionInsertPrefixSignalInfo
instance SignalInfo EntryCompletionInsertPrefixSignalInfo where
    type HaskellCallbackType EntryCompletionInsertPrefixSignalInfo = EntryCompletionInsertPrefixCallback
    connectSignal _ = connectEntryCompletionInsertPrefix

data EntryCompletionMatchSelectedSignalInfo
instance SignalInfo EntryCompletionMatchSelectedSignalInfo where
    type HaskellCallbackType EntryCompletionMatchSelectedSignalInfo = EntryCompletionMatchSelectedCallback
    connectSignal _ = connectEntryCompletionMatchSelected

data EntryCompletionNoMatchesSignalInfo
instance SignalInfo EntryCompletionNoMatchesSignalInfo where
    type HaskellCallbackType EntryCompletionNoMatchesSignalInfo = EntryCompletionNoMatchesCallback
    connectSignal _ = connectEntryCompletionNoMatches

type instance O.SignalList EntryCompletion = EntryCompletionSignalList
type EntryCompletionSignalList = ('[ '("actionActivated", EntryCompletionActionActivatedSignalInfo), '("cursorOnMatch", EntryCompletionCursorOnMatchSignalInfo), '("insertPrefix", EntryCompletionInsertPrefixSignalInfo), '("matchSelected", EntryCompletionMatchSelectedSignalInfo), '("noMatches", EntryCompletionNoMatchesSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

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

foreign import ccall "gtk_entry_completion_new" gtk_entry_completion_new :: 
    IO (Ptr EntryCompletion)

{- |
Creates a new 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' object.

@since 2.4
-}
entryCompletionNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m EntryCompletion
    {- ^ __Returns:__ A newly created 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' object -}
entryCompletionNew  = liftIO $ do
    result <- gtk_entry_completion_new
    checkUnexpectedReturnNULL "entryCompletionNew" result
    result' <- (wrapObject EntryCompletion) result
    return result'

-- method EntryCompletion::new_with_area
-- method type : Constructor
-- Args : [Arg {argCName = "area", argType = TInterface (Name {namespace = "Gtk", name = "CellArea"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GtkCellArea used to layout cells", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_entry_completion_new_with_area" gtk_entry_completion_new_with_area :: 
    Ptr Gtk.CellArea.CellArea ->            -- area : TInterface (Name {namespace = "Gtk", name = "CellArea"})
    IO (Ptr EntryCompletion)

{- |
Creates a new 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' object using the
specified /@area@/ to layout cells in the underlying
'GI.Gtk.Objects.TreeViewColumn.TreeViewColumn' for the drop-down menu.

@since 3.0
-}
entryCompletionNewWithArea ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.CellArea.IsCellArea a) =>
    a
    {- ^ /@area@/: the 'GI.Gtk.Objects.CellArea.CellArea' used to layout cells -}
    -> m EntryCompletion
    {- ^ __Returns:__ A newly created 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' object -}
entryCompletionNewWithArea area = liftIO $ do
    area' <- unsafeManagedPtrCastPtr area
    result <- gtk_entry_completion_new_with_area area'
    checkUnexpectedReturnNULL "entryCompletionNewWithArea" result
    result' <- (wrapObject EntryCompletion) result
    touchManagedPtr area
    return result'

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

foreign import ccall "gtk_entry_completion_complete" gtk_entry_completion_complete :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    IO ()

{- |
Requests a completion operation, or in other words a refiltering of the
current list with completions, using the current key. The completion list
view will be updated accordingly.

@since 2.4
-}
entryCompletionComplete ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> m ()
entryCompletionComplete completion = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    gtk_entry_completion_complete completion'
    touchManagedPtr completion
    return ()

data EntryCompletionCompleteMethodInfo
instance (signature ~ (m ()), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionCompleteMethodInfo a signature where
    overloadedMethod _ = entryCompletionComplete

-- method EntryCompletion::compute_prefix
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the entry completion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The text to complete for", 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_entry_completion_compute_prefix" gtk_entry_completion_compute_prefix :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    CString ->                              -- key : TBasicType TUTF8
    IO CString

{- |
Computes the common prefix that is shared by all rows in /@completion@/
that start with /@key@/. If no row matches /@key@/, 'Nothing' will be returned.
Note that a text column must have been set for this function to work,
see 'GI.Gtk.Objects.EntryCompletion.entryCompletionSetTextColumn' for details.

@since 3.4
-}
entryCompletionComputePrefix ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: the entry completion -}
    -> T.Text
    {- ^ /@key@/: The text to complete for -}
    -> m (Maybe T.Text)
    {- ^ __Returns:__ The common prefix all rows starting with
  /@key@/ or 'Nothing' if no row matches /@key@/. -}
entryCompletionComputePrefix completion key = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    key' <- textToCString key
    result <- gtk_entry_completion_compute_prefix completion' key'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- cstringToText result'
        freeMem result'
        return result''
    touchManagedPtr completion
    freeMem key'
    return maybeResult

data EntryCompletionComputePrefixMethodInfo
instance (signature ~ (T.Text -> m (Maybe T.Text)), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionComputePrefixMethodInfo a signature where
    overloadedMethod _ = entryCompletionComputePrefix

-- method EntryCompletion::delete_action
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "index_", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the index of the item to delete", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_entry_completion_delete_action" gtk_entry_completion_delete_action :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    Int32 ->                                -- index_ : TBasicType TInt
    IO ()

{- |
Deletes the action at /@index_@/ from /@completion@/’s action list.

Note that /@index_@/ is a relative position and the position of an
action may have changed since it was inserted.

@since 2.4
-}
entryCompletionDeleteAction ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> Int32
    {- ^ /@index_@/: the index of the item to delete -}
    -> m ()
entryCompletionDeleteAction completion index_ = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    gtk_entry_completion_delete_action completion' index_
    touchManagedPtr completion
    return ()

data EntryCompletionDeleteActionMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionDeleteActionMethodInfo a signature where
    overloadedMethod _ = entryCompletionDeleteAction

-- method EntryCompletion::get_completion_prefix
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", 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_entry_completion_get_completion_prefix" gtk_entry_completion_get_completion_prefix :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    IO CString

{- |
Get the original text entered by the user that triggered
the completion or 'Nothing' if there’s no completion ongoing.

@since 2.12
-}
entryCompletionGetCompletionPrefix ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> m T.Text
    {- ^ __Returns:__ the prefix for the current completion -}
entryCompletionGetCompletionPrefix completion = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    result <- gtk_entry_completion_get_completion_prefix completion'
    checkUnexpectedReturnNULL "entryCompletionGetCompletionPrefix" result
    result' <- cstringToText result
    touchManagedPtr completion
    return result'

data EntryCompletionGetCompletionPrefixMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionGetCompletionPrefixMethodInfo a signature where
    overloadedMethod _ = entryCompletionGetCompletionPrefix

-- method EntryCompletion::get_entry
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "Widget"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_entry_completion_get_entry" gtk_entry_completion_get_entry :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    IO (Ptr Gtk.Widget.Widget)

{- |
Gets the entry /@completion@/ has been attached to.

@since 2.4
-}
entryCompletionGetEntry ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> m Gtk.Widget.Widget
    {- ^ __Returns:__ The entry /@completion@/ has been attached to -}
entryCompletionGetEntry completion = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    result <- gtk_entry_completion_get_entry completion'
    checkUnexpectedReturnNULL "entryCompletionGetEntry" result
    result' <- (newObject Gtk.Widget.Widget) result
    touchManagedPtr completion
    return result'

data EntryCompletionGetEntryMethodInfo
instance (signature ~ (m Gtk.Widget.Widget), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionGetEntryMethodInfo a signature where
    overloadedMethod _ = entryCompletionGetEntry

-- method EntryCompletion::get_inline_completion
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", 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_entry_completion_get_inline_completion" gtk_entry_completion_get_inline_completion :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    IO CInt

{- |
Returns whether the common prefix of the possible completions should
be automatically inserted in the entry.

@since 2.6
-}
entryCompletionGetInlineCompletion ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if inline completion is turned on -}
entryCompletionGetInlineCompletion completion = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    result <- gtk_entry_completion_get_inline_completion completion'
    let result' = (/= 0) result
    touchManagedPtr completion
    return result'

data EntryCompletionGetInlineCompletionMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionGetInlineCompletionMethodInfo a signature where
    overloadedMethod _ = entryCompletionGetInlineCompletion

-- method EntryCompletion::get_inline_selection
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", 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_entry_completion_get_inline_selection" gtk_entry_completion_get_inline_selection :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    IO CInt

{- |
Returns 'True' if inline-selection mode is turned on.

@since 2.12
-}
entryCompletionGetInlineSelection ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if inline-selection mode is on -}
entryCompletionGetInlineSelection completion = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    result <- gtk_entry_completion_get_inline_selection completion'
    let result' = (/= 0) result
    touchManagedPtr completion
    return result'

data EntryCompletionGetInlineSelectionMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionGetInlineSelectionMethodInfo a signature where
    overloadedMethod _ = entryCompletionGetInlineSelection

-- method EntryCompletion::get_minimum_key_length
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_entry_completion_get_minimum_key_length" gtk_entry_completion_get_minimum_key_length :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    IO Int32

{- |
Returns the minimum key length as set for /@completion@/.

@since 2.4
-}
entryCompletionGetMinimumKeyLength ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> m Int32
    {- ^ __Returns:__ The currently used minimum key length -}
entryCompletionGetMinimumKeyLength completion = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    result <- gtk_entry_completion_get_minimum_key_length completion'
    touchManagedPtr completion
    return result

data EntryCompletionGetMinimumKeyLengthMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionGetMinimumKeyLengthMethodInfo a signature where
    overloadedMethod _ = entryCompletionGetMinimumKeyLength

-- method EntryCompletion::get_model
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "TreeModel"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_entry_completion_get_model" gtk_entry_completion_get_model :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    IO (Ptr Gtk.TreeModel.TreeModel)

{- |
Returns the model the 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' is using as data source.
Returns 'Nothing' if the model is unset.

@since 2.4
-}
entryCompletionGetModel ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> m (Maybe Gtk.TreeModel.TreeModel)
    {- ^ __Returns:__ A 'GI.Gtk.Interfaces.TreeModel.TreeModel', or 'Nothing' if none
    is currently being used -}
entryCompletionGetModel completion = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    result <- gtk_entry_completion_get_model completion'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newObject Gtk.TreeModel.TreeModel) result'
        return result''
    touchManagedPtr completion
    return maybeResult

data EntryCompletionGetModelMethodInfo
instance (signature ~ (m (Maybe Gtk.TreeModel.TreeModel)), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionGetModelMethodInfo a signature where
    overloadedMethod _ = entryCompletionGetModel

-- method EntryCompletion::get_popup_completion
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", 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_entry_completion_get_popup_completion" gtk_entry_completion_get_popup_completion :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    IO CInt

{- |
Returns whether the completions should be presented in a popup window.

@since 2.6
-}
entryCompletionGetPopupCompletion ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if popup completion is turned on -}
entryCompletionGetPopupCompletion completion = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    result <- gtk_entry_completion_get_popup_completion completion'
    let result' = (/= 0) result
    touchManagedPtr completion
    return result'

data EntryCompletionGetPopupCompletionMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionGetPopupCompletionMethodInfo a signature where
    overloadedMethod _ = entryCompletionGetPopupCompletion

-- method EntryCompletion::get_popup_set_width
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", 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_entry_completion_get_popup_set_width" gtk_entry_completion_get_popup_set_width :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    IO CInt

{- |
Returns whether the  completion popup window will be resized to the
width of the entry.

@since 2.8
-}
entryCompletionGetPopupSetWidth ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the popup window will be resized to the width of
  the entry -}
entryCompletionGetPopupSetWidth completion = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    result <- gtk_entry_completion_get_popup_set_width completion'
    let result' = (/= 0) result
    touchManagedPtr completion
    return result'

data EntryCompletionGetPopupSetWidthMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionGetPopupSetWidthMethodInfo a signature where
    overloadedMethod _ = entryCompletionGetPopupSetWidth

-- method EntryCompletion::get_popup_single_match
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", 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_entry_completion_get_popup_single_match" gtk_entry_completion_get_popup_single_match :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    IO CInt

{- |
Returns whether the completion popup window will appear even if there is
only a single match.

@since 2.8
-}
entryCompletionGetPopupSingleMatch ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the popup window will appear regardless of the
   number of matches -}
entryCompletionGetPopupSingleMatch completion = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    result <- gtk_entry_completion_get_popup_single_match completion'
    let result' = (/= 0) result
    touchManagedPtr completion
    return result'

data EntryCompletionGetPopupSingleMatchMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionGetPopupSingleMatchMethodInfo a signature where
    overloadedMethod _ = entryCompletionGetPopupSingleMatch

-- method EntryCompletion::get_text_column
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_entry_completion_get_text_column" gtk_entry_completion_get_text_column :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    IO Int32

{- |
Returns the column in the model of /@completion@/ to get strings from.

@since 2.6
-}
entryCompletionGetTextColumn ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> m Int32
    {- ^ __Returns:__ the column containing the strings -}
entryCompletionGetTextColumn completion = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    result <- gtk_entry_completion_get_text_column completion'
    touchManagedPtr completion
    return result

data EntryCompletionGetTextColumnMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionGetTextColumnMethodInfo a signature where
    overloadedMethod _ = entryCompletionGetTextColumn

-- method EntryCompletion::insert_action_markup
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "index_", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the index of the item to insert", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "markup", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "markup of the item to insert", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_entry_completion_insert_action_markup" gtk_entry_completion_insert_action_markup :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    Int32 ->                                -- index_ : TBasicType TInt
    CString ->                              -- markup : TBasicType TUTF8
    IO ()

{- |
Inserts an action in /@completion@/’s action item list at position /@index_@/
with markup /@markup@/.

@since 2.4
-}
entryCompletionInsertActionMarkup ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> Int32
    {- ^ /@index_@/: the index of the item to insert -}
    -> T.Text
    {- ^ /@markup@/: markup of the item to insert -}
    -> m ()
entryCompletionInsertActionMarkup completion index_ markup = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    markup' <- textToCString markup
    gtk_entry_completion_insert_action_markup completion' index_ markup'
    touchManagedPtr completion
    freeMem markup'
    return ()

data EntryCompletionInsertActionMarkupMethodInfo
instance (signature ~ (Int32 -> T.Text -> m ()), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionInsertActionMarkupMethodInfo a signature where
    overloadedMethod _ = entryCompletionInsertActionMarkup

-- method EntryCompletion::insert_action_text
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "index_", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the index of the item to insert", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "text of the item to insert", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_entry_completion_insert_action_text" gtk_entry_completion_insert_action_text :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    Int32 ->                                -- index_ : TBasicType TInt
    CString ->                              -- text : TBasicType TUTF8
    IO ()

{- |
Inserts an action in /@completion@/’s action item list at position /@index_@/
with text /@text@/. If you want the action item to have markup, use
'GI.Gtk.Objects.EntryCompletion.entryCompletionInsertActionMarkup'.

Note that /@index_@/ is a relative position in the list of actions and
the position of an action can change when deleting a different action.

@since 2.4
-}
entryCompletionInsertActionText ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> Int32
    {- ^ /@index_@/: the index of the item to insert -}
    -> T.Text
    {- ^ /@text@/: text of the item to insert -}
    -> m ()
entryCompletionInsertActionText completion index_ text = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    text' <- textToCString text
    gtk_entry_completion_insert_action_text completion' index_ text'
    touchManagedPtr completion
    freeMem text'
    return ()

data EntryCompletionInsertActionTextMethodInfo
instance (signature ~ (Int32 -> T.Text -> m ()), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionInsertActionTextMethodInfo a signature where
    overloadedMethod _ = entryCompletionInsertActionText

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

foreign import ccall "gtk_entry_completion_insert_prefix" gtk_entry_completion_insert_prefix :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    IO ()

{- |
Requests a prefix insertion.

@since 2.6
-}
entryCompletionInsertPrefix ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> m ()
entryCompletionInsertPrefix completion = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    gtk_entry_completion_insert_prefix completion'
    touchManagedPtr completion
    return ()

data EntryCompletionInsertPrefixMethodInfo
instance (signature ~ (m ()), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionInsertPrefixMethodInfo a signature where
    overloadedMethod _ = entryCompletionInsertPrefix

-- method EntryCompletion::set_inline_completion
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "inline_completion", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE to do inline completion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_entry_completion_set_inline_completion" gtk_entry_completion_set_inline_completion :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    CInt ->                                 -- inline_completion : TBasicType TBoolean
    IO ()

{- |
Sets whether the common prefix of the possible completions should
be automatically inserted in the entry.

@since 2.6
-}
entryCompletionSetInlineCompletion ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> Bool
    {- ^ /@inlineCompletion@/: 'True' to do inline completion -}
    -> m ()
entryCompletionSetInlineCompletion completion inlineCompletion = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    let inlineCompletion' = (fromIntegral . fromEnum) inlineCompletion
    gtk_entry_completion_set_inline_completion completion' inlineCompletion'
    touchManagedPtr completion
    return ()

data EntryCompletionSetInlineCompletionMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionSetInlineCompletionMethodInfo a signature where
    overloadedMethod _ = entryCompletionSetInlineCompletion

-- method EntryCompletion::set_inline_selection
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "inline_selection", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE to do inline selection", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_entry_completion_set_inline_selection" gtk_entry_completion_set_inline_selection :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    CInt ->                                 -- inline_selection : TBasicType TBoolean
    IO ()

{- |
Sets whether it is possible to cycle through the possible completions
inside the entry.

@since 2.12
-}
entryCompletionSetInlineSelection ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> Bool
    {- ^ /@inlineSelection@/: 'True' to do inline selection -}
    -> m ()
entryCompletionSetInlineSelection completion inlineSelection = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    let inlineSelection' = (fromIntegral . fromEnum) inlineSelection
    gtk_entry_completion_set_inline_selection completion' inlineSelection'
    touchManagedPtr completion
    return ()

data EntryCompletionSetInlineSelectionMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionSetInlineSelectionMethodInfo a signature where
    overloadedMethod _ = entryCompletionSetInlineSelection

-- method EntryCompletion::set_match_func
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "func", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletionMatchFunc"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GtkEntryCompletionMatchFunc to use", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 2, argDestroy = 3, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "func_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data for @func", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "func_notify", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "destroy notify for @func_data.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_entry_completion_set_match_func" gtk_entry_completion_set_match_func :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    FunPtr Gtk.Callbacks.C_EntryCompletionMatchFunc -> -- func : TInterface (Name {namespace = "Gtk", name = "EntryCompletionMatchFunc"})
    Ptr () ->                               -- func_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- func_notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    IO ()

{- |
Sets the match function for /@completion@/ to be /@func@/. The match function
is used to determine if a row should or should not be in the completion
list.

@since 2.4
-}
entryCompletionSetMatchFunc ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> Gtk.Callbacks.EntryCompletionMatchFunc
    {- ^ /@func@/: the 'GI.Gtk.Callbacks.EntryCompletionMatchFunc' to use -}
    -> m ()
entryCompletionSetMatchFunc completion func = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    func' <- Gtk.Callbacks.mk_EntryCompletionMatchFunc (Gtk.Callbacks.wrap_EntryCompletionMatchFunc Nothing (Gtk.Callbacks.drop_closures_EntryCompletionMatchFunc func))
    let funcData = castFunPtrToPtr func'
    let funcNotify = safeFreeFunPtrPtr
    gtk_entry_completion_set_match_func completion' func' funcData funcNotify
    touchManagedPtr completion
    return ()

data EntryCompletionSetMatchFuncMethodInfo
instance (signature ~ (Gtk.Callbacks.EntryCompletionMatchFunc -> m ()), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionSetMatchFuncMethodInfo a signature where
    overloadedMethod _ = entryCompletionSetMatchFunc

-- method EntryCompletion::set_minimum_key_length
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "length", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the minimum length of the key in order to start completing", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_entry_completion_set_minimum_key_length" gtk_entry_completion_set_minimum_key_length :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    Int32 ->                                -- length : TBasicType TInt
    IO ()

{- |
Requires the length of the search key for /@completion@/ to be at least
/@length@/. This is useful for long lists, where completing using a small
key takes a lot of time and will come up with meaningless results anyway
(ie, a too large dataset).

@since 2.4
-}
entryCompletionSetMinimumKeyLength ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> Int32
    {- ^ /@length@/: the minimum length of the key in order to start completing -}
    -> m ()
entryCompletionSetMinimumKeyLength completion length_ = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    gtk_entry_completion_set_minimum_key_length completion' length_
    touchManagedPtr completion
    return ()

data EntryCompletionSetMinimumKeyLengthMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionSetMinimumKeyLengthMethodInfo a signature where
    overloadedMethod _ = entryCompletionSetMinimumKeyLength

-- method EntryCompletion::set_model
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "model", argType = TInterface (Name {namespace = "Gtk", name = "TreeModel"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the #GtkTreeModel", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_entry_completion_set_model" gtk_entry_completion_set_model :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    Ptr Gtk.TreeModel.TreeModel ->          -- model : TInterface (Name {namespace = "Gtk", name = "TreeModel"})
    IO ()

{- |
Sets the model for a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion'. If /@completion@/ already has
a model set, it will remove it before setting the new model.
If model is 'Nothing', then it will unset the model.

@since 2.4
-}
entryCompletionSetModel ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a, Gtk.TreeModel.IsTreeModel b) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> Maybe (b)
    {- ^ /@model@/: the 'GI.Gtk.Interfaces.TreeModel.TreeModel' -}
    -> m ()
entryCompletionSetModel completion model = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    maybeModel <- case model of
        Nothing -> return nullPtr
        Just jModel -> do
            jModel' <- unsafeManagedPtrCastPtr jModel
            return jModel'
    gtk_entry_completion_set_model completion' maybeModel
    touchManagedPtr completion
    whenJust model touchManagedPtr
    return ()

data EntryCompletionSetModelMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsEntryCompletion a, Gtk.TreeModel.IsTreeModel b) => O.MethodInfo EntryCompletionSetModelMethodInfo a signature where
    overloadedMethod _ = entryCompletionSetModel

-- method EntryCompletion::set_popup_completion
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "popup_completion", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE to do popup completion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_entry_completion_set_popup_completion" gtk_entry_completion_set_popup_completion :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    CInt ->                                 -- popup_completion : TBasicType TBoolean
    IO ()

{- |
Sets whether the completions should be presented in a popup window.

@since 2.6
-}
entryCompletionSetPopupCompletion ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> Bool
    {- ^ /@popupCompletion@/: 'True' to do popup completion -}
    -> m ()
entryCompletionSetPopupCompletion completion popupCompletion = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    let popupCompletion' = (fromIntegral . fromEnum) popupCompletion
    gtk_entry_completion_set_popup_completion completion' popupCompletion'
    touchManagedPtr completion
    return ()

data EntryCompletionSetPopupCompletionMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionSetPopupCompletionMethodInfo a signature where
    overloadedMethod _ = entryCompletionSetPopupCompletion

-- method EntryCompletion::set_popup_set_width
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "popup_set_width", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE to make the width of the popup the same as the entry", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_entry_completion_set_popup_set_width" gtk_entry_completion_set_popup_set_width :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    CInt ->                                 -- popup_set_width : TBasicType TBoolean
    IO ()

{- |
Sets whether the completion popup window will be resized to be the same
width as the entry.

@since 2.8
-}
entryCompletionSetPopupSetWidth ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> Bool
    {- ^ /@popupSetWidth@/: 'True' to make the width of the popup the same as the entry -}
    -> m ()
entryCompletionSetPopupSetWidth completion popupSetWidth = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    let popupSetWidth' = (fromIntegral . fromEnum) popupSetWidth
    gtk_entry_completion_set_popup_set_width completion' popupSetWidth'
    touchManagedPtr completion
    return ()

data EntryCompletionSetPopupSetWidthMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionSetPopupSetWidthMethodInfo a signature where
    overloadedMethod _ = entryCompletionSetPopupSetWidth

-- method EntryCompletion::set_popup_single_match
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "popup_single_match", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE if the popup should appear even for a single\n    match", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_entry_completion_set_popup_single_match" gtk_entry_completion_set_popup_single_match :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    CInt ->                                 -- popup_single_match : TBasicType TBoolean
    IO ()

{- |
Sets whether the completion popup window will appear even if there is
only a single match. You may want to set this to 'False' if you
are using [inline completion][GtkEntryCompletion--inline-completion].

@since 2.8
-}
entryCompletionSetPopupSingleMatch ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> Bool
    {- ^ /@popupSingleMatch@/: 'True' if the popup should appear even for a single
    match -}
    -> m ()
entryCompletionSetPopupSingleMatch completion popupSingleMatch = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    let popupSingleMatch' = (fromIntegral . fromEnum) popupSingleMatch
    gtk_entry_completion_set_popup_single_match completion' popupSingleMatch'
    touchManagedPtr completion
    return ()

data EntryCompletionSetPopupSingleMatchMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionSetPopupSingleMatchMethodInfo a signature where
    overloadedMethod _ = entryCompletionSetPopupSingleMatch

-- method EntryCompletion::set_text_column
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "completion", argType = TInterface (Name {namespace = "Gtk", name = "EntryCompletion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkEntryCompletion", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "column", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the column in the model of @completion to get strings from", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_entry_completion_set_text_column" gtk_entry_completion_set_text_column :: 
    Ptr EntryCompletion ->                  -- completion : TInterface (Name {namespace = "Gtk", name = "EntryCompletion"})
    Int32 ->                                -- column : TBasicType TInt
    IO ()

{- |
Convenience function for setting up the most used case of this code: a
completion list with just strings. This function will set up /@completion@/
to have a list displaying all (and just) strings in the completion list,
and to get those strings from /@column@/ in the model of /@completion@/.

This functions creates and adds a 'GI.Gtk.Objects.CellRendererText.CellRendererText' for the selected
column. If you need to set the text column, but don\'t want the cell
renderer, use @/g_object_set()/@ to set the 'GI.Gtk.Objects.EntryCompletion.EntryCompletion':@/text-column/@
property directly.

@since 2.4
-}
entryCompletionSetTextColumn ::
    (B.CallStack.HasCallStack, MonadIO m, IsEntryCompletion a) =>
    a
    {- ^ /@completion@/: a 'GI.Gtk.Objects.EntryCompletion.EntryCompletion' -}
    -> Int32
    {- ^ /@column@/: the column in the model of /@completion@/ to get strings from -}
    -> m ()
entryCompletionSetTextColumn completion column = liftIO $ do
    completion' <- unsafeManagedPtrCastPtr completion
    gtk_entry_completion_set_text_column completion' column
    touchManagedPtr completion
    return ()

data EntryCompletionSetTextColumnMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsEntryCompletion a) => O.MethodInfo EntryCompletionSetTextColumnMethodInfo a signature where
    overloadedMethod _ = entryCompletionSetTextColumn