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 |
Handles storage of user content filters on disk.
The WebKitUserContentFilterStore provides the means to import and save
JSON rule sets,
which can be loaded later in an efficient manner. Once filters are stored,
the UserContentFilter
objects which represent them can be added to
a UserContentManager
with userContentManagerAddFilter
.
JSON rule sets are imported using userContentFilterStoreSave
and stored
on disk in an implementation defined format. The contents of a filter store must be
managed using the UserContentFilterStore
: a list of all the stored filters
can be obtained with userContentFilterStoreFetchIdentifiers
,
userContentFilterStoreLoad
can be used to retrieve a previously saved
filter, and removed from the store with userContentFilterStoreRemove
.
Since: 2.24
Synopsis
- newtype UserContentFilterStore = UserContentFilterStore (ManagedPtr UserContentFilterStore)
- class (GObject o, IsDescendantOf UserContentFilterStore o) => IsUserContentFilterStore o
- toUserContentFilterStore :: (MonadIO m, IsUserContentFilterStore o) => o -> m UserContentFilterStore
- userContentFilterStoreFetchIdentifiers :: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsCancellable b) => a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- userContentFilterStoreFetchIdentifiersFinish :: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsAsyncResult b) => a -> b -> m [Text]
- userContentFilterStoreGetPath :: (HasCallStack, MonadIO m, IsUserContentFilterStore a) => a -> m Text
- userContentFilterStoreLoad :: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsCancellable b) => a -> Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- userContentFilterStoreLoadFinish :: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsAsyncResult b) => a -> b -> m UserContentFilter
- userContentFilterStoreNew :: (HasCallStack, MonadIO m) => Text -> m UserContentFilterStore
- userContentFilterStoreRemove :: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsCancellable b) => a -> Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- userContentFilterStoreRemoveFinish :: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsAsyncResult b) => a -> b -> m ()
- userContentFilterStoreSave :: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsCancellable b) => a -> Text -> Bytes -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- userContentFilterStoreSaveFinish :: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsAsyncResult b) => a -> b -> m UserContentFilter
- userContentFilterStoreSaveFromFile :: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsFile b, IsCancellable c) => a -> Text -> b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- userContentFilterStoreSaveFromFileFinish :: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsAsyncResult b) => a -> b -> m UserContentFilter
- constructUserContentFilterStorePath :: (IsUserContentFilterStore o, MonadIO m) => Text -> m (GValueConstruct o)
- getUserContentFilterStorePath :: (MonadIO m, IsUserContentFilterStore o) => o -> m Text
Exported types
newtype UserContentFilterStore Source #
Memory-managed wrapper type.
UserContentFilterStore (ManagedPtr UserContentFilterStore) |
Instances
class (GObject o, IsDescendantOf UserContentFilterStore o) => IsUserContentFilterStore o Source #
Type class for types which can be safely cast to UserContentFilterStore
, for instance with toUserContentFilterStore
.
Instances
(GObject o, IsDescendantOf UserContentFilterStore o) => IsUserContentFilterStore o Source # | |
Defined in GI.WebKit2.Objects.UserContentFilterStore |
toUserContentFilterStore :: (MonadIO m, IsUserContentFilterStore o) => o -> m UserContentFilterStore Source #
Cast to UserContentFilterStore
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, fetchIdentifiers, fetchIdentifiersFinish, forceFloating, freezeNotify, getv, isFloating, load, loadFinish, notify, notifyByPspec, ref, refSink, remove, removeFinish, runDispose, save, saveFinish, saveFromFile, saveFromFileFinish, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getPath, getProperty, getQdata.
Setters
fetchIdentifiers
userContentFilterStoreFetchIdentifiers Source #
:: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously retrieve a list of the identifiers for all the stored filters.
When the operation is finished, callback
will be invoked, which then can use
userContentFilterStoreFetchIdentifiersFinish
to obtain the list of
filter identifiers.
Since: 2.24
fetchIdentifiersFinish
userContentFilterStoreFetchIdentifiersFinish Source #
:: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m [Text] | Returns: a |
Finishes an asynchronous fetch of the list of stored filters.
Finishes an asynchronous fetch of the list of identifiers for the stored filters previously
started with userContentFilterStoreFetchIdentifiers
.
Since: 2.24
getPath
userContentFilterStoreGetPath Source #
:: (HasCallStack, MonadIO m, IsUserContentFilterStore a) | |
=> a |
|
-> m Text | Returns: path, as a string. |
Gets the storage path for user content filters.
Since: 2.24
load
userContentFilterStoreLoad Source #
:: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously load a content filter given its identifier
.
The filter must have been
previously stored using userContentFilterStoreSave
.
When the operation is finished, callback
will be invoked, which then can use
userContentFilterStoreLoadFinish
to obtain the resulting filter.
Since: 2.24
loadFinish
userContentFilterStoreLoadFinish Source #
:: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m UserContentFilter | Returns: a |
Finishes an asynchronous filter load previously started with
userContentFilterStoreLoad
.
Since: 2.24
new
userContentFilterStoreNew Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m UserContentFilterStore | Returns: a newly created |
Create a new UserContentFilterStore
to manipulate filters stored at storagePath
.
The path must point to a local filesystem, and will be created if needed.
Since: 2.24
remove
userContentFilterStoreRemove Source #
:: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously remove a content filter given its identifier
.
When the operation is finished, callback
will be invoked, which then can use
userContentFilterStoreRemoveFinish
to check whether the removal was
successful.
Since: 2.24
removeFinish
userContentFilterStoreRemoveFinish Source #
:: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Finishes an asynchronous filter removal previously started with
userContentFilterStoreRemove
.
Since: 2.24
save
userContentFilterStoreSave Source #
:: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Bytes |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously save a content filter from a set source rule.
Asynchronously save a content filter from a source rule set in the WebKit content extesions JSON format.
The identifier
can be used afterwards to refer to the filter when using
userContentFilterStoreRemove
and userContentFilterStoreLoad
.
When the identifier
has been used in the past, the new filter source will replace
the one saved beforehand for the same identifier.
When the operation is finished, callback
will be invoked, which then can use
userContentFilterStoreSaveFinish
to obtain the resulting filter.
Since: 2.24
saveFinish
userContentFilterStoreSaveFinish Source #
:: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m UserContentFilter | Returns: a |
Finishes an asynchronous filter save previously started with
userContentFilterStoreSave
.
Since: 2.24
saveFromFile
userContentFilterStoreSaveFromFile Source #
:: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsFile b, IsCancellable c) | |
=> a |
|
-> Text |
|
-> b |
|
-> Maybe c |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously save a content filter from the contents of a file.
Asynchronously save a content filter from the contents of a file, which must be
native to the platform, as checked by fileIsNative
. See
userContentFilterStoreSave
for more details.
When the operation is finished, callback
will be invoked, which then can use
userContentFilterStoreSaveFinish
to obtain the resulting filter.
Since: 2.24
saveFromFileFinish
userContentFilterStoreSaveFromFileFinish Source #
:: (HasCallStack, MonadIO m, IsUserContentFilterStore a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m UserContentFilter | Returns: a |
Finishes and asynchronous filter save previously started with
userContentFilterStoreSaveFromFile
.
Since: 2.24
Properties
path
The directory used for filter storage. This path is used as the base directory where user content filters are stored on disk.
Since: 2.24
constructUserContentFilterStorePath :: (IsUserContentFilterStore o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “path
” property. This is rarely needed directly, but it is used by new
.
getUserContentFilterStorePath :: (MonadIO m, IsUserContentFilterStore o) => o -> m Text Source #
Get the value of the “path
” property.
When overloading is enabled, this is equivalent to
get
userContentFilterStore #path