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

module GI.WebKit.Enums
    ( 
    catchPolicyError                        ,
    handlePolicyError                       ,
    catchPluginError                        ,
    handlePluginError                       ,
    catchNetworkError                       ,
    handleNetworkError                      ,

-- * Exported types
    WebViewViewMode(..)                     ,
    WebViewTargetInfo(..)                   ,
    WebNavigationReason(..)                 ,
    SelectionAffinity(..)                   ,
    PolicyError(..)                         ,
    PluginError(..)                         ,
    NetworkError(..)                        ,
    NavigationResponse(..)                  ,
    LoadStatus(..)                          ,
    InsertAction(..)                        ,
    EditingBehavior(..)                     ,
    DownloadStatus(..)                      ,
    DownloadError(..)                       ,
    ContextMenuAction(..)                   ,
    CacheModel(..)                          ,


    ) 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


-- Enum WebViewViewMode
{- |
Enum values used to denote the various types of view modes. See the
'GI.WebKit.Objects.WebView.WebView':@/view-mode/@ property.
-}
data WebViewViewMode = 
      WebViewViewModeWindowed
    {- ^
    Windowed view mode
    -}
    | WebViewViewModeFloating
    {- ^
    Floating view mode
    -}
    | WebViewViewModeFullscreen
    {- ^
    Fullscreen view mode
    -}
    | WebViewViewModeMaximized
    {- ^
    Maximized view mode
    -}
    | WebViewViewModeMinimized
    {- ^
    Minimized view mode
    -}
    | AnotherWebViewViewMode Int
    -- ^ Catch-all for unknown values
    deriving (Show, Eq)

instance P.Enum WebViewViewMode where
    fromEnum WebViewViewModeWindowed = 0
    fromEnum WebViewViewModeFloating = 1
    fromEnum WebViewViewModeFullscreen = 2
    fromEnum WebViewViewModeMaximized = 3
    fromEnum WebViewViewModeMinimized = 4
    fromEnum (AnotherWebViewViewMode k) = k

    toEnum 0 = WebViewViewModeWindowed
    toEnum 1 = WebViewViewModeFloating
    toEnum 2 = WebViewViewModeFullscreen
    toEnum 3 = WebViewViewModeMaximized
    toEnum 4 = WebViewViewModeMinimized
    toEnum k = AnotherWebViewViewMode k

instance P.Ord WebViewViewMode where
    compare a b = P.compare (P.fromEnum a) (P.fromEnum b)

foreign import ccall "webkit_web_view_view_mode_get_type" c_webkit_web_view_view_mode_get_type :: 
    IO GType

instance BoxedEnum WebViewViewMode where
    boxedEnumType _ = c_webkit_web_view_view_mode_get_type

-- Enum WebViewTargetInfo
{- |
Enum values used to denote the info value of various selection types. These can be used
to interpret the data WebKitGTK+ publishes via GtkClipboard and drag-and-drop.
-}
data WebViewTargetInfo = 
      WebViewTargetInfoHtml
    {- ^
    Rich markup data
    -}
    | WebViewTargetInfoText
    {- ^
    Text data
    -}
    | WebViewTargetInfoImage
    {- ^
    Image data
    -}
    | WebViewTargetInfoUriList
    {- ^
    URI list data
    -}
    | WebViewTargetInfoNetscapeUrl
    {- ^
    A single URL in the Netscape protocol
    -}
    | AnotherWebViewTargetInfo Int
    -- ^ Catch-all for unknown values
    deriving (Show, Eq)

instance P.Enum WebViewTargetInfo where
    fromEnum WebViewTargetInfoHtml = 0
    fromEnum WebViewTargetInfoText = 1
    fromEnum WebViewTargetInfoImage = 2
    fromEnum WebViewTargetInfoUriList = 3
    fromEnum WebViewTargetInfoNetscapeUrl = 4
    fromEnum (AnotherWebViewTargetInfo k) = k

    toEnum 0 = WebViewTargetInfoHtml
    toEnum 1 = WebViewTargetInfoText
    toEnum 2 = WebViewTargetInfoImage
    toEnum 3 = WebViewTargetInfoUriList
    toEnum 4 = WebViewTargetInfoNetscapeUrl
    toEnum k = AnotherWebViewTargetInfo k

instance P.Ord WebViewTargetInfo where
    compare a b = P.compare (P.fromEnum a) (P.fromEnum b)

