gi-dbusmenu-0.4.14: Dbusmenu bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Dbusmenu.Objects.Menuitem

Contents

- Exported types
- Methods
  - childAddPosition
  - childAppend
  - childDelete
  - childFind
  - childPrepend
  - childReorder
  - findId
  - foreach
  - getChildren
  - getId
  - getParent
  - getPosition
  - getPositionRealized
  - getRoot
  - handleEvent
  - new
  - newWithId
  - propertiesCopy
  - propertiesList
  - propertyExist
  - propertyGet
  - propertyGetBool
  - propertyGetByteArray
  - propertyGetInt
  - propertyGetVariant
  - propertyRemove
  - propertySet
  - propertySetBool
  - propertySetByteArray
  - propertySetInt
  - propertySetVariant
  - sendAboutToShow
  - setParent
  - setRoot
  - showToUser
  - takeChildren
  - unparent
- Properties
  - id
- Signals
  - aboutToShow
  - childAdded
  - childMoved
  - childRemoved
  - event
  - itemActivated
  - propertyChanged
  - realized
  - showToUser

Description

This is the `Object` based object that represents a menu item. It gets created the same on both the client and the server side and libdbusmenu-glib does the work of making this object model appear on both sides of DBus. Simple really, though through updates and people coming on and off the bus it can lead to lots of fun complex scenarios.

Synopsis

