Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Describes a web engine feature that may be toggled at runtime.
The WebKit web engine includes a set of features which may be toggled
programmatically, each one represented by a Feature
that provides
information about it:
- A unique “identifier”: [method
feature
.get_identifier]. - A “default value”, which indicates whether the option is enabled
automatically: [method
feature
.get_default_value]. - Its “status”, which determines whether it should be considered
user-settable and its development stage (see [enum
featureStatus
] for details): [methodfeature
.get_status]. - A category, which may be used to group features together:
[method
feature
.get_category]. - An optional short “name” which can be presented to an user:
[method
feature
.get_name]. - An optional longer “detailed” description:
[method
feature
.get_details].
The lists of available features can be obtained with
Settings.get_all_features
, Settings.get_experimental_features
,
and Settings.get_development_features
). As a rule of thumb,
applications which may want to allow users (i.e. web developers) to test
WebKit features should use the list of experimental features. Additionally,
applications might want to expose development features *when targeting
technically inclined users* for early testing of in-development features
(i.e. in “technology preview” or “canary” builds).
Applications **must not** expose the list of all features to end users because they often lack descriptions and control parts of the web engine which are either intended to be used during development of WebKit itself, or in specific scenarios to tweak how WebKit integrates with the application.
Since: 2.42
Synopsis
- newtype Feature = Feature (ManagedPtr Feature)
- featureGetCategory :: (HasCallStack, MonadIO m) => Feature -> m Text
- featureGetDefaultValue :: (HasCallStack, MonadIO m) => Feature -> m Bool
- featureGetDetails :: (HasCallStack, MonadIO m) => Feature -> m (Maybe Text)
- featureGetIdentifier :: (HasCallStack, MonadIO m) => Feature -> m Text
- featureGetName :: (HasCallStack, MonadIO m) => Feature -> m (Maybe Text)
- featureGetStatus :: (HasCallStack, MonadIO m) => Feature -> m FeatureStatus
- featureRef :: (HasCallStack, MonadIO m) => Feature -> m Feature
- featureUnref :: (HasCallStack, MonadIO m) => Feature -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Feature Source # | |
GBoxed Feature Source # | |
Defined in GI.WebKit.Structs.Feature | |
ManagedPtrNewtype Feature Source # | |
Defined in GI.WebKit.Structs.Feature toManagedPtr :: Feature -> ManagedPtr Feature | |
TypedObject Feature Source # | |
Defined in GI.WebKit.Structs.Feature | |
HasParentTypes Feature Source # | |
Defined in GI.WebKit.Structs.Feature | |
IsGValue (Maybe Feature) Source # | Convert |
Defined in GI.WebKit.Structs.Feature gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Feature -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Feature) | |
type ParentTypes Feature Source # | |
Defined in GI.WebKit.Structs.Feature |
Methods
Click to display all available methods, including inherited ones
Methods
Getters
getCategory, getDefaultValue, getDetails, getIdentifier, getName, getStatus.
Setters
None.
getCategory
:: (HasCallStack, MonadIO m) | |
=> Feature |
|
-> m Text | Returns: Feature category. |
Gets the category of the feature.
Applications which include user interface to toggle features may want to use the category to group related features together.
Since: 2.42
getDefaultValue
featureGetDefaultValue Source #
:: (HasCallStack, MonadIO m) | |
=> Feature |
|
-> m Bool | Returns: Whether the feature is enabled by default. |
Gets whether the feature is enabled by default.
The default value may be used by applications which include user interface
to toggle features to restore its settings to their defaults. Note that
whether a feature is actually enabled must be checked with
[methodsettings
.get_feature_enabled].
Since: 2.42
getDetails
:: (HasCallStack, MonadIO m) | |
=> Feature |
|
-> m (Maybe Text) | Returns: Feature description. |
Gets a description for the feature
.
The detailed description should be considered an additional clarification
on the purpose of the feature, to be used as complementary aid to be
displayed along the feature name returned by [methodfeature
.get_name].
The returned string is suitable to be displayed to end users, but it
should not be relied upon being localized.
Note that some *features may not* have a detailed description, and nULL
is returned in this case.
Since: 2.42
getIdentifier
:: (HasCallStack, MonadIO m) | |
=> Feature |
|
-> m Text | Returns: The identifier string for the feature. |
Gets a string that uniquely identifies the feature
.
Since: 2.42
getName
:: (HasCallStack, MonadIO m) | |
=> Feature |
|
-> m (Maybe Text) | Returns: Short feature name. |
Gets a short name for the feature
.
The returned string is suitable to be displayed to end users, but it should not be relied upon being localized.
Note that some *features may not* have a short name, and nULL
is returned in this case.
Since: 2.42
getStatus
:: (HasCallStack, MonadIO m) | |
=> Feature |
|
-> m FeatureStatus | Returns: Feature status. |
Gets the status of the feature.
Since: 2.42
ref
:: (HasCallStack, MonadIO m) | |
=> Feature |
|
-> m Feature | Returns: The same |
Atomically acquires a reference on the given feature
.
This function is MT-safe and may be called from any thread.
Since: 2.42
unref
:: (HasCallStack, MonadIO m) | |
=> Feature |
|
-> m () |
Atomically releases a reference on the given feature
.
If the reference was the last, the resources associated to the
feature
are freed. This function is MT-safe and may be called from
any thread.
Since: 2.42