Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GtkStringFilter determines whether to include items by looking
at strings and comparing them to a fixed search term. The strings
are obtained from the items by evaluating a Expression
.
GtkStringFilter has several different modes of comparison - it can match the whole string, just a prefix, or any substring.
Synopsis
- newtype StringFilter = StringFilter (ManagedPtr StringFilter)
- class (GObject o, IsDescendantOf StringFilter o) => IsStringFilter o
- toStringFilter :: (MonadIO m, IsStringFilter o) => o -> m StringFilter
- stringFilterGetExpression :: (HasCallStack, MonadIO m, IsStringFilter a) => a -> m Expression
- stringFilterGetIgnoreCase :: (HasCallStack, MonadIO m, IsStringFilter a) => a -> m Bool
- stringFilterGetMatchMode :: (HasCallStack, MonadIO m, IsStringFilter a) => a -> m StringFilterMatchMode
- stringFilterGetSearch :: (HasCallStack, MonadIO m, IsStringFilter a) => a -> m (Maybe Text)
- stringFilterNew :: (HasCallStack, MonadIO m, IsExpression a) => Maybe a -> m StringFilter
- stringFilterSetExpression :: (HasCallStack, MonadIO m, IsStringFilter a, IsExpression b) => a -> b -> m ()
- stringFilterSetIgnoreCase :: (HasCallStack, MonadIO m, IsStringFilter a) => a -> Bool -> m ()
- stringFilterSetMatchMode :: (HasCallStack, MonadIO m, IsStringFilter a) => a -> StringFilterMatchMode -> m ()
- stringFilterSetSearch :: (HasCallStack, MonadIO m, IsStringFilter a) => a -> Maybe Text -> m ()
- constructStringFilterExpression :: (IsStringFilter o, MonadIO m, IsExpression a) => a -> m (GValueConstruct o)
- getStringFilterExpression :: (MonadIO m, IsStringFilter o) => o -> m Expression
- setStringFilterExpression :: (MonadIO m, IsStringFilter o, IsExpression a) => o -> a -> m ()
- constructStringFilterIgnoreCase :: (IsStringFilter o, MonadIO m) => Bool -> m (GValueConstruct o)
- getStringFilterIgnoreCase :: (MonadIO m, IsStringFilter o) => o -> m Bool
- setStringFilterIgnoreCase :: (MonadIO m, IsStringFilter o) => o -> Bool -> m ()
- constructStringFilterMatchMode :: (IsStringFilter o, MonadIO m) => StringFilterMatchMode -> m (GValueConstruct o)
- getStringFilterMatchMode :: (MonadIO m, IsStringFilter o) => o -> m StringFilterMatchMode
- setStringFilterMatchMode :: (MonadIO m, IsStringFilter o) => o -> StringFilterMatchMode -> m ()
- clearStringFilterSearch :: (MonadIO m, IsStringFilter o) => o -> m ()
- constructStringFilterSearch :: (IsStringFilter o, MonadIO m) => Text -> m (GValueConstruct o)
- getStringFilterSearch :: (MonadIO m, IsStringFilter o) => o -> m (Maybe Text)
- setStringFilterSearch :: (MonadIO m, IsStringFilter o) => o -> Text -> m ()
Exported types
newtype StringFilter Source #
Memory-managed wrapper type.
StringFilter (ManagedPtr StringFilter) |
Instances
Eq StringFilter Source # | |
Defined in GI.Gtk.Objects.StringFilter (==) :: StringFilter -> StringFilter -> Bool # (/=) :: StringFilter -> StringFilter -> Bool # | |
GObject StringFilter Source # | |
Defined in GI.Gtk.Objects.StringFilter | |
ManagedPtrNewtype StringFilter Source # | |
Defined in GI.Gtk.Objects.StringFilter toManagedPtr :: StringFilter -> ManagedPtr StringFilter | |
TypedObject StringFilter Source # | |
Defined in GI.Gtk.Objects.StringFilter | |
HasParentTypes StringFilter Source # | |
Defined in GI.Gtk.Objects.StringFilter | |
IsGValue (Maybe StringFilter) Source # | Convert |
Defined in GI.Gtk.Objects.StringFilter gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe StringFilter -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe StringFilter) | |
type ParentTypes StringFilter Source # | |
Defined in GI.Gtk.Objects.StringFilter |
class (GObject o, IsDescendantOf StringFilter o) => IsStringFilter o Source #
Type class for types which can be safely cast to StringFilter
, for instance with toStringFilter
.
Instances
(GObject o, IsDescendantOf StringFilter o) => IsStringFilter o Source # | |
Defined in GI.Gtk.Objects.StringFilter |
toStringFilter :: (MonadIO m, IsStringFilter o) => o -> m StringFilter Source #
Cast to StringFilter
, 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, changed, forceFloating, freezeNotify, getv, isFloating, match, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getExpression, getIgnoreCase, getMatchMode, getProperty, getQdata, getSearch, getStrictness.
Setters
setData, setDataFull, setExpression, setIgnoreCase, setMatchMode, setProperty, setSearch.
getExpression
stringFilterGetExpression Source #
:: (HasCallStack, MonadIO m, IsStringFilter a) | |
=> a |
|
-> m Expression | Returns: a |
Gets the expression that the string filter uses to obtain strings from items.
getIgnoreCase
stringFilterGetIgnoreCase Source #
:: (HasCallStack, MonadIO m, IsStringFilter a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether the filter ignores case differences.
getMatchMode
stringFilterGetMatchMode Source #
:: (HasCallStack, MonadIO m, IsStringFilter a) | |
=> a |
|
-> m StringFilterMatchMode | Returns: the match mode of the filter |
Returns the match mode that the filter is using.
getSearch
stringFilterGetSearch Source #
:: (HasCallStack, MonadIO m, IsStringFilter a) | |
=> a |
|
-> m (Maybe Text) | Returns: The search string |
Gets the search string set via stringFilterSetSearch
.
new
:: (HasCallStack, MonadIO m, IsExpression a) | |
=> Maybe a |
|
-> m StringFilter | Returns: a new |
Creates a new string filter.
You will want to set up the filter by providing a string to search for and by providing a property to look up on the item.
setExpression
stringFilterSetExpression Source #
:: (HasCallStack, MonadIO m, IsStringFilter a, IsExpression b) | |
=> a |
|
-> b |
|
-> m () |
Sets the expression that the string filter uses to
obtain strings from items. The expression must have
a value type of G_TYPE_STRING
.
setIgnoreCase
stringFilterSetIgnoreCase Source #
:: (HasCallStack, MonadIO m, IsStringFilter a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether the filter ignores case differences.
setMatchMode
stringFilterSetMatchMode Source #
:: (HasCallStack, MonadIO m, IsStringFilter a) | |
=> a |
|
-> StringFilterMatchMode |
|
-> m () |
Sets the match mode for the filter.
setSearch
stringFilterSetSearch Source #
:: (HasCallStack, MonadIO m, IsStringFilter a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Sets the string to search for.
Properties
expression
The expression to evaluate on item to get a string to compare with
constructStringFilterExpression :: (IsStringFilter o, MonadIO m, IsExpression a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “expression
” property. This is rarely needed directly, but it is used by new
.
getStringFilterExpression :: (MonadIO m, IsStringFilter o) => o -> m Expression Source #
Get the value of the “expression
” property.
When overloading is enabled, this is equivalent to
get
stringFilter #expression
setStringFilterExpression :: (MonadIO m, IsStringFilter o, IsExpression a) => o -> a -> m () Source #
Set the value of the “expression
” property.
When overloading is enabled, this is equivalent to
set
stringFilter [ #expression:=
value ]
ignoreCase
If matching is case sensitive
constructStringFilterIgnoreCase :: (IsStringFilter o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “ignore-case
” property. This is rarely needed directly, but it is used by new
.
getStringFilterIgnoreCase :: (MonadIO m, IsStringFilter o) => o -> m Bool Source #
Get the value of the “ignore-case
” property.
When overloading is enabled, this is equivalent to
get
stringFilter #ignoreCase
setStringFilterIgnoreCase :: (MonadIO m, IsStringFilter o) => o -> Bool -> m () Source #
Set the value of the “ignore-case
” property.
When overloading is enabled, this is equivalent to
set
stringFilter [ #ignoreCase:=
value ]
matchMode
If exact matches are necessary or if substrings are allowed
constructStringFilterMatchMode :: (IsStringFilter o, MonadIO m) => StringFilterMatchMode -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “match-mode
” property. This is rarely needed directly, but it is used by new
.
getStringFilterMatchMode :: (MonadIO m, IsStringFilter o) => o -> m StringFilterMatchMode Source #
Get the value of the “match-mode
” property.
When overloading is enabled, this is equivalent to
get
stringFilter #matchMode
setStringFilterMatchMode :: (MonadIO m, IsStringFilter o) => o -> StringFilterMatchMode -> m () Source #
Set the value of the “match-mode
” property.
When overloading is enabled, this is equivalent to
set
stringFilter [ #matchMode:=
value ]
search
The search term
clearStringFilterSearch :: (MonadIO m, IsStringFilter o) => o -> m () Source #
Set the value of the “search
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#search
constructStringFilterSearch :: (IsStringFilter o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “search
” property. This is rarely needed directly, but it is used by new
.
getStringFilterSearch :: (MonadIO m, IsStringFilter o) => o -> m (Maybe Text) Source #
Get the value of the “search
” property.
When overloading is enabled, this is equivalent to
get
stringFilter #search
setStringFilterSearch :: (MonadIO m, IsStringFilter o) => o -> Text -> m () Source #
Set the value of the “search
” property.
When overloading is enabled, this is equivalent to
set
stringFilter [ #search:=
value ]