- newtype Menuitem = Menuitem (ManagedPtr Menuitem)
- class (GObject o, IsDescendantOf Menuitem o) => IsMenuitem o
- toMenuitem :: (MonadIO m, IsMenuitem o) => o -> m Menuitem
- menuitemChildAddPosition :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) => a -> b -> Word32 -> m Bool
- menuitemChildAppend :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) => a -> b -> m Bool
- menuitemChildDelete :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) => a -> b -> m Bool
- menuitemChildFind :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Int32 -> m (Maybe Menuitem)
- menuitemChildPrepend :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) => a -> b -> m Bool
- menuitemChildReorder :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) => a -> b -> Word32 -> m Bool
- menuitemFindId :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Int32 -> m (Maybe Menuitem)
- menuitemForeach :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Ptr () -> Ptr () -> m ()
- menuitemGetChildren :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> m [Menuitem]
- menuitemGetId :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> m Int32
- menuitemGetParent :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> m Menuitem
- menuitemGetPosition :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) => a -> b -> m Word32
- menuitemGetPositionRealized :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) => a -> b -> m Word32
- menuitemGetRoot :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> m Bool
- menuitemHandleEvent :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> GVariant -> Word32 -> m ()
- menuitemNew :: (HasCallStack, MonadIO m) => m Menuitem
- menuitemNewWithId :: (HasCallStack, MonadIO m) => Int32 -> m Menuitem
- menuitemPropertiesCopy :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> m (Map (Ptr ()) (Ptr ()))
- menuitemPropertiesList :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> m [Text]
- menuitemPropertyExist :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> m Bool
- menuitemPropertyGet :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> m (Maybe Text)
- menuitemPropertyGetBool :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> m Bool
- menuitemPropertyGetByteArray :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> m (Maybe ByteString)
- menuitemPropertyGetInt :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> m Int32
- menuitemPropertyGetVariant :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> m (Maybe GVariant)
- menuitemPropertyRemove :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> m ()
- menuitemPropertySet :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> Text -> m Bool
- menuitemPropertySetBool :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> Bool -> m Bool
- menuitemPropertySetByteArray :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> Word8 -> CSize -> m Bool
- menuitemPropertySetInt :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> Int32 -> m Bool
- menuitemPropertySetVariant :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Text -> GVariant -> m Bool
- menuitemSendAboutToShow :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Ptr () -> Ptr () -> m ()
- menuitemSetParent :: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) => a -> b -> m Bool
- menuitemSetRoot :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Bool -> m ()
- menuitemShowToUser :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> Word32 -> m ()
- menuitemTakeChildren :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> m [Menuitem]
- menuitemUnparent :: (HasCallStack, MonadIO m, IsMenuitem a) => a -> m Bool
- constructMenuitemId :: (IsMenuitem o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getMenuitemId :: (MonadIO m, IsMenuitem o) => o -> m Int32
- type MenuitemAboutToShowCallback = IO Bool
- afterMenuitemAboutToShow :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemAboutToShowCallback) -> m SignalHandlerId
- onMenuitemAboutToShow :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemAboutToShowCallback) -> m SignalHandlerId
- type MenuitemChildAddedCallback = Object -> Word32 -> IO ()
- afterMenuitemChildAdded :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemChildAddedCallback) -> m SignalHandlerId
- onMenuitemChildAdded :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemChildAddedCallback) -> m SignalHandlerId
- type MenuitemChildMovedCallback = Object -> Word32 -> Word32 -> IO ()
- afterMenuitemChildMoved :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemChildMovedCallback) -> m SignalHandlerId
- onMenuitemChildMoved :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemChildMovedCallback) -> m SignalHandlerId
- type MenuitemChildRemovedCallback = Object -> IO ()
- afterMenuitemChildRemoved :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemChildRemovedCallback) -> m SignalHandlerId
- onMenuitemChildRemoved :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemChildRemovedCallback) -> m SignalHandlerId
- type MenuitemEventCallback = Text -> GVariant -> Word32 -> IO Bool
- afterMenuitemEvent :: (IsMenuitem a, MonadIO m) => a -> Maybe Text -> ((?self :: a) => MenuitemEventCallback) -> m SignalHandlerId
- onMenuitemEvent :: (IsMenuitem a, MonadIO m) => a -> Maybe Text -> ((?self :: a) => MenuitemEventCallback) -> m SignalHandlerId
- type MenuitemItemActivatedCallback = Word32 -> IO ()
- afterMenuitemItemActivated :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemItemActivatedCallback) -> m SignalHandlerId
- onMenuitemItemActivated :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemItemActivatedCallback) -> m SignalHandlerId
- type MenuitemPropertyChangedCallback = Text -> GVariant -> IO ()
- afterMenuitemPropertyChanged :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemPropertyChangedCallback) -> m SignalHandlerId
- onMenuitemPropertyChanged :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemPropertyChangedCallback) -> m SignalHandlerId
- type MenuitemRealizedCallback = IO ()
- afterMenuitemRealized :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemRealizedCallback) -> m SignalHandlerId
- onMenuitemRealized :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemRealizedCallback) -> m SignalHandlerId
- type MenuitemShowToUserCallback = Word32 -> IO ()
- afterMenuitemShowToUser :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemShowToUserCallback) -> m SignalHandlerId
- onMenuitemShowToUser :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemShowToUserCallback) -> m SignalHandlerId

# Exported types

newtype Menuitem Source #

Memory-managed wrapper type.

Constructors

Menuitem (ManagedPtr Menuitem) |

#### Instances

Instances details

Eq Menuitem Source # |
Instance details Defined in GI.Dbusmenu.Objects.Menuitem Methods (==) :: Menuitem -> Menuitem -> Bool Source # (/=) :: Menuitem -> Menuitem -> Bool Source #
GObject Menuitem Source # |
Instance details Defined in GI.Dbusmenu.Objects.Menuitem
ManagedPtrNewtype Menuitem Source # |
Instance details Defined in GI.Dbusmenu.Objects.Menuitem Methods toManagedPtr :: Menuitem -> ManagedPtr Menuitem Source #
TypedObject Menuitem Source # |
Instance details Defined in GI.Dbusmenu.Objects.Menuitem Methods glibType :: IO GType Source #
HasParentTypes Menuitem Source # |
Instance details Defined in GI.Dbusmenu.Objects.Menuitem
IsGValue (Maybe Menuitem) Source # | Convert `Menuitem` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Dbusmenu.Objects.Menuitem Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe Menuitem -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe Menuitem) Source #
type ParentTypes Menuitem Source # |
Instance details Defined in GI.Dbusmenu.Objects.Menuitem type ParentTypes Menuitem = '[Object]