foreign import ccall "webkit_web_view_target_info_get_type" c_webkit_web_view_target_info_get_type :: 
    IO GType

instance BoxedEnum WebViewTargetInfo where
    boxedEnumType _ = c_webkit_web_view_target_info_get_type

-- Enum WebNavigationReason
{- |
Enum values used to denote the various navigation reasons.
-}
data WebNavigationReason = 
      WebNavigationReasonLinkClicked
    {- ^
    The navigation was triggered by clicking a link.
    -}
    | WebNavigationReasonFormSubmitted
    {- ^
    The navigation was triggered by submitting a form.
    -}
    | WebNavigationReasonBackForward
    {- ^
    The navigation was triggered by navigating forward or backward.
    -}
    | WebNavigationReasonReload
    {- ^
    The navigation was triggered by reloading.
    -}
    | WebNavigationReasonFormResubmitted
    {- ^
    The navigation was triggered by resubmitting a form.
    -}
    | WebNavigationReasonOther
    {- ^
    The navigation was triggered by some other action.
    -}
    | AnotherWebNavigationReason Int
    -- ^ Catch-all for unknown values
    deriving (Show, Eq)

instance P.Enum WebNavigationReason where
    fromEnum WebNavigationReasonLinkClicked = 0
    fromEnum WebNavigationReasonFormSubmitted = 1
    fromEnum WebNavigationReasonBackForward = 2
    fromEnum WebNavigationReasonReload = 3
    fromEnum WebNavigationReasonFormResubmitted = 4
    fromEnum WebNavigationReasonOther = 5
    fromEnum (AnotherWebNavigationReason k) = k

    toEnum 0 = WebNavigationReasonLinkClicked
    toEnum 1 = WebNavigationReasonFormSubmitted
    toEnum 2 = WebNavigationReasonBackForward
    toEnum 3 = WebNavigationReasonReload
    toEnum 4 = WebNavigationReasonFormResubmitted
    toEnum 5 = WebNavigationReasonOther
    toEnum k = AnotherWebNavigationReason k

instance P.Ord WebNavigationReason where
    compare a b = P.compare (P.fromEnum a) (P.fromEnum b)

foreign import ccall "webkit_web_navigation_reason_get_type" c_webkit_web_navigation_reason_get_type :: 
    IO GType

instance BoxedEnum WebNavigationReason where
    boxedEnumType _ = c_webkit_web_navigation_reason_get_type

-- Enum SelectionAffinity
{- |
/No description available in the introspection data./
-}
data SelectionAffinity = 
      SelectionAffinityUpstream
    {- ^
    /No description available in the introspection data./
    -}
    | SelectionAffinityDownstream
    {- ^
    /No description available in the introspection data./
    -}
    | AnotherSelectionAffinity Int
    -- ^ Catch-all for unknown values
    deriving (Show, Eq)

instance P.Enum SelectionAffinity where
    fromEnum SelectionAffinityUpstream = 0
    fromEnum SelectionAffinityDownstream = 1
    fromEnum (AnotherSelectionAffinity k) = k

    toEnum 0 = SelectionAffinityUpstream
    toEnum 1 = SelectionAffinityDownstream
    toEnum k = AnotherSelectionAffinity k

instance P.Ord SelectionAffinity where
    compare a b = P.compare (P.fromEnum a) (P.fromEnum b)

foreign import ccall "webkit_selection_affinity_get_type" c_webkit_selection_affinity_get_type :: 
    IO GType

instance BoxedEnum SelectionAffinity where
    boxedEnumType _ = c_webkit_selection_affinity_get_type

-- Enum PolicyError
{- |
Enum values used to denote the various policy errors.
-}
data PolicyError = 
      PolicyErrorFailed
    {- ^
    Generic load failure due to policy error
    -}
    | PolicyErrorCannotShowMimeType
    {- ^
    Load failure due to unsupported mime type
    -}
    | PolicyErrorCannotShowUrl
    {- ^
    Load failure due to URI that can not be shown
    -}
    | PolicyErrorFrameLoadInterruptedByPolicyChange
    {- ^
    Load failure due to frame load interruption by policy change
    -}
    | PolicyErrorCannotUseRestrictedPort
    {- ^
    Load failure due to port restriction
    -}
    | AnotherPolicyError Int
    -- ^ Catch-all for unknown values
    deriving (Show, Eq)

