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.Server

Contents

- Exported types
- Methods
  - getIconPaths
  - getStatus
  - getTextDirection
  - new
  - setIconPaths
  - setRoot
  - setStatus
  - setTextDirection
- Properties
  - dbusObject
  - rootNode
  - version
- Signals
  - itemActivationRequested
  - itemPropertyUpdated
  - itemUpdated
  - layoutUpdated

Description

A server which represents a sharing of a set of `DbusmenuMenuitems` across DBus to a `Client`.

Synopsis

- newtype Server = Server (ManagedPtr Server)
- class (GObject o, IsDescendantOf Server o) => IsServer o
- toServer :: (MonadIO m, IsServer o) => o -> m Server
- serverGetIconPaths :: (HasCallStack, MonadIO m, IsServer a) => a -> m [Text]
- serverGetStatus :: (HasCallStack, MonadIO m, IsServer a) => a -> m Status
- serverGetTextDirection :: (HasCallStack, MonadIO m, IsServer a) => a -> m TextDirection
- serverNew :: (HasCallStack, MonadIO m) => Text -> m Server
- serverSetIconPaths :: (HasCallStack, MonadIO m, IsServer a) => a -> [Text] -> m ()
- serverSetRoot :: (HasCallStack, MonadIO m, IsServer a, IsMenuitem b) => a -> b -> m ()
- serverSetStatus :: (HasCallStack, MonadIO m, IsServer a) => a -> Status -> m ()
- serverSetTextDirection :: (HasCallStack, MonadIO m, IsServer a) => a -> TextDirection -> m ()
- constructServerDbusObject :: (IsServer o, MonadIO m) => Text -> m (GValueConstruct o)
- getServerDbusObject :: (MonadIO m, IsServer o) => o -> m (Maybe Text)
- clearServerRootNode :: (MonadIO m, IsServer o) => o -> m ()
- constructServerRootNode :: (IsServer o, MonadIO m, IsMenuitem a) => a -> m (GValueConstruct o)
- getServerRootNode :: (MonadIO m, IsServer o) => o -> m (Maybe Menuitem)
- setServerRootNode :: (MonadIO m, IsServer o, IsMenuitem a) => o -> a -> m ()
- getServerVersion :: (MonadIO m, IsServer o) => o -> m Word32
- type ServerItemActivationRequestedCallback = Int32 -> Word32 -> IO ()
- afterServerItemActivationRequested :: (IsServer a, MonadIO m) => a -> ((?self :: a) => ServerItemActivationRequestedCallback) -> m SignalHandlerId
- onServerItemActivationRequested :: (IsServer a, MonadIO m) => a -> ((?self :: a) => ServerItemActivationRequestedCallback) -> m SignalHandlerId
- type ServerItemPropertyUpdatedCallback = Int32 -> Text -> GVariant -> IO ()
- afterServerItemPropertyUpdated :: (IsServer a, MonadIO m) => a -> ((?self :: a) => ServerItemPropertyUpdatedCallback) -> m SignalHandlerId
- onServerItemPropertyUpdated :: (IsServer a, MonadIO m) => a -> ((?self :: a) => ServerItemPropertyUpdatedCallback) -> m SignalHandlerId
- type ServerItemUpdatedCallback = Int32 -> IO ()
- afterServerItemUpdated :: (IsServer a, MonadIO m) => a -> ((?self :: a) => ServerItemUpdatedCallback) -> m SignalHandlerId
- onServerItemUpdated :: (IsServer a, MonadIO m) => a -> ((?self :: a) => ServerItemUpdatedCallback) -> m SignalHandlerId
- type ServerLayoutUpdatedCallback = Word32 -> Int32 -> IO ()
- afterServerLayoutUpdated :: (IsServer a, MonadIO m) => a -> ((?self :: a) => ServerLayoutUpdatedCallback) -> m SignalHandlerId
- onServerLayoutUpdated :: (IsServer a, MonadIO m) => a -> ((?self :: a) => ServerLayoutUpdatedCallback) -> m SignalHandlerId

# Exported types

newtype Server Source #

Memory-managed wrapper type.

Constructors

Server (ManagedPtr Server) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf Server o) => IsServer o Source #

Type class for types which can be safely cast to `Server`, for instance with `toServer`.

#### Instances

Instances details

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

toServer :: (MonadIO m, IsServer o) => o -> m Server Source #

Cast to `Server`, 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, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getData, getIconPaths, getProperty, getQdata, getStatus, getTextDirection.

#### Setters

setData, setDataFull, setIconPaths, setProperty, setRoot, setStatus, setTextDirection.

## getIconPaths

serverGetIconPaths Source #

Arguments

:: (HasCallStack, MonadIO m, IsServer a) |
=> a | `server`: The `Server` to get the icon paths from
-> m [Text] | Returns: A NULL-terminated list of icon paths with memory managed by the server. Duplicate if you want to keep them.

Gets the stored and exported icon paths from the server.

## getStatus

serverGetStatus Source #

Arguments

:: (HasCallStack, MonadIO m, IsServer a) |
=> a | `server`: The `Server` to get the status from
-> m Status |

Gets the current statust hat the server is sending out over DBus.

Return value: The current status the server is sending

## getTextDirection

serverGetTextDirection Source #

Arguments

:: (HasCallStack, MonadIO m, IsServer a) |
=> a | `server`: The `Server` object to get the text direction from
-> m TextDirection |