class (GObject o, IsDescendantOf Menuitem o) => IsMenuitem o Source #

Type class for types which can be safely cast to `Menuitem`, for instance with `toMenuitem`.

#### Instances

Instances details

(GObject o, IsDescendantOf Menuitem o) => IsMenuitem o Source # |
Instance details Defined in GI.Dbusmenu.Objects.Menuitem

toMenuitem :: (MonadIO m, IsMenuitem o) => o -> m Menuitem Source #

Cast to `Menuitem`, 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

Expand

#### Methods

bindProperty, bindPropertyFull, childAddPosition, childAppend, childDelete, childFind, childPrepend, childReorder, findId, forceFloating, foreach, freezeNotify, getv, handleEvent, isFloating, notify, notifyByPspec, propertiesCopy, propertiesList, propertyExist, propertyGet, propertyGetBool, propertyGetByteArray, propertyGetInt, propertyGetVariant, propertyRemove, propertySet, propertySetBool, propertySetByteArray, propertySetInt, propertySetVariant, ref, refSink, runDispose, sendAboutToShow, showToUser, stealData, stealQdata, takeChildren, thawNotify, unparent, unref, watchClosure.

#### Getters

getChildren, getData, getId, getParent, getPosition, getPositionRealized, getProperty, getQdata, getRoot.

#### Setters

setData, setDataFull, setParent, setProperty, setRoot.

## childAddPosition

menuitemChildAddPosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) |
=> a | `mi`: The `Menuitem` that we're adding the child `child` to.
-> b | `child`: The `Menuitem` to make a child of `mi`.
-> Word32 | `position`: Where in `mi` object's list of chidren `child` should be placed.
-> m Bool | Returns: Whether `child` was added successfully.

Puts `child` in the list of children for `mi` at the location specified in `position`. If there is not enough entires available then `child` will be placed at the end of the list.

## childAppend

menuitemChildAppend Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) |
=> a | `mi`: The `Menuitem` which will become a new parent
-> b | `child`: The `DbusmenMenuitem` that will be a child
-> m Bool | Returns: Whether the child has been added successfully.

This function adds `child` to the list of children on `mi` at the end of that list.

## childDelete

menuitemChildDelete Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) |
=> a | `mi`: The `Menuitem` which has `child` as a child
-> b | `child`: The child `Menuitem` that you want to no longer be a child of `mi`.
-> m Bool | Returns: If we were able to delete `child`.

This function removes `child` from the children list of `mi`. It does not call `g_object_unref` on `child`.

## childFind

menuitemChildFind Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` who's children to look on
-> Int32 | `id`: The ID of the child that we're looking for.
-> m (Maybe Menuitem) | Returns: The menu item with the ID `id` or `NULL` if it can't be found.

Search the children of `mi` to find one with the ID of `id`. If it doesn't exist then we return `NULL`.

## childPrepend

menuitemChildPrepend Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) |
=> a | `mi`: The `Menuitem` which will become a new parent
-> b | `child`: The `DbusmenMenuitem` that will be a child
-> m Bool | Returns: Whether the child has been added successfully.

This function adds `child` to the list of children on `mi` at the beginning of that list.

## childReorder

menuitemChildReorder Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) |
=> a | `mi`: The `Menuitem` that has children needing realignment
-> b | `child`: The `Menuitem` that is a child needing to be moved
-> Word32 | `position`: The position in the list to place it in
-> m Bool | Returns: Whether the move was successful.

This function moves a child on the list of children. It is for a child that is already in the list, but simply needs a new location.

## findId

menuitemFindId Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: `Menuitem` at the top of the tree to search
-> Int32 | `id`: ID of the `Menuitem` to search for
-> m (Maybe Menuitem) | Returns: The `Menuitem` with the ID of `id` or `NULL` if there isn't such a menu item in the tree represented by `mi`.

This function searchs the whole tree of children that are attached to `mi`. This could be quite a few nodes, all the way down the tree. It is a depth first search.

## foreach

menuitemForeach Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `DbusmenItem` to start from
-> Ptr () | `func`: Function to call on every node in the tree
-> Ptr () | `data`: User data to pass to the function
-> m () |

This calls the function `func` on this menu item and all of the children of this item. And their children. And their children. And... you get the point. It will get called on the whole tree.

## getChildren

menuitemGetChildren Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` to query.
-> m [Menuitem] | Returns: A `List` of pointers to `Menuitem` objects.