instance P.Enum PolicyError where
    fromEnum PolicyErrorFailed = 199
    fromEnum PolicyErrorCannotShowMimeType = 100
    fromEnum PolicyErrorCannotShowUrl = 101
    fromEnum PolicyErrorFrameLoadInterruptedByPolicyChange = 102
    fromEnum PolicyErrorCannotUseRestrictedPort = 103
    fromEnum (AnotherPolicyError k) = k

    toEnum 199 = PolicyErrorFailed
    toEnum 100 = PolicyErrorCannotShowMimeType
    toEnum 101 = PolicyErrorCannotShowUrl
    toEnum 102 = PolicyErrorFrameLoadInterruptedByPolicyChange
    toEnum 103 = PolicyErrorCannotUseRestrictedPort
    toEnum k = AnotherPolicyError k

instance P.Ord PolicyError where
    compare a b = P.compare (P.fromEnum a) (P.fromEnum b)

instance GErrorClass PolicyError where
    gerrorClassDomain _ = "WebKitPolicyError"

catchPolicyError ::
    IO a ->
    (PolicyError -> GErrorMessage -> IO a) ->
    IO a
catchPolicyError = catchGErrorJustDomain

handlePolicyError ::
    (PolicyError -> GErrorMessage -> IO a) ->
    IO a ->
    IO a
handlePolicyError = handleGErrorJustDomain

foreign import ccall "webkit_policy_error_get_type" c_webkit_policy_error_get_type :: 
    IO GType

instance BoxedEnum PolicyError where
    boxedEnumType _ = c_webkit_policy_error_get_type

-- Enum PluginError
{- |
Enum values used to denote the various plugin errors.
-}
data PluginError = 
      PluginErrorFailed
    {- ^
    Generic plugin load failure
    -}
    | PluginErrorCannotFindPlugin
    {- ^
    Load failure due to missing plugin
    -}
    | PluginErrorCannotLoadPlugin
    {- ^
    Load failure due to inability to load plugin
    -}
    | PluginErrorJavaUnavailable
    {- ^
    Load failue due to missing Java support that is required to load plugin
    -}
    | PluginErrorConnectionCancelled
    {- ^
    Load failure due to connection cancellation
    -}
    | PluginErrorWillHandleLoad
    {- ^
    Load failure since plugin handles the load
    -}
    | AnotherPluginError Int
    -- ^ Catch-all for unknown values
    deriving (Show, Eq)

instance P.Enum PluginError where
    fromEnum PluginErrorFailed = 299
    fromEnum PluginErrorCannotFindPlugin = 200
    fromEnum PluginErrorCannotLoadPlugin = 201
    fromEnum PluginErrorJavaUnavailable = 202
    fromEnum PluginErrorConnectionCancelled = 203
    fromEnum PluginErrorWillHandleLoad = 204
    fromEnum (AnotherPluginError k) = k

    toEnum 299 = PluginErrorFailed
    toEnum 200 = PluginErrorCannotFindPlugin
    toEnum 201 = PluginErrorCannotLoadPlugin
    toEnum 202 = PluginErrorJavaUnavailable
    toEnum 203 = PluginErrorConnectionCancelled
    toEnum 204 = PluginErrorWillHandleLoad
    toEnum k = AnotherPluginError k

instance P.Ord PluginError where
    compare a b = P.compare (P.fromEnum a) (P.fromEnum b)

instance GErrorClass PluginError where
    gerrorClassDomain _ = "WebKitPluginError"

catchPluginError ::
    IO a ->
    (PluginError -> GErrorMessage -> IO a) ->
    IO a
catchPluginError = catchGErrorJustDomain

handlePluginError ::
    (PluginError -> GErrorMessage -> IO a) ->
    IO a ->
    IO a
handlePluginError = handleGErrorJustDomain

foreign import ccall "webkit_plugin_error_get_type" c_webkit_plugin_error_get_type :: 
    IO GType

instance BoxedEnum PluginError where
    boxedEnumType _ = c_webkit_plugin_error_get_type

-- Enum NetworkError
{- |
Enum values used to denote the various network errors.
-}
data NetworkError = 
      NetworkErrorFailed
    {- ^
    Generic load failure
    -}
    | NetworkErrorTransport
    {- ^
    Load failure due to transport error
    -}
    | NetworkErrorUnknownProtocol
    {- ^
    Load failure due to unknown protocol
    -}
    | NetworkErrorCancelled
    {- ^
    Load failure due to cancellation
    -}
    | NetworkErrorFileDoesNotExist
    {- ^
    Load failure due to missing file
    -}
    | AnotherNetworkError Int
    -- ^ Catch-all for unknown values
    deriving (Show, Eq)

