{-# LANGUAGE CPP #-} -- -*-haskell-*- ----------------------------------------------------------------------------- -- Module : Graphics.UI.Gtk.WebKit.WebPolicyDecision -- Author : Andy Stewart -- Copyright : (c) 2010 Andy Stewart -- -- 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#} {#import System.Glib.GObject#} {#context lib="webkit" prefix ="webkit"#} -- * Methods -- | Will send the DOWNLOAD decision to the policy implementer. webPolicyDecisionDownload :: WebPolicyDecisionClass self => self -> IO () webPolicyDecisionDownload pd = {#call web_policy_decision_download#} (toWebPolicyDecision pd) -- | Will send the IGNORE decision to the policy implementer. webPolicyDecisionIgnore :: WebPolicyDecisionClass self => self -> IO () webPolicyDecisionIgnore pd = {#call web_policy_decision_ignore#} (toWebPolicyDecision pd) -- | Will send the USE decision to the policy implementer. webPolicyDecisionUse :: WebPolicyDecisionClass self => self -> IO () webPolicyDecisionUse pd = {#call web_policy_decision_use#} (toWebPolicyDecision pd)