Returns simply the list of children that this menu item has. The list is valid until another child related function is called, where it might be changed.

## getId

menuitemGetId Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` to query.
-> m Int32 | Returns: The ID of the `mi`.

Gets the unique ID for `mi`.

## getParent

menuitemGetParent Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` for which to inspect the parent
-> m Menuitem | Returns: The parent of this menu item

This function looks up the parent of `mi`

## getPosition

menuitemGetPosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) |
=> a | `mi`: The `Menuitem` to find the position of
-> b | `parent`: The `Menuitem` who's children contain `mi`
-> m Word32 | Returns: The position of `mi` in the children of `parent`.

This function returns the position of the menu item `mi` in the children of `parent`. It will return zero if the menu item can't be found.

## getPositionRealized

menuitemGetPositionRealized Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) |
=> a | `mi`: The `Menuitem` to find the position of
-> b | `parent`: The `Menuitem` who's children contain `mi`
-> m Word32 | Returns: The position of `mi` in the realized children of `parent`.

This function is very similar to `dbusmenu_menuitem_get_position` except that it only counts in the children that have been realized.

## getRoot

menuitemGetRoot Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: `Menuitem` to see whether it's root
-> m Bool | Returns: `TRUE` if this is a root node

This function returns the internal value of whether this is a root node or not.

## handleEvent

menuitemHandleEvent Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` to send the signal on.
-> Text | `name`: The name of the signal
-> GVariant | `variant`: A value that could be set for the event
-> Word32 | `timestamp`: The timestamp of when the event happened
-> m () |

This function is called to create an event. It is likely to be overrided by subclasses. The default menu item will respond to the activate signal and do:

Emits the `Menuitem`::`item-activate` signal on this menu item. Called by server objects when they get the appropriate DBus signals from the client.

If you subclass this function you should really think about calling the parent function unless you have a good reason not to.

## new

menuitemNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Menuitem | Returns: A newly allocated `Menuitem`.

Create a new `Menuitem` with all default values.

## newWithId

menuitemNewWithId Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Int32 | `id`: ID to use for this menuitem
-> m Menuitem | Returns: A newly allocated `Menuitem`.

This creates a blank `Menuitem` with a specific ID.

## propertiesCopy

menuitemPropertiesCopy Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: `Menuitem` that we're interested in the properties of
-> m (Map (Ptr ()) (Ptr ())) | Returns: A brand new `HashTable` that contains all of theroperties that are on this `Menuitem` `mi`.

This function takes the properties of a `Menuitem` and puts them into a `HashTable` that is referenced by the key of a string and has the value of a string. The hash table may not have any entries if there aren't any or there is an error in processing. It is the caller's responsibility to destroy the created `HashTable`.

## propertiesList

menuitemPropertiesList Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: `Menuitem` to list the properties on
-> m [Text] | Returns: A list of strings or NULL if there are none.

This functiong gets a list of the names of all the properties that are set on this menu item. This data on the list is owned by the menuitem but the list is not and should be freed using `g_list_free()` when the calling function is done with it.

## propertyExist

menuitemPropertyExist Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` to look for the property on.
-> Text | `property`: The property to look for.
-> m Bool | Returns: A boolean checking to see if the property is available

