-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Secret.Enums
    ( 

 -- * Enumerations


-- ** BackendFlags #enum:BackendFlags#

    BackendFlags(..)                        ,


-- ** Error #enum:Error#

    Error(..)                               ,


-- ** SchemaAttributeType #enum:SchemaAttributeType#

    SchemaAttributeType(..)                 ,


-- ** SchemaType #enum:SchemaType#

    SchemaType(..)                          ,




    ) 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
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 GHC.OverloadedLabels as OL
import qualified GHC.Records as R


-- Enum SchemaType
-- | Different types of schemas for storing secrets, intended for use with
-- 'GI.Secret.Functions.getSchema'.
-- 
-- /Since: 0.18.6/
data SchemaType = 
      SchemaTypeNote
    -- ^ Personal passwords; see @/SECRET_SCHEMA_NOTE/@
    | SchemaTypeCompatNetwork
    -- ^ Network passwords from older
    --    libgnome-keyring storage; see @/SECRET_SCHEMA_COMPAT_NETWORK/@
    | AnotherSchemaType Int
    -- ^ Catch-all for unknown values
    deriving (Int -> SchemaType -> ShowS
[SchemaType] -> ShowS
SchemaType -> String
(Int -> SchemaType -> ShowS)
-> (SchemaType -> String)
-> ([SchemaType] -> ShowS)
-> Show SchemaType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SchemaType] -> ShowS
$cshowList :: [SchemaType] -> ShowS
show :: SchemaType -> String
$cshow :: SchemaType -> String
showsPrec :: Int -> SchemaType -> ShowS
$cshowsPrec :: Int -> SchemaType -> ShowS
Show, SchemaType -> SchemaType -> Bool
(SchemaType -> SchemaType -> Bool)
-> (SchemaType -> SchemaType -> Bool) -> Eq SchemaType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SchemaType -> SchemaType -> Bool
$c/= :: SchemaType -> SchemaType -> Bool
== :: SchemaType -> SchemaType -> Bool
$c== :: SchemaType -> SchemaType -> Bool
Eq)

instance P.Enum SchemaType where
    fromEnum :: SchemaType -> Int
fromEnum SchemaType
SchemaTypeNote = Int
0
    fromEnum SchemaType
SchemaTypeCompatNetwork = Int
1
    fromEnum (AnotherSchemaType Int
k) = Int
k

    toEnum :: Int -> SchemaType
toEnum Int
0 = SchemaType
SchemaTypeNote
    toEnum Int
1 = SchemaType
SchemaTypeCompatNetwork
    toEnum Int
k = Int -> SchemaType
AnotherSchemaType Int
k

instance P.Ord SchemaType where
    compare :: SchemaType -> SchemaType -> Ordering
compare SchemaType
a SchemaType
b = Int -> Int -> Ordering
forall a. Ord a => a -> a -> Ordering
P.compare (SchemaType -> Int
forall a. Enum a => a -> Int
P.fromEnum SchemaType
a) (SchemaType -> Int
forall a. Enum a => a -> Int
P.fromEnum SchemaType
b)

type instance O.ParentTypes SchemaType = '[]
instance O.HasParentTypes SchemaType

foreign import ccall "secret_schema_type_get_type" c_secret_schema_type_get_type :: 
    IO GType

instance B.Types.TypedObject SchemaType where
    glibType :: IO GType
glibType = IO GType
c_secret_schema_type_get_type

instance B.Types.BoxedEnum SchemaType

-- Enum SchemaAttributeType
-- | The type of an attribute in a t'GI.Secret.Structs.Schema.Schema'. Attributes are stored as strings
-- in the Secret Service, and the attribute types simply define standard ways
-- to store integer and boolean values as strings.
data SchemaAttributeType = 
      SchemaAttributeTypeString
    -- ^ a utf-8 string attribute
    | SchemaAttributeTypeInteger
    -- ^ an integer attribute, stored as a decimal
    | SchemaAttributeTypeBoolean
    -- ^ a boolean attribute, stored as \'true\' or \'false\'
    | AnotherSchemaAttributeType Int
    -- ^ Catch-all for unknown values
    deriving (Int -> SchemaAttributeType -> ShowS
[SchemaAttributeType] -> ShowS
SchemaAttributeType -> String
(Int -> SchemaAttributeType -> ShowS)
-> (SchemaAttributeType -> String)
-> ([SchemaAttributeType] -> ShowS)
-> Show SchemaAttributeType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SchemaAttributeType] -> ShowS
$cshowList :: [SchemaAttributeType] -> ShowS
show :: SchemaAttributeType -> String
$cshow :: SchemaAttributeType -> String
showsPrec :: Int -> SchemaAttributeType -> ShowS
$cshowsPrec :: Int -> SchemaAttributeType -> ShowS
Show, SchemaAttributeType -> SchemaAttributeType -> Bool
(SchemaAttributeType -> SchemaAttributeType -> Bool)
-> (SchemaAttributeType -> SchemaAttributeType -> Bool)
-> Eq SchemaAttributeType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SchemaAttributeType -> SchemaAttributeType -> Bool
$c/= :: SchemaAttributeType -> SchemaAttributeType -> Bool
== :: SchemaAttributeType -> SchemaAttributeType -> Bool
$c== :: SchemaAttributeType -> SchemaAttributeType -> Bool
Eq)

