![]() |
Heaven v0.1.0-1
C++ global-menu library for Wayland sessions
|
Base class for all objects shared by a client and displayed in the bar. More...
#include "HNObject.h"


Public Types | |
| enum | Type { Topbar , Menu , Action , Toggle , Divider } |
| Enumeration of the possible object roles. More... | |
Public Member Functions | |
| UInt32 | id () const noexcept |
| Returns the client-assigned unique identifier of this object. | |
| Type | type () const noexcept |
| Returns the immutable role/type of this object. | |
| HNClient * | client () const noexcept |
| Returns the client that owns this object. | |
| void | click () noexcept |
| Notifies the owning client that this object was clicked. | |
Static Public Member Functions | |
| static bool | IsValidType (UInt32 type) noexcept |
| Checks whether a numeric value is a valid object type. | |
Protected Member Functions | |
| HNObject (UInt32 id, Type type) noexcept | |
| Constructs an object with the given id and role. | |
Base class for all objects shared by a client and displayed in the bar.
Every menu item exposed by a client is represented, on the bar side, by a subclass of HNObject (HNTopbar, HNMenu, HNAction, HNToggle, HNDivider).
The concrete role of an object is fixed at creation time and never changes during its lifetime. Depending on its role, an object may additionally implement the HNWith* mixin interfaces (title, icon, parent, children, etc.).
Instances are owned and managed by the bar library; they are created and destroyed as the owning client requests it.
| enum Type |
Constructs an object with the given id and role.
| id | Client-assigned object identifier. |
| type | Immutable object role. |
|
noexcept |
Notifies the owning client that this object was clicked.
The bar application calls this method when the user activates the item. The click is forwarded over D-Bus to the owning client, which will emit its own click notification.
|
inlinenoexcept |
Returns the client that owns this object.
|
inlinenoexcept |
Returns the client-assigned unique identifier of this object.
The identifier is unique within the scope of the owning client.
|
inlinestaticnoexcept |
Checks whether a numeric value is a valid object type.
| type | Raw value received over D-Bus. |
type maps to a valid Type, false otherwise.
|
inlinenoexcept |
Returns the immutable role/type of this object.