gi-gio-2.0.19: Gio bindings

Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com)
Safe Haskell | None
Language | Haskell2010

GI.Gio.Objects.SimplePermission

Contents

- Exported types
- Methods
  - new

Description

`SimplePermission` is a trivial implementation of `Permission` that represents a permission that is either always or never allowed. The value is given at construction and doesn't change.

Calling request or release will result in errors.

Synopsis

- newtype SimplePermission = SimplePermission (ManagedPtr SimplePermission)
- class GObject o => IsSimplePermission o
- toSimplePermission :: (MonadIO m, IsSimplePermission o) => o -> m SimplePermission
- noSimplePermission :: Maybe SimplePermission
- simplePermissionNew :: (HasCallStack, MonadIO m) => Bool -> m SimplePermission

# Exported types

newtype SimplePermission Source #

Memory-managed wrapper type.

Constructors

SimplePermission (ManagedPtr SimplePermission) |

Instances

GObject SimplePermission Source # |
Instance details Defined in GI.Gio.Objects.SimplePermission Methods gobjectType :: SimplePermission -> IO GType Source #
IsObject SimplePermission Source # |
Instance details Defined in GI.Gio.Objects.SimplePermission
IsPermission SimplePermission Source # |
Instance details Defined in GI.Gio.Objects.SimplePermission
IsSimplePermission SimplePermission Source # |
Instance details Defined in GI.Gio.Objects.SimplePermission

class GObject o => IsSimplePermission o Source #

Type class for types which can be safely cast to `SimplePermission`, for instance with `toSimplePermission`.

Instances

(GObject a, (UnknownAncestorError SimplePermission a :: Constraint)) => IsSimplePermission a Source # |
Instance details Defined in GI.Gio.Objects.SimplePermission
IsSimplePermission SimplePermission Source # |
Instance details Defined in GI.Gio.Objects.SimplePermission

toSimplePermission :: (MonadIO m, IsSimplePermission o) => o -> m SimplePermission Source #

Cast to `SimplePermission`, for types for which this is known to be safe. For general casts, use `castTo`.

noSimplePermission :: Maybe SimplePermission Source #

A convenience alias for `Nothing` :: `Maybe` `SimplePermission`.

# Methods

## new

simplePermissionNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Bool | `allowed`: `True` if the action is allowed
-> m SimplePermission | Returns: the `SimplePermission`, as a `Permission`

Creates a new `Permission` instance that represents an action that is either always or never allowed.

Since: 2.26