instance P.Enum SchemaAttributeType where
    fromEnum :: SchemaAttributeType -> Int
fromEnum SchemaAttributeType
SchemaAttributeTypeString = Int
0
    fromEnum SchemaAttributeType
SchemaAttributeTypeInteger = Int
1
    fromEnum SchemaAttributeType
SchemaAttributeTypeBoolean = Int
2
    fromEnum (AnotherSchemaAttributeType Int
k) = Int
k

    toEnum :: Int -> SchemaAttributeType
toEnum Int
0 = SchemaAttributeType
SchemaAttributeTypeString
    toEnum Int
1 = SchemaAttributeType
SchemaAttributeTypeInteger
    toEnum Int
2 = SchemaAttributeType
SchemaAttributeTypeBoolean
    toEnum Int
k = Int -> SchemaAttributeType
AnotherSchemaAttributeType Int
k

instance P.Ord SchemaAttributeType where
    compare :: SchemaAttributeType -> SchemaAttributeType -> Ordering
compare SchemaAttributeType
a SchemaAttributeType
b = Int -> Int -> Ordering
forall a. Ord a => a -> a -> Ordering
P.compare (SchemaAttributeType -> Int
forall a. Enum a => a -> Int
P.fromEnum SchemaAttributeType
a) (SchemaAttributeType -> Int
forall a. Enum a => a -> Int
P.fromEnum SchemaAttributeType
b)

type instance O.ParentTypes SchemaAttributeType = '[]
instance O.HasParentTypes SchemaAttributeType

foreign import ccall "secret_schema_attribute_type_get_type" c_secret_schema_attribute_type_get_type :: 
    IO GType

instance B.Types.TypedObject SchemaAttributeType where
    glibType :: IO GType
glibType = IO GType
c_secret_schema_attribute_type_get_type

instance B.Types.BoxedEnum SchemaAttributeType

-- Enum Error
-- | /No description available in the introspection data./
data Error = 
      ErrorProtocol
    -- ^ /No description available in the introspection data./
    | ErrorIsLocked
    -- ^ /No description available in the introspection data./
    | ErrorNoSuchObject
    -- ^ /No description available in the introspection data./
    | ErrorAlreadyExists
    -- ^ /No description available in the introspection data./
    | ErrorInvalidFileFormat
    -- ^ /No description available in the introspection data./
    | AnotherError Int
    -- ^ Catch-all for unknown values
    deriving (Int -> Error -> ShowS
[Error] -> ShowS
Error -> String
(Int -> Error -> ShowS)
-> (Error -> String) -> ([Error] -> ShowS) -> Show Error
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Error] -> ShowS
$cshowList :: [Error] -> ShowS
show :: Error -> String
$cshow :: Error -> String
showsPrec :: Int -> Error -> ShowS
$cshowsPrec :: Int -> Error -> ShowS
Show, Error -> Error -> Bool
(Error -> Error -> Bool) -> (Error -> Error -> Bool) -> Eq Error
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Error -> Error -> Bool
$c/= :: Error -> Error -> Bool
== :: Error -> Error -> Bool
$c== :: Error -> Error -> Bool
Eq)

instance P.Enum Error where
    fromEnum :: Error -> Int
fromEnum Error
ErrorProtocol = Int
1
    fromEnum Error
ErrorIsLocked = Int
2
    fromEnum Error
ErrorNoSuchObject = Int
3
    fromEnum Error
ErrorAlreadyExists = Int
4
    fromEnum Error
ErrorInvalidFileFormat = Int
5
    fromEnum (AnotherError Int
k) = Int
k

    toEnum :: Int -> Error