Checkes to see if a particular property exists on `mi` and returns `TRUE` if so.

## propertyGet

menuitemPropertyGet Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` to look for the property on.
-> Text | `property`: The property to grab.
-> m (Maybe Text) | Returns: A string with the value of the property that shouldn't be free'd. Or `NULL` if the property is not set or is not a string.

Look up a property on `mi` and return the value of it if it exits. `NULL` will be returned if the property doesn't exist.

## propertyGetBool

menuitemPropertyGetBool Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` to look for the property on.
-> Text | `property`: The property to grab.
-> m Bool | Returns: The value of the property or `FALSE`.

Look up a property on `mi` and return the value of it if it exits. Returns `FALSE` if the property doesn't exist.

## propertyGetByteArray

menuitemPropertyGetByteArray Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` to look for the property on.
-> Text | `property`: The property to grab.
-> m (Maybe ByteString) | Returns: A byte array with the value of the property that shouldn't be free'd. Or `NULL` if the property is not set or is not a byte array.

Look up a property on `mi` and return the value of it if it exits. `NULL` will be returned if the property doesn't exist.

## propertyGetInt

menuitemPropertyGetInt Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` to look for the property on.
-> Text | `property`: The property to grab.
-> m Int32 | Returns: The value of the property or zero.

Look up a property on `mi` and return the value of it if it exits. Returns zero if the property doesn't exist.

## propertyGetVariant

menuitemPropertyGetVariant Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` to look for the property on.
-> Text | `property`: The property to grab.
-> m (Maybe GVariant) | Returns: A GVariant for the property.

Look up a property on `mi` and return the value of it if it exits. `NULL` will be returned if the property doesn't exist.

## propertyRemove

menuitemPropertyRemove Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` to remove the property on.
-> Text | `property`: The property to look for.
-> m () |

Removes a property from the menuitem.

## propertySet

menuitemPropertySet Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` to set the property on.
-> Text | `property`: Name of the property to set.
-> Text | `value`: The value of the property.
-> m Bool | Returns: A boolean representing if the property value was set.

Takes the pair of `property` and `value` and places them as a property on `mi`. If a property already exists by that name, then the value is set to the new value. If not, the property is added. If the value is changed or the property was previously unset then the signal `Menuitem`::`prop-changed` will be emitted by this function.

## propertySetBool

menuitemPropertySetBool Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` to set the property on.
-> Text | `property`: Name of the property to set.
-> Bool | `value`: The value of the property.
-> m Bool | Returns: A boolean representing if the property value was set.

Takes a boolean `value` and sets it on `property` as a property on `mi`. If a property already exists by that name, then the value is set to the new value. If not, the property is added. If the value is changed or the property was previously unset then the signal `Menuitem`::`prop-changed` will be emitted by this function.

## propertySetByteArray

menuitemPropertySetByteArray Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` to set the property on.
-> Text | `property`: Name of the property to set.
-> Word8 | `value`: The byte array.
-> CSize | `nelements`: The number of elements in the byte array.
-> m Bool | Returns: A boolean representing if the property value was set.

Takes a byte array `value` and sets it on `property` as a property on `mi`. If a property already exists by that name, then the value is set to the new value. If not, the property is added. If the value is changed or the property was previously unset then the signal `Menuitem`::`prop-changed` will be emitted by this function.

## propertySetInt

menuitemPropertySetInt Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` to set the property on.
-> Text | `property`: Name of the property to set.
-> Int32 | `value`: The value of the property.
-> m Bool | Returns: A boolean representing if the property value was set.

Takes a boolean `value` and sets it on `property` as a property on `mi`. If a property already exists by that name, then the value is set to the new value. If not, the property is added. If the value is changed or the property was previously unset then the signal `Menuitem`::`prop-changed` will be emitted by this function.

## propertySetVariant