instance P.Enum NetworkError where
    fromEnum NetworkErrorFailed = 399
    fromEnum NetworkErrorTransport = 300
    fromEnum NetworkErrorUnknownProtocol = 301
    fromEnum NetworkErrorCancelled = 302
    fromEnum NetworkErrorFileDoesNotExist = 303
    fromEnum (AnotherNetworkError k) = k

    toEnum 399 = NetworkErrorFailed
    toEnum 300 = NetworkErrorTransport
    toEnum 301 = NetworkErrorUnknownProtocol
    toEnum 302 = NetworkErrorCancelled
    toEnum 303 = NetworkErrorFileDoesNotExist
    toEnum k = AnotherNetworkError k

instance P.Ord NetworkError where
    compare a b = P.compare (P.fromEnum a) (P.fromEnum b)

instance GErrorClass NetworkError where
    gerrorClassDomain _ = "WebKitNetworkError"

catchNetworkError ::
    IO a ->
    (NetworkError -> GErrorMessage -> IO a) ->
    IO a
catchNetworkError = catchGErrorJustDomain

handleNetworkError ::
    (NetworkError -> GErrorMessage -> IO a) ->
    IO a ->
    IO a
handleNetworkError = handleGErrorJustDomain

foreign import ccall "webkit_network_error_get_type" c_webkit_network_error_get_type :: 
    IO GType

instance BoxedEnum NetworkError where
    boxedEnumType _ = c_webkit_network_error_get_type

-- Enum NavigationResponse
{- |
Enum values used to denote the various responses to a navigation policy decision.
-}
data NavigationResponse = 
      NavigationResponseAccept
    {- ^
    Instruct WebKit to allow the navigation.
    -}
    | NavigationResponseIgnore
    {- ^
    Instruct WebKit to ignore the navigation.
    -}
    | NavigationResponseDownload
    {- ^
    Instruct WebKit to start a download of the destination instead.
    -}
    | AnotherNavigationResponse Int
    -- ^ Catch-all for unknown values
    deriving (Show, Eq)

instance P.Enum NavigationResponse where
    fromEnum NavigationResponseAccept = 0
    fromEnum NavigationResponseIgnore = 1
    fromEnum NavigationResponseDownload = 2
    fromEnum (AnotherNavigationResponse k) = k

    toEnum 0 = NavigationResponseAccept
    toEnum 1 = NavigationResponseIgnore
    toEnum 2 = NavigationResponseDownload
    toEnum k = AnotherNavigationResponse k

instance P.Ord NavigationResponse where
    compare a b = P.compare (P.fromEnum a) (P.fromEnum b)

foreign import ccall "webkit_navigation_response_get_type" c_webkit_navigation_response_get_type :: 
    IO GType

instance BoxedEnum NavigationResponse where
    boxedEnumType _ = c_webkit_navigation_response_get_type

-- Enum LoadStatus
{- |
/No description available in the introspection data./
-}
data LoadStatus = 
      LoadStatusProvisional
    {- ^
    No data has been received yet, empty
    structures have been allocated to perform the load; the load may
    still fail for transport issues such as not being able to resolve a
    name, or connect to a port.
    -}
    | LoadStatusCommitted
    {- ^
    The first data chunk has arrived, meaning
    that the necessary transport requirements are stabilished, and the
    load is being performed.
    -}
    | LoadStatusFinished
    {- ^
    This state means that everything that was
    required to display the page has been loaded.
    -}
    | LoadStatusFirstVisuallyNonEmptyLayout
    {- ^
    The first layout with
    actual visible content happened; one or more layouts may have
    happened before that caused nothing to be visible on the screen,
    because the data available at the time was not significant enough.
    -}
    | LoadStatusFailed
    {- ^
    This state means that some error occurred
    during the page load that prevented it from being completed. You
    can connect to the 'GI.WebKit.Objects.WebView.WebView'::@/load-error/@ signal if you want to
    know precisely what kind of error occurred.
    -}
    | AnotherLoadStatus Int
    -- ^ Catch-all for unknown values
    deriving (Show, Eq)