Returns the value of the text direction that is being exported over DBus for this server. It should relate to the direction of the labels and other text fields that are being exported by this server.

Return value: Text direction exported for this server.

## new

serverNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `object`: The object name to show for this menu structure on DBus. May be NULL.
-> m Server |

Creates a new `Server` object with a specific object path on DBus. If `object` is set to NULL the default object name of "/com/canonical/dbusmenu" will be used.

Return value: A brand new `Server`

## setIconPaths

serverSetIconPaths Source #

Arguments

:: (HasCallStack, MonadIO m, IsServer a) |
=> a | `server`: The `Server` to set the icon paths on
-> [Text] |
-> m () |

Sets the icon paths for the server. This will replace previously set icon theme paths.

## setRoot

serverSetRoot Source #

Arguments

:: (HasCallStack, MonadIO m, IsServer a, IsMenuitem b) |
=> a | `self`: The `Server` object to set the root on
-> b | `root`: The new root `Menuitem` tree
-> m () |

This function contains all of the `Value` wrapping required to set the property Server:rootNode on the server `self`.

## setStatus

serverSetStatus Source #

Arguments

:: (HasCallStack, MonadIO m, IsServer a) |
=> a | `server`: The `Server` to set the status on
-> Status | `status`: Status value to set on the server
-> m () |

Changes the status of the server.

## setTextDirection

serverSetTextDirection Source #

Arguments

:: (HasCallStack, MonadIO m, IsServer a) |
=> a | `server`: The `Server` object to set the text direction on
-> TextDirection | `dir`: Direction of the text
-> m () |

Sets the text direction that should be exported over DBus for this server. If the value is set to `DBUSMENU_TEXT_DIRECTION_NONE` the default detection will be used for setting the value and exported over DBus.

# Properties

## dbusObject

No description available in the introspection data.

constructServerDbusObject :: (IsServer o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getServerDbusObject :: (MonadIO m, IsServer o) => o -> m (Maybe Text) Source #

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

    get server #dbusObject

## rootNode

No description available in the introspection data.

clearServerRootNode :: (MonadIO m, IsServer o) => o -> m () Source #

Set the value of the “`root-node`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #rootNode

constructServerRootNode :: (IsServer o, MonadIO m, IsMenuitem a) => a -> m (GValueConstruct o) Source #

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

getServerRootNode :: (MonadIO m, IsServer o) => o -> m (Maybe Menuitem) Source #

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

    get server #rootNode

setServerRootNode :: (MonadIO m, IsServer o, IsMenuitem a) => o -> a -> m () Source #

Set the value of the “`root-node`” property. When overloading is enabled, this is equivalent to

    set server [ #rootNode := value ]

## version

No description available in the introspection data.

getServerVersion :: (MonadIO m, IsServer o) => o -> m Word32 Source #

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

    get server #version

# Signals

## itemActivationRequested

type ServerItemActivationRequestedCallback Source #

Arguments

= Int32 | `arg1`: The ID of the parent for this update.
-> Word32 | `arg2`: The timestamp of when the event happened
-> IO () |

This is signaled when a menuitem under this server sends its activate signal.

afterServerItemActivationRequested :: (IsServer a, MonadIO m) => a -> ((?self :: a) => ServerItemActivationRequestedCallback) -> m SignalHandlerId Source #

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

    after server #itemActivationRequested 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.

onServerItemActivationRequested :: (IsServer a, MonadIO m) => a -> ((?self :: a) => ServerItemActivationRequestedCallback) -> m SignalHandlerId Source #

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

    on server #itemActivationRequested callback

## itemPropertyUpdated

type ServerItemPropertyUpdatedCallback = Int32 -> Text -> GVariant -> IO () Source #

No description available in the introspection data.

afterServerItemPropertyUpdated :: (IsServer a, MonadIO m) => a -> ((?self :: a) => ServerItemPropertyUpdatedCallback) -> m SignalHandlerId Source #

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

    after server #itemPropertyUpdated 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.

onServerItemPropertyUpdated :: (IsServer a, MonadIO m) => a -> ((?self :: a) => ServerItemPropertyUpdatedCallback) -> m SignalHandlerId Source #

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

    on server #itemPropertyUpdated callback

## itemUpdated

type ServerItemUpdatedCallback = Int32 -> IO () Source #

No description available in the introspection data.

afterServerItemUpdated :: (IsServer a, MonadIO m) => a -> ((?self :: a) => ServerItemUpdatedCallback) -> m SignalHandlerId Source #

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

    after server #itemUpdated 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.

onServerItemUpdated :: (IsServer a, MonadIO m) => a -> ((?self :: a) => ServerItemUpdatedCallback) -> m SignalHandlerId Source #

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

    on server #itemUpdated callback

## layoutUpdated

type ServerLayoutUpdatedCallback Source #

Arguments

= Word32 | `arg1`: A revision number representing which revision the update represents itself as.
-> Int32 | `arg2`: The ID of the parent for this update.
-> IO () |

This signal is emitted any time the layout of the menuitems under this server is changed.

afterServerLayoutUpdated :: (IsServer a, MonadIO m) => a -> ((?self :: a) => ServerLayoutUpdatedCallback) -> m SignalHandlerId Source #

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

    after server #layoutUpdated 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.

onServerLayoutUpdated :: (IsServer a, MonadIO m) => a -> ((?self :: a) => ServerLayoutUpdatedCallback) -> m SignalHandlerId Source #

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

    on server #layoutUpdated callback