menuitemPropertySetVariant Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` to set the property on.
-> Text | `property`: Name of the property to set.
-> GVariant | `value`: The value of the property.
-> m Bool | Returns: A boolean representing if the property value was set.

Takes the pair of `property` and `value` and places them as a property on `mi`. If a property already exists by that name, then the value is set to the new value. If not, the property is added. If the value is changed or the property was previously unset then the signal `Menuitem`::`prop-changed` will be emitted by this function.

## sendAboutToShow

menuitemSendAboutToShow Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` to send the signal on.
-> Ptr () | `cb`: Callback to call when the call has returned.
-> Ptr () | `cbData`: Data to pass to the callback.
-> m () |

This function is used to send the even that the submenu of this item is about to be shown. Callers to this event should delay showing the menu until their callback is called if possible.

## setParent

menuitemSetParent Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a, IsMenuitem b) |
=> a | `mi`: The `Menuitem` for which to set the parent
-> b | `parent`: The new parent `Menuitem`
-> m Bool | Returns: Whether the parent was set successfully

Sets the parent of `mi` to `parent`. If `mi` already has a parent, then this call will fail. The parent will be set automatically when using the usual methods to add a child menuitem, so this function should not normally be called directly

## setRoot

menuitemSetRoot Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: `Menuitem` to set whether it's root
-> Bool | `root`: Whether `mi` is a root node or not
-> m () |

This function sets the internal value of whether this is a root node or not.

## showToUser

menuitemShowToUser Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: `Menuitem` to show
-> Word32 | `timestamp`: The time that the user requested it to be shown
-> m () |

Signals that this menu item should be shown to the user. If this is server side the server will then take it and send it over the bus.

## takeChildren

menuitemTakeChildren Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `DbusmenMenuitem` to take the children from.
-> m [Menuitem] | Returns: A `List` of pointers to `Menuitem` objects.

While the name sounds devious that's exactly what this function does. It takes the list of children from the `mi` and clears the internal list. The calling function is now in charge of the ref's on the children it has taken. A lot of responsibility involved in taking children.

## unparent

menuitemUnparent Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuitem a) |
=> a | `mi`: The `Menuitem` to unparent
-> m Bool | Returns: Whether the menu item was unparented successfully

Unparents the menu item `mi`. If `mi` doesn't have a parent, then this call will fail. The menuitem will be unparented automatically when using the usual methods to delete a child menuitem, so this function should not normally be called directly

# Properties

## id

No description available in the introspection data.

constructMenuitemId :: (IsMenuitem o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`id`” property. This is rarely needed directly, but it is used by `new`.

getMenuitemId :: (MonadIO m, IsMenuitem o) => o -> m Int32 Source #

Get the value of the “`id`” property. When overloading is enabled, this is equivalent to

    get menuitem #id

# Signals

## aboutToShow

type MenuitemAboutToShowCallback = IO Bool Source #

Emitted when the submenu for this item is about to be shown

afterMenuitemAboutToShow :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemAboutToShowCallback) -> m SignalHandlerId Source #

Connect a signal handler for the aboutToShow signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after menuitem #aboutToShow callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onMenuitemAboutToShow :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemAboutToShowCallback) -> m SignalHandlerId Source #

Connect a signal handler for the aboutToShow signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on menuitem #aboutToShow callback

## childAdded

type MenuitemChildAddedCallback Source #

Arguments

= Object | `arg1`: The `Menuitem` which is the child.
-> Word32 | `arg2`: The position that the child is being added in.
-> IO () |

Signaled when the child menuitem has been added to the parent.

afterMenuitemChildAdded :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemChildAddedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the childAdded signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after menuitem #childAdded callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onMenuitemChildAdded :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemChildAddedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the childAdded signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on menuitem #childAdded callback

## childMoved

type MenuitemChildMovedCallback Source #

Arguments