instance P.Enum LoadStatus where
    fromEnum LoadStatusProvisional = 0
    fromEnum LoadStatusCommitted = 1
    fromEnum LoadStatusFinished = 2
    fromEnum LoadStatusFirstVisuallyNonEmptyLayout = 3
    fromEnum LoadStatusFailed = 4
    fromEnum (AnotherLoadStatus k) = k

    toEnum 0 = LoadStatusProvisional
    toEnum 1 = LoadStatusCommitted
    toEnum 2 = LoadStatusFinished
    toEnum 3 = LoadStatusFirstVisuallyNonEmptyLayout
    toEnum 4 = LoadStatusFailed
    toEnum k = AnotherLoadStatus k

instance P.Ord LoadStatus where
    compare a b = P.compare (P.fromEnum a) (P.fromEnum b)

foreign import ccall "webkit_load_status_get_type" c_webkit_load_status_get_type :: 
    IO GType

instance BoxedEnum LoadStatus where
    boxedEnumType _ = c_webkit_load_status_get_type

-- Enum InsertAction
{- |
/No description available in the introspection data./
-}
data InsertAction = 
      InsertActionTyped
    {- ^
    /No description available in the introspection data./
    -}
    | InsertActionPasted
    {- ^
    /No description available in the introspection data./
    -}
    | InsertActionDropped
    {- ^
    /No description available in the introspection data./
    -}
    | AnotherInsertAction Int
    -- ^ Catch-all for unknown values
    deriving (Show, Eq)

instance P.Enum InsertAction where
    fromEnum InsertActionTyped = 0
    fromEnum InsertActionPasted = 1
    fromEnum InsertActionDropped = 2
    fromEnum (AnotherInsertAction k) = k

    toEnum 0 = InsertActionTyped
    toEnum 1 = InsertActionPasted
    toEnum 2 = InsertActionDropped
    toEnum k = AnotherInsertAction k

instance P.Ord InsertAction where
    compare a b = P.compare (P.fromEnum a) (P.fromEnum b)

foreign import ccall "webkit_insert_action_get_type" c_webkit_insert_action_get_type :: 
    IO GType

instance BoxedEnum InsertAction where
    boxedEnumType _ = c_webkit_insert_action_get_type

-- Enum EditingBehavior
{- |
Enum values used for determining the editing behavior of editable elements.
-}
data EditingBehavior = 
      EditingBehaviorMac
    {- ^
    Editing behavior mimicking OS X user interfaces.
    -}
    | EditingBehaviorWindows
    {- ^
    Editing behavior mimicking Windows user interfaces.
    -}
    | EditingBehaviorUnix
    {- ^
    Editing behavior mimicking free desktop user interfaces.
    -}
    | AnotherEditingBehavior Int
    -- ^ Catch-all for unknown values
    deriving (Show, Eq)

instance P.Enum EditingBehavior where
    fromEnum EditingBehaviorMac = 0
    fromEnum EditingBehaviorWindows = 1
    fromEnum EditingBehaviorUnix = 2
    fromEnum (AnotherEditingBehavior k) = k

    toEnum 0 = EditingBehaviorMac
    toEnum 1 = EditingBehaviorWindows
    toEnum 2 = EditingBehaviorUnix
    toEnum k = AnotherEditingBehavior k

instance P.Ord EditingBehavior where
    compare a b = P.compare (P.fromEnum a) (P.fromEnum b)

foreign import ccall "webkit_editing_behavior_get_type" c_webkit_editing_behavior_get_type :: 
    IO GType

instance BoxedEnum EditingBehavior where
    boxedEnumType _ = c_webkit_editing_behavior_get_type

-- Enum DownloadStatus
{- |
Enum values used to denote the various states of a download.
-}
data DownloadStatus = 
      DownloadStatusError
    {- ^
    The download failed because of an error other than user cancellation.
    -}
    | DownloadStatusCreated
    {- ^
    The download has not started yet.
    -}
    | DownloadStatusStarted
    {- ^
    The download has started, but has not completed yet.
    -}
    | DownloadStatusCancelled
    {- ^
    The user canceled the download.
    -}
    | DownloadStatusFinished
    {- ^
    The download completed successfully.
    -}
    | AnotherDownloadStatus Int
    -- ^ Catch-all for unknown values
    deriving (Show, Eq)

