{-# LINE 2 "./Graphics/UI/Gtk/WebKit/WebPolicyDecision.chs" #-}
-- -*-haskell-*-
-----------------------------------------------------------------------------
-- Module : Graphics.UI.Gtk.WebKit.WebPolicyDecision
-- Author : Andy Stewart
-- Copyright : (c) 2010 Andy Stewart <lazycat.manatee@gmail.com>
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
--
-- This library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- |
-- Maintainer : gtk2hs-users@lists.sourceforge.net
-- Stability : provisional
-- Portability : portable (depends on GHC)
--
-- Access to the WebKit PolicyDecision
-----------------------------------------------------------------------------

module Graphics.UI.Gtk.WebKit.WebPolicyDecision (
-- * Desciption
-- | 'WebPolicyDecision' objects are given to the application on signal emissions that deal with
-- policy decisions, such as if a new window should be opened, or if a given navigation should be
-- allowed. The application uses it to tell the engine what to do.

-- * Types
  WebPolicyDecision,
  WebPolicyDecisionClass,

-- * Methods
  webPolicyDecisionDownload,
  webPolicyDecisionIgnore,
  webPolicyDecisionUse,
) where

import Control.Monad (liftM)

import System.Glib.FFI
import System.Glib.UTFString
import System.Glib.GList
import System.Glib.GError
import Graphics.UI.Gtk.Gdk.Events

import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.WebKit.Types
{-# LINE 52 "./Graphics/UI/Gtk/WebKit/WebPolicyDecision.chs" #-}
import System.Glib.GObject
{-# LINE 53 "./Graphics/UI/Gtk/WebKit/WebPolicyDecision.chs" #-}


{-# LINE 55 "./Graphics/UI/Gtk/WebKit/WebPolicyDecision.chs" #-}

-- * Methods

-- | Will send the DOWNLOAD decision to the policy implementer.
webPolicyDecisionDownload ::
   WebPolicyDecisionClass self => self
 -> IO ()
webPolicyDecisionDownload pd =
  (\(WebPolicyDecision arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_web_policy_decision_download argPtr1) (toWebPolicyDecision pd)

-- | Will send the IGNORE decision to the policy implementer.
webPolicyDecisionIgnore ::
   WebPolicyDecisionClass self => self
 -> IO ()
webPolicyDecisionIgnore pd =
  (\(WebPolicyDecision arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_web_policy_decision_ignore argPtr1) (toWebPolicyDecision pd)

-- | Will send the USE decision to the policy implementer.
webPolicyDecisionUse ::
   WebPolicyDecisionClass self => self
 -> IO ()
webPolicyDecisionUse pd =
  (\(WebPolicyDecision arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_web_policy_decision_use argPtr1) (toWebPolicyDecision pd)

foreign import ccall safe "webkit_web_policy_decision_download"
  webkit_web_policy_decision_download :: ((Ptr WebPolicyDecision) -> (IO ()))

foreign import ccall safe "webkit_web_policy_decision_ignore"
  webkit_web_policy_decision_ignore :: ((Ptr WebPolicyDecision) -> (IO ()))

foreign import ccall safe "webkit_web_policy_decision_use"
  webkit_web_policy_decision_use :: ((Ptr WebPolicyDecision) -> (IO ()))