     SourceCompletionClass,
 
 -- * Methods
+    sourceCompletionAddProvider,
+    sourceCompletionRemoveProvider,
+    sourceCompletionGetProviders,
+    -- sourceCompletionShow,
     sourceCompletionHide,
     sourceCompletionMoveWindow,
     sourceCompletionBlockInteractive,

    sourceCompletionMoveCursor,
    sourceCompletionMovePage,
    -- sourceCompletionPopulateContext,
    sourceCompletionShow,
) where

import Control.Monad	(liftM)

import System.Glib.GObject	(makeNewGObject)
import System.Glib.Attributes
import System.Glib.Properties
import System.Glib.GError
import System.Glib.GList		(fromGList, withGList)
import Graphics.UI.Gtk.Multiline.TextView (TextWindowType (..))
import Graphics.UI.Gtk.General.Enums (ScrollStep (..))
{#import Graphics.UI.Gtk.SourceView.Signals#}
{#import Graphics.UI.Gtk.SourceView.Types#}

{# context lib="gtk" prefix="gtk" #}

-- | Add a new 'SourceCompletionProvider' to the completion object. This will add a reference provider,
-- so make sure to unref your own copy when you no longer need it.
sourceCompletionAddProvider :: SourceCompletionClass sc => sc 
                            -> SourceCompletionProvider
                            -> IO Bool -- ^ returns    'True' if provider was successfully added, otherwise if error is provided, it will be set with the error and     
sourceCompletionAddProvider sc provider = 
  liftM toBool $
  propagateGError $ \gErrorPtr -> 
      {# call gtk_source_completion_add_provider #}  
          (toSourceCompletion sc)
          provider
          gErrorPtr

-- | Remove provider from the completion.
sourceCompletionRemoveProvider :: SourceCompletionClass sc => sc 
                               -> SourceCompletionProvider
                               -> IO Bool  -- ^ returns    'True' if provider was successfully removed, otherwise if error is provided, it will be set with the error and   
sourceCompletionRemoveProvider sc provider =
  liftM toBool $
  propagateGError $ \gErrorPtr -> 
      {#call gtk_source_completion_remove_provider #}
         (toSourceCompletion sc)
         provider
         gErrorPtr
      
-- | Get list of providers registered on completion. The returned list is owned by the completion and
-- should not be freed.
sourceCompletionGetProviders :: SourceCompletionClass sc => sc -> IO [SourceCompletionProvider]
sourceCompletionGetProviders sc = do
  glist <- {#call gtk_source_completion_get_providers #} (toSourceCompletion sc)
  glistPtrs <- fromGList glist
  mapM (makeNewGObject mkSourceCompletionProvider . return) glistPtrs  

-- | Starts a new completion with the specified 'SourceCompletionContext' and a list of potential
-- candidate providers for completion.
-- sourceCompletionShow :: SourceCompletionClass sc => sc
--                      -> [SourceCompletionProvider]
--                      -> 

-- | Hides the completion if it is active (visible).
sourceCompletionHide :: SourceCompletionClass sc => sc -> IO ()