instance P.Enum DownloadStatus where
    fromEnum DownloadStatusError = -1
    fromEnum DownloadStatusCreated = 0
    fromEnum DownloadStatusStarted = 1
    fromEnum DownloadStatusCancelled = 2
    fromEnum DownloadStatusFinished = 3
    fromEnum (AnotherDownloadStatus k) = k

    toEnum -1 = DownloadStatusError
    toEnum 0 = DownloadStatusCreated
    toEnum 1 = DownloadStatusStarted
    toEnum 2 = DownloadStatusCancelled
    toEnum 3 = DownloadStatusFinished
    toEnum k = AnotherDownloadStatus k

instance P.Ord DownloadStatus where
    compare a b = P.compare (P.fromEnum a) (P.fromEnum b)

foreign import ccall "webkit_download_status_get_type" c_webkit_download_status_get_type :: 
    IO GType

instance BoxedEnum DownloadStatus where
    boxedEnumType _ = c_webkit_download_status_get_type

-- Enum DownloadError
{- |
Enum values used to denote the various download errors.
-}
data DownloadError = 
      DownloadErrorCancelledByUser
    {- ^
    The download failed due to user cancellation.
    -}
    | DownloadErrorDestination
    {- ^
    The download failed due to disk write failure.
    -}
    | DownloadErrorNetwork
    {- ^
    The download failed due to a network error.
    -}
    | AnotherDownloadError Int
    -- ^ Catch-all for unknown values
    deriving (Show, Eq)

instance P.Enum DownloadError where
    fromEnum DownloadErrorCancelledByUser = 0
    fromEnum DownloadErrorDestination = 1
    fromEnum DownloadErrorNetwork = 2
    fromEnum (AnotherDownloadError k) = k

    toEnum 0 = DownloadErrorCancelledByUser
    toEnum 1 = DownloadErrorDestination
    toEnum 2 = DownloadErrorNetwork
    toEnum k = AnotherDownloadError k

instance P.Ord DownloadError where
    compare a b = P.compare (P.fromEnum a) (P.fromEnum b)

foreign import ccall "webkit_download_error_get_type" c_webkit_download_error_get_type :: 
    IO GType

instance BoxedEnum DownloadError where
    boxedEnumType _ = c_webkit_download_error_get_type

-- Enum ContextMenuAction
{- |
Enum values used to denote actions of items in the default context menu.

@since 1.10
-}
data ContextMenuAction = 
      ContextMenuActionNoAction
    {- ^
    No action, used by separator menu items.
    -}
    | ContextMenuActionOpenLink
    {- ^
    Open current link.
    -}
    | ContextMenuActionOpenLinkInNewWindow
    {- ^
    Open current link in a new window.
    -}
    | ContextMenuActionDownloadLinkToDisk
    {- ^
    Download link destination.
    -}
    | ContextMenuActionCopyLinkToClipboard
    {- ^
    Copy link location to the clipboard.
    -}
    | ContextMenuActionOpenImageInNewWindow
    {- ^
    Open current image in a new window.
    -}
    | ContextMenuActionDownloadImageToDisk
    {- ^
    Download current image.
    -}
    | ContextMenuActionCopyImageToClipboard
    {- ^
    Copy current image to the clipboard.
    -}
    | ContextMenuActionCopyImageUrlToClipboard
    {- ^
    Copy curent image location to the clipboard.
    -}
    | ContextMenuActionOpenFrameInNewWindow
    {- ^
    Open current frame in a new window.
    -}
    | ContextMenuActionGoBack
    {- ^
    Load the previous history item.
    -}
    | ContextMenuActionGoForward
    {- ^
    Load the next history item.
    -}
    | ContextMenuActionStop
    {- ^
    Stop any ongoing loading operation.
    -}
    | ContextMenuActionReload
    {- ^
    Reload the conents of current view.
    -}
    | ContextMenuActionCopy
    {- ^
    Copy current selection the clipboard.
    -}
    | ContextMenuActionCut
    {- ^
    Cut current selection to the clipboard.
    -}
    | ContextMenuActionPaste
    {- ^
    Paste clipboard contents.
    -}
    | ContextMenuActionDelete
    {- ^
    Delete current selection.
    -}
    | ContextMenuActionSelectAll
    {- ^
    Select all text.
    -}
    | ContextMenuActionInputMethods
    {- ^
    Input methods menu.
    -}
    | ContextMenuActionUnicode
    {- ^
    Unicode menu.
    -}
    | ContextMenuActionSpellingGuess
    {- ^
    Guess spelling.
    -}
    | ContextMenuActionNoGuessesFound
    {- ^
    No guesses found.
    -}
    | ContextMenuActionIgnoreSpelling
    {- ^
    Ignore spelling.
    -}
    | ContextMenuActionLearnSpelling
    {- ^
    Learn spelling.
    -}
    | ContextMenuActionIgnoreGrammar
    {- ^
    Ignore grammar.
    -}
    | ContextMenuActionFontMenu
    {- ^
    Font menu.
    -}
    | ContextMenuActionBold
    {- ^
    Bold.
    -}
    | ContextMenuActionItalic
    {- ^
    Italic.
    -}
    | ContextMenuActionUnderline
    {- ^
    Underline.
    -}
    | ContextMenuActionOutline
    {- ^
    Outline.
    -}
    | ContextMenuActionInspectElement
    {- ^
    Open current element in the inspector.
    -}
    | ContextMenuActionOpenMediaInNewWindow
    {- ^
    Open current media element in a new window.
    -}
    | ContextMenuActionCopyMediaLinkToClipboard
    {- ^
    Copy media link location in to the clipboard.
    -}
    | ContextMenuActionToggleMediaControls
    {- ^
    Enable or disable media controls.
    -}
    | ContextMenuActionToggleMediaLoop
    {- ^
    Enable or disable media loop.
    -}
    | ContextMenuActionEnterVideoFullscreen
    {- ^
    Show current video element in fullscreen mode.
    -}
    | ContextMenuActionMediaPlayPause
    {- ^
    Play or pause current media element.
    -}
    | ContextMenuActionMediaMute
    {- ^
    Mute current media element.
    -}
    | AnotherContextMenuAction Int
    -- ^ Catch-all for unknown values
    deriving (Show, Eq)

