Hemera::Planet Class Referenceabstract

Registers the current application as a Planet, allowing satellites management. More...

#include <HemeraCore/Planet>

Inheritance diagram for Hemera::Planet:

Public Types

enum  ActivationPolicy { ActivationPolicy::FullyExplicit, ActivationPolicy::ActivateOnLaunch, ActivationPolicy::KeepAtMostOneActive, ActivationPolicy::MobileLikeShell }

Protected Slots

void setActivationPolicies (ActivationPolicies policies)
- Protected Slots inherited from Hemera::AsyncInitObject
virtual void initImpl ()=0
void setReady ()
void setInitError (const QString &errorName, const QString &message=QString())
void setOnePartIsReady ()

Additional Inherited Members

- Public Slots inherited from Hemera::AsyncInitObject
Hemera::Operationinit ()
- Signals inherited from Hemera::AsyncInitObject
void ready ()
- Protected Member Functions inherited from Hemera::AsyncInitObject
void setParts (uint parts)

Detailed Description

Registers the current application as a Planet, allowing satellites management.

If your application is not a planet, this API is unaccessible and trying to initialize it will result in a failure. To launch applications or request protocol handlers, refer to Hemera::ServiceManager.

Planet enables an applications belonging to a Planet's Orbit, or a Planetary Application, to manage its satellites. Satellites are Orbits (or Orbital Applications) directly controlled and managed from a Planet. Read PlanetsOrbitsAndSatellites for a detailed explanation of this concept, the understanding of which is required to leverage this mechanism.

Planet is flexible and meant to be integrated with your application/context switching logic (if any). Satellites can be either active or inactive, and any number of satellites can be launched.

For each Star, only one Planet can be present. Initialization will fail if another Planet already exists.

Lifetime of Satellites

A Satellite's lifetime is usually determined by the Planet, which can shut it down at any time. However, if the Planet shuts down, every Satellite is shut down regardless as well. A Satellite has limited interaction with Gravity and is proxied in 2 levels.

Satellites must be explicitly started. If your Planet has the concept of a Session, it should manage this internally by launching Satellites at startup and saving their states when shutting down.

Activity of Satellites

Satellites are applications, and as such they follow the concepts of Hemera's state machine for Applications. An application can be either started or stopped when alive, and the Activity determined by its Star makes it work.

Planets can decide arbitrarly the behavioral policy for Satellite activation. By default, everything needs to be explicitly set, but a Planet can be configured to perform some automated activation task. It can be easily configured to keep every Satellite active at all times, matching the behavior of a Desktop Shell, or emulate a commercial Mobile shell.

If your policy isn't fully automated, you always need to explicitly activate or deactivate Satellites, depending on your context. Of course, there could be no active satellites. If you are operating with KeepAtMostOneActive, no explicit deactivation is required, unless you want to deactivate all satellites (e.g.:: return to the shell): request for activation of a new satellite will implicitly trigger the deactivation of the active one.

See also

Member Enumeration Documentation

This enum represents the activation policy the Application Handler will keep when Planet deals with the Satellite.


This policy implies no action will be automatically taken by Parsec. Every activation and deactivation request will need to be explicit. No other policies can be set.


When a satellite gets launched, it also gets activated immediately.


When a satellite gets activated, all the others are deactivated automatically. Requesting a multiple satellite activation will fail.


Shortcut for creating a policy set which matches a typical mobile shell. It is the same as ActivateOnLaunch | KeepAtMostOneActive | PlanetIsAlwaysActive.

Member Function Documentation

void Hemera::Planet::setActivationPolicies ( ActivationPolicies  policies)

Sets the activation policies for this Planet. This method has to be called during the Planet's initialization phase and cannot be called afterwards.

This means the activation policies cannot be changed during the Planet's execution. If you need a more flexible policy, you can set FullyExplicit (which is also default) to explicitly set activation for each satellite (and the planet itself).

policies The policies for this planet.