= Object | `arg1`: The `Menuitem` which is the child.
-> Word32 | `arg2`: The position that the child is being moved to.
-> Word32 | `arg3`: The position that the child is was in.
-> IO () |

Signaled when the child menuitem has had its location in the list change.

afterMenuitemChildMoved :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemChildMovedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the childMoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after menuitem #childMoved callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onMenuitemChildMoved :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemChildMovedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the childMoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on menuitem #childMoved callback

## childRemoved

type MenuitemChildRemovedCallback Source #

Arguments

= Object | `arg1`: The `Menuitem` which was the child.
-> IO () |

Signaled when the child menuitem has been requested to be removed from the parent. This signal is called when it has been removed from the list but not yet had `g_object_unref` called on it.

afterMenuitemChildRemoved :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemChildRemovedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the childRemoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after menuitem #childRemoved callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onMenuitemChildRemoved :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemChildRemovedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the childRemoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on menuitem #childRemoved callback

## event

type MenuitemEventCallback Source #

Arguments

= Text | `arg1`: Name of the event
-> GVariant | `arg2`: Information passed along with the event
-> Word32 | `arg3`: X11 timestamp of when the event happened
-> IO Bool |

Emitted when an event is passed through. The event is signalled after handle_event is called.

afterMenuitemEvent :: (IsMenuitem a, MonadIO m) => a -> Maybe Text -> ((?self :: a) => MenuitemEventCallback) -> m SignalHandlerId Source #

Connect a signal handler for the event signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after menuitem #event callback

This signal admits a optional parameter `detail`. If it's not `Nothing`, we will connect to “`event::detail`” instead.

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onMenuitemEvent :: (IsMenuitem a, MonadIO m) => a -> Maybe Text -> ((?self :: a) => MenuitemEventCallback) -> m SignalHandlerId Source #

Connect a signal handler for the event signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on menuitem #event callback

This signal admits a optional parameter `detail`. If it's not `Nothing`, we will connect to “`event::detail`” instead.

## itemActivated

type MenuitemItemActivatedCallback Source #

Arguments

= Word32 | `arg1`: The timestamp of when it was activated
-> IO () |

Emitted on the objects on the server side when they are signaled on the client side.

afterMenuitemItemActivated :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemItemActivatedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the itemActivated signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after menuitem #itemActivated callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onMenuitemItemActivated :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemItemActivatedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the itemActivated signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on menuitem #itemActivated callback

## propertyChanged

type MenuitemPropertyChangedCallback Source #

Arguments

= Text | `arg1`: The name of the property that changed
-> GVariant | `arg2`: The new value of the property
-> IO () |

Emitted everytime a property on a menuitem is either updated or added.

afterMenuitemPropertyChanged :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemPropertyChangedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the propertyChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after menuitem #propertyChanged callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onMenuitemPropertyChanged :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemPropertyChangedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the propertyChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on menuitem #propertyChanged callback

## realized

type MenuitemRealizedCallback = IO () Source #

Emitted when the initial request for properties is complete on the item. If there is a type handler configured for the "type" parameter that will be executed before this is signaled.

afterMenuitemRealized :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemRealizedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the realized signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after menuitem #realized callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onMenuitemRealized :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemRealizedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the realized signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on menuitem #realized callback

## showToUser

type MenuitemShowToUserCallback Source #

Arguments

= Word32 | `arg1`: Timestamp the event happened at
-> IO () |

Signaled when the application would like the visualization of this menu item shown to the user. This usually requires going over the bus to get it done.

afterMenuitemShowToUser :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemShowToUserCallback) -> m SignalHandlerId Source #

Connect a signal handler for the showToUser signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after menuitem #showToUser callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onMenuitemShowToUser :: (IsMenuitem a, MonadIO m) => a -> ((?self :: a) => MenuitemShowToUserCallback) -> m SignalHandlerId Source #

Connect a signal handler for the showToUser signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on menuitem #showToUser callback