instance P.Enum ContextMenuAction where
    fromEnum ContextMenuActionNoAction = 0
    fromEnum ContextMenuActionOpenLink = 1
    fromEnum ContextMenuActionOpenLinkInNewWindow = 2
    fromEnum ContextMenuActionDownloadLinkToDisk = 3
    fromEnum ContextMenuActionCopyLinkToClipboard = 4
    fromEnum ContextMenuActionOpenImageInNewWindow = 5
    fromEnum ContextMenuActionDownloadImageToDisk = 6
    fromEnum ContextMenuActionCopyImageToClipboard = 7
    fromEnum ContextMenuActionCopyImageUrlToClipboard = 8
    fromEnum ContextMenuActionOpenFrameInNewWindow = 9
    fromEnum ContextMenuActionGoBack = 10
    fromEnum ContextMenuActionGoForward = 11
    fromEnum ContextMenuActionStop = 12
    fromEnum ContextMenuActionReload = 13
    fromEnum ContextMenuActionCopy = 14
    fromEnum ContextMenuActionCut = 15
    fromEnum ContextMenuActionPaste = 16
    fromEnum ContextMenuActionDelete = 17
    fromEnum ContextMenuActionSelectAll = 18
    fromEnum ContextMenuActionInputMethods = 19
    fromEnum ContextMenuActionUnicode = 20
    fromEnum ContextMenuActionSpellingGuess = 21
    fromEnum ContextMenuActionNoGuessesFound = 22
    fromEnum ContextMenuActionIgnoreSpelling = 23
    fromEnum ContextMenuActionLearnSpelling = 24
    fromEnum ContextMenuActionIgnoreGrammar = 25
    fromEnum ContextMenuActionFontMenu = 26
    fromEnum ContextMenuActionBold = 27
    fromEnum ContextMenuActionItalic = 28
    fromEnum ContextMenuActionUnderline = 29
    fromEnum ContextMenuActionOutline = 30
    fromEnum ContextMenuActionInspectElement = 31
    fromEnum ContextMenuActionOpenMediaInNewWindow = 32
    fromEnum ContextMenuActionCopyMediaLinkToClipboard = 33
    fromEnum ContextMenuActionToggleMediaControls = 34
    fromEnum ContextMenuActionToggleMediaLoop = 35
    fromEnum ContextMenuActionEnterVideoFullscreen = 36
    fromEnum ContextMenuActionMediaPlayPause = 37
    fromEnum ContextMenuActionMediaMute = 38
    fromEnum (AnotherContextMenuAction k) = k

    toEnum 0 = ContextMenuActionNoAction
    toEnum 1 = ContextMenuActionOpenLink
    toEnum 2 = ContextMenuActionOpenLinkInNewWindow
    toEnum 3 = ContextMenuActionDownloadLinkToDisk
    toEnum 4 = ContextMenuActionCopyLinkToClipboard
    toEnum 5 = ContextMenuActionOpenImageInNewWindow
    toEnum 6 = ContextMenuActionDownloadImageToDisk
    toEnum 7 = ContextMenuActionCopyImageToClipboard
    toEnum 8 = ContextMenuActionCopyImageUrlToClipboard
    toEnum 9 = ContextMenuActionOpenFrameInNewWindow
    toEnum 10 = ContextMenuActionGoBack
    toEnum 11 = ContextMenuActionGoForward
    toEnum 12 = ContextMenuActionStop
    toEnum 13 = ContextMenuActionReload
    toEnum 14 = ContextMenuActionCopy
    toEnum 15 = ContextMenuActionCut
    toEnum 16 = ContextMenuActionPaste
    toEnum 17 = ContextMenuActionDelete
    toEnum 18 = ContextMenuActionSelectAll
    toEnum 19 = ContextMenuActionInputMethods
    toEnum 20 = ContextMenuActionUnicode
    toEnum 21 = ContextMenuActionSpellingGuess
    toEnum 22 = ContextMenuActionNoGuessesFound
    toEnum 23 = ContextMenuActionIgnoreSpelling
    toEnum 24 = ContextMenuActionLearnSpelling
    toEnum 25 = ContextMenuActionIgnoreGrammar
    toEnum 26 = ContextMenuActionFontMenu
    toEnum 27 = ContextMenuActionBold
    toEnum 28 = ContextMenuActionItalic
    toEnum 29 = ContextMenuActionUnderline
    toEnum 30 = ContextMenuActionOutline
    toEnum 31 = ContextMenuActionInspectElement
    toEnum 32 = ContextMenuActionOpenMediaInNewWindow
    toEnum 33 = ContextMenuActionCopyMediaLinkToClipboard
    toEnum 34 = ContextMenuActionToggleMediaControls
    toEnum 35 = ContextMenuActionToggleMediaLoop
    toEnum 36 = ContextMenuActionEnterVideoFullscreen
    toEnum 37 = ContextMenuActionMediaPlayPause
    toEnum 38 = ContextMenuActionMediaMute
    toEnum k = AnotherContextMenuAction k