toEnum Int
1 = Error
ErrorProtocol
    toEnum Int
2 = Error
ErrorIsLocked
    toEnum Int
3 = Error
ErrorNoSuchObject
    toEnum Int
4 = Error
ErrorAlreadyExists
    toEnum Int
5 = Error
ErrorInvalidFileFormat
    toEnum Int
k = Int -> Error
AnotherError Int
k

instance P.Ord Error where
    compare :: Error -> Error -> Ordering
compare Error
a Error
b = Int -> Int -> Ordering
forall a. Ord a => a -> a -> Ordering
P.compare (Error -> Int
forall a. Enum a => a -> Int
P.fromEnum Error
a) (Error -> Int
forall a. Enum a => a -> Int
P.fromEnum Error
b)

type instance O.ParentTypes Error = '[]
instance O.HasParentTypes Error

foreign import ccall "secret_error_get_type" c_secret_error_get_type :: 
    IO GType

instance B.Types.TypedObject Error where
    glibType :: IO GType
glibType = IO GType
c_secret_error_get_type

instance B.Types.BoxedEnum Error

-- Enum BackendFlags
-- | Flags which determine which parts of the t'GI.Secret.Interfaces.Backend.Backend' are initialized.
-- 
-- /Since: 0.19.0/
data BackendFlags = 
      BackendFlagsNone
    -- ^ no flags for initializing the t'GI.Secret.Interfaces.Backend.Backend'
    | BackendFlagsOpenSession
    -- ^ establish a session for transfer of secrets
    --                               while initializing the t'GI.Secret.Interfaces.Backend.Backend'
    | BackendFlagsLoadCollections
    -- ^ load collections while initializing the
    --                                   t'GI.Secret.Interfaces.Backend.Backend'
    | AnotherBackendFlags Int
    -- ^ Catch-all for unknown values
    deriving (Int -> BackendFlags -> ShowS
[BackendFlags] -> ShowS
BackendFlags -> String
(Int -> BackendFlags -> ShowS)
-> (BackendFlags -> String)
-> ([BackendFlags] -> ShowS)
-> Show BackendFlags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BackendFlags] -> ShowS
$cshowList :: [BackendFlags] -> ShowS
show :: BackendFlags -> String
$cshow :: BackendFlags -> String
showsPrec :: Int -> BackendFlags -> ShowS
$cshowsPrec :: Int -> BackendFlags -> ShowS
Show, BackendFlags -> BackendFlags -> Bool
(BackendFlags -> BackendFlags -> Bool)
-> (BackendFlags -> BackendFlags -> Bool) -> Eq BackendFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BackendFlags -> BackendFlags -> Bool
$c/= :: BackendFlags -> BackendFlags -> Bool
== :: BackendFlags -> BackendFlags -> Bool
$c== :: BackendFlags -> BackendFlags -> Bool
Eq)

instance P.Enum BackendFlags where
    fromEnum :: BackendFlags -> Int
fromEnum BackendFlags
BackendFlagsNone = Int
0
    fromEnum BackendFlags
BackendFlagsOpenSession = Int
2
    fromEnum BackendFlags
BackendFlagsLoadCollections = Int
4
    fromEnum (AnotherBackendFlags Int
k) = Int
k

    toEnum :: Int -> BackendFlags
toEnum Int
0 = BackendFlags
BackendFlagsNone
    toEnum Int
2 = BackendFlags
BackendFlagsOpenSession
    toEnum Int
4 = BackendFlags
BackendFlagsLoadCollections
    toEnum Int
k = Int -> BackendFlags
AnotherBackendFlags Int
k

instance P.Ord BackendFlags where
    compare :: BackendFlags -> BackendFlags -> Ordering
compare BackendFlags
a BackendFlags
b = Int -> Int -> Ordering
forall a. Ord a => a -> a -> Ordering
P.compare (BackendFlags -> Int
forall a. Enum a => a -> Int
P.fromEnum BackendFlags
a) (BackendFlags -> Int
forall a. Enum a => a -> Int
P.fromEnum BackendFlags
b)

type instance O.ParentTypes BackendFlags = '[]
instance O.HasParentTypes BackendFlags

foreign import ccall "secret_backend_flags_get_type" c_secret_backend_flags_get_type :: 
    IO GType

instance B.Types.TypedObject BackendFlags where
    glibType :: IO GType
glibType = IO GType
c_secret_backend_flags_get_type

instance B.Types.BoxedEnum BackendFlags