Orxonox: orxonox::NotificationOverlay Class Reference

# orxonox::NotificationOverlay Class Reference

The NotificationOverlay is used to display single Notifications, then bundled in a NotificationQUeue. More...

`#include <src/orxonox/overlays/notifications/NotificationOverlay.h>`

Inheritance diagram for orxonox::NotificationOverlay:

List of all members.

## Public Member Functions

| NotificationOverlay (NotificationQueue *queue, Notification *notification)
| Constructor. Initializes the class creates a graphical representation of the input Notification for the input Queue.
| NotificationOverlay (BaseObject *creator)
| Constructor. Intializes the class.
bool | processNotification (Notification *notification)
| Processes the input Notification.
void | setFontSize (float size)
| Sets the font size of this overlay's text.
virtual | ~NotificationOverlay ()
| Destructor.

## Protected Member Functions

std::string | clipMessage (const std::string &message)
| Clips the input message if too long.

## Private Member Functions

void | defineOverlay (void)
| Sets some overlay-specific values.
void | initialize (void)
| Initializes the object.

## Private Attributes

Notification * | notification_
| The Notification this overlay displays.
NotificationQueue * | queue_
| The NotificationQeue this overlay belongs to.

## Detailed Description

The NotificationOverlay is used to display single Notifications, then bundled in a NotificationQUeue.

Author:
  Damian 'Mozork' Frick

## Constructor & Destructor Documentation

orxonox::NotificationOverlay::NotificationOverlay | ( | BaseObject * | creator | ) |

Constructor. Intializes the class.

References initialize(), and RegisterObject.

orxonox::NotificationOverlay::NotificationOverlay | ( | NotificationQueue * | queue,
|  | Notification * | notification |
| ) |  |  |

Constructor. Initializes the class creates a graphical representation of the input Notification for the input Queue.

Parameters:

  | queue | A pointer to the queue the NotificatonOverlay belongs to.
  | notification | A pointer to the Notification represented by this overlay.

Exceptions:

  | Argument | Throws an Argument-Exception if either no Notification or no NotificationQueue were input.

> If either notification or queue are not given an Exception is thrown.

References defineOverlay(), initialize(), processNotification(), queue_, and ThrowException.

orxonox::NotificationOverlay::~NotificationOverlay | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

std::string orxonox::NotificationOverlay::clipMessage | ( | const std::string & | message | ) | `[protected]`

Clips the input message if too long.

Clips the input message so that it meets the requirements for the maximal length of Notifications given by the NotificationQueue.

< If the message is not too long.

References orxonox::NotificationQueue::getNotificationLength(), and queue_.

Referenced by processNotification().

void orxonox::NotificationOverlay::defineOverlay | ( | void |  | ) | `[private]`

Sets some overlay-specific values.

Set some Overlay-specific values.

References orxonox::NotificationQueue::getFont(), orxonox::NotificationQueue::getFontSize(), orxonox::NotificationQueue::getPosition(), queue_, orxonox::OverlayText::setFont(), orxonox::OrxonoxOverlay::setPosition(), and orxonox::OverlayText::setTextSize().

Referenced by NotificationOverlay().

void orxonox::NotificationOverlay::initialize | ( | void |  | ) | `[private]`

Initializes the object.

Initializes and Registers the object.

References queue_.

Referenced by NotificationOverlay().

bool orxonox::NotificationOverlay::processNotification | ( | Notification * | notification | ) |

Processes the input Notification.

Processes the input notification, resp. sees to it. that the NotificationOverlay displays the Notification message.

Parameters:

  | notification | A pointer to the notification that should be processed.

Returns:
  Returns true if successful.

References clipMessage(), orxonox::Notification::getMessage(), notification_, and orxonox::OverlayText::setCaption().

Referenced by NotificationOverlay().

void orxonox::NotificationOverlay::setFontSize | ( | float | size | ) | `[inline]`

Sets the font size of this overlay's text.

Parameters:

  | size | The font size.

## Member Data Documentation

Notification* orxonox::NotificationOverlay::notification_`[private]`

The Notification this overlay displays.

Referenced by processNotification().

NotificationQueue* orxonox::NotificationOverlay::queue_`[private]`

The NotificationQeue this overlay belongs to.

Referenced by clipMessage(), defineOverlay(), initialize(), and NotificationOverlay().

The documentation for this class was generated from the following files:

- src/orxonox/overlays/notifications/NotificationOverlay.h
- src/orxonox/overlays/notifications/NotificationOverlay.cc