instance P.Ord ContextMenuAction where
    compare a b = P.compare (P.fromEnum a) (P.fromEnum b)

foreign import ccall "webkit_context_menu_action_get_type" c_webkit_context_menu_action_get_type :: 
    IO GType

instance BoxedEnum ContextMenuAction where
    boxedEnumType _ = c_webkit_context_menu_action_get_type

-- Enum CacheModel
{- |
Enum values used for determining the webview cache model.
-}
data CacheModel = 
      CacheModelDefault
    {- ^
    The default cache model. This is
      WEBKIT_CACHE_MODEL_WEB_BROWSER.
    -}
    | CacheModelDocumentViewer
    {- ^
    Disable the cache completely, which
      substantially reduces memory usage. Useful for applications that only
      access a single local file, with no navigation to other pages. No remote
      resources will be cached.
    -}
    | CacheModelWebBrowser
    {- ^
    Improve document load speed substantially
      by caching a very large number of resources and previously viewed content.
    -}
    | CacheModelDocumentBrowser
    {- ^
    A cache model optimized for viewing
      a series of local files -- for example, a documentation viewer or a website
      designer. WebKit will cache a moderate number of resources.
    -}
    | AnotherCacheModel Int
    -- ^ Catch-all for unknown values
    deriving (Show, Eq)

instance P.Enum CacheModel where
    fromEnum CacheModelDefault = 0
    fromEnum CacheModelDocumentViewer = 1
    fromEnum CacheModelWebBrowser = 2
    fromEnum CacheModelDocumentBrowser = 3
    fromEnum (AnotherCacheModel k) = k

    toEnum 0 = CacheModelDefault
    toEnum 1 = CacheModelDocumentViewer
    toEnum 2 = CacheModelWebBrowser
    toEnum 3 = CacheModelDocumentBrowser
    toEnum k = AnotherCacheModel k

instance P.Ord CacheModel where
    compare a b = P.compare (P.fromEnum a) (P.fromEnum b)

foreign import ccall "webkit_cache_model_get_type" c_webkit_cache_model_get_type :: 
    IO GType

instance BoxedEnum CacheModel where
    boxedEnumType _ = c_webkit_cache_model_get_type