Index: code/trunk/src/modules/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/CMakeLists.txt	(revision 7163)
+++ code/trunk/src/modules/CMakeLists.txt	(revision 7164)
@@ -27,4 +27,6 @@
 ################ Sub Directories ################
 
+ADD_SUBDIRECTORY(designtools)
+ADD_SUBDIRECTORY(notifications)
 ADD_SUBDIRECTORY(objects)
 ADD_SUBDIRECTORY(overlays)
@@ -33,3 +35,2 @@
 ADD_SUBDIRECTORY(questsystem)
 ADD_SUBDIRECTORY(weapons)
-ADD_SUBDIRECTORY(designtools)
Index: code/trunk/src/modules/notifications/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/notifications/CMakeLists.txt	(revision 7164)
+++ code/trunk/src/modules/notifications/CMakeLists.txt	(revision 7164)
@@ -0,0 +1,18 @@
+SET_SOURCE_FILES(NOTIFICATIONS_SRC_FILES
+  Notification.cc
+  NotificationManager.cc
+  NotificationOverlay.cc
+  NotificationQueue.cc
+)
+
+ORXONOX_ADD_LIBRARY(notifications
+  MODULE
+  FIND_HEADER_FILES
+  TOLUA_FILES
+  PCH_FILE
+    NotificationsPrecompiledHeaders.h
+  LINK_LIBRARIES
+    orxonox
+    overlays
+  SOURCE_FILES ${NOTIFICATIONS_SRC_FILES}
+)
Index: code/trunk/src/modules/notifications/Notification.cc
===================================================================
--- code/trunk/src/modules/notifications/Notification.cc	(revision 7164)
+++ code/trunk/src/modules/notifications/Notification.cc	(revision 7164)
@@ -0,0 +1,133 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See thes
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of the Notification class.
+*/
+
+#include "Notification.h"
+
+#include "core/CoreIncludes.h"
+#include "NotificationManager.h"
+
+namespace orxonox
+{
+
+    CreateUnloadableFactory(Notification);
+
+    /**
+    @brief
+        Default constructor. Initializes the object.
+    */
+    Notification::Notification(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(Notification);
+        this->initialize();
+    }
+
+    /**
+    @brief
+        Constructor. Creates a Notification with the input message.
+    @param message
+        The message of the Notification.
+    */
+    Notification::Notification(BaseObject* creator, const std::string & message) : BaseObject(creator)
+    {
+        this->message_ = message;
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    Notification::~Notification()
+    {
+
+    }
+
+    /**
+    @brief
+        Registers the object and sets some default values.
+    */
+    void Notification::initialize(void)
+    {
+        this->message_.clear();
+        this->sender_ = NotificationManager::NONE;
+        this->sent_ = false;
+    }
+
+    /**
+    @brief
+        Sends the Notification to the Notificationmanager, with sender NetificationManager::NONE.
+    @return
+        Returns true if successful.
+    */
+    bool Notification::send(void)
+    {
+        return this->send(NotificationManager::NONE);
+    }
+
+    /**
+    @brief
+        Sends the Notification to the Notificationmanager, which then in turn distributes it to the different NotificationQueues.
+    @param sender
+        The sender the Notification was sent by. Used by the NotificationManager to distributes the notification to the correct NotificationQueues.
+    @return
+        Returns true if successful.
+    */
+    bool Notification::send(const std::string & sender)
+    {
+        this->sender_ = sender;
+        bool successful = NotificationManager::getInstance().registerNotification(this);
+        if(!successful)
+            return false;
+        this->sent_ = true;
+
+        COUT(3) << "Notification \"" << this->getMessage() << "\" sent." << std::endl;
+
+        return true;
+    }
+
+    /**
+    @brief
+        Sets the message of the notification.
+    @param message
+        The message to be set.
+    @return
+        Returns true if successful.
+    */
+    bool Notification::setMessage(const std::string & message)
+    {
+        if(this->isSent()) //!< The message cannot be changed if the message has already been sent.
+            return false;
+        this->message_ = message;
+        return true;
+    }
+
+}
Index: code/trunk/src/modules/notifications/Notification.h
===================================================================
--- code/trunk/src/modules/notifications/Notification.h	(revision 7164)
+++ code/trunk/src/modules/notifications/Notification.h	(revision 7164)
@@ -0,0 +1,90 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of the Notification class.
+*/
+
+#ifndef _Notification_H__
+#define _Notification_H__
+
+#include "notifications/NotificationsPrereqs.h"
+
+#include <string>
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        A Notification is a short message used to inform the player about something that just happened. A Notification can be sent from any part of orxonox and is then displayed in the proper NotificationQueue (depending on which senders the specific NotificationQueue accepts).
+    @author
+        Damian 'Mozork' Frick
+    */
+    class _NotificationsExport Notification : public BaseObject
+    {
+        public:
+            Notification(BaseObject* creator);
+            Notification(BaseObject* creator, const std::string & message);
+            virtual ~Notification();
+
+            bool send(void); //!< Sends the Notification to the Notificationmanager, with sender NotificationManager::NONE;
+            bool send(const std::string & sender); //!< Sends the Notification to the Notificationmanager.
+
+            /**
+            @brief Checks whether the Notification was sent.
+            @return Returns true if the Notification was sent already.
+            */
+            inline bool isSent(void) const
+                { return this->sent_; }
+            /**
+            @brief Returns the message of the Notification.
+            @return Returns the message of the Notification.
+            */
+            inline const std::string & getMessage(void) const
+                { return this->message_; }
+
+            inline const std::string & getSender(void) const
+                { return this->sender_; }
+
+            bool setMessage(const std::string & message); //!< Sets the message of the notification.
+
+        private:
+            std::string message_; //!< The Notification message.
+            std::string sender_; //!< The sender of the notification.
+            bool sent_; //!< Whether Notification has been sent, if so it cannot be changed.
+
+            void initialize(void);
+
+    };
+
+}
+
+#endif /* _Notification_H__ */
Index: code/trunk/src/modules/notifications/NotificationManager.cc
===================================================================
--- code/trunk/src/modules/notifications/NotificationManager.cc	(revision 7164)
+++ code/trunk/src/modules/notifications/NotificationManager.cc	(revision 7164)
@@ -0,0 +1,284 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of the NotificationManager class.
+*/
+
+#include "NotificationManager.h"
+
+#include <set>
+
+#include "core/CoreIncludes.h"
+#include "core/ScopedSingletonManager.h"
+#include "Notification.h"
+#include "interfaces/NotificationListener.h"
+
+namespace orxonox
+{
+
+    const std::string NotificationManager::ALL("all");
+    const std::string NotificationManager::NONE("none");
+
+    ManageScopedSingleton(NotificationManager, ScopeID::Root, false);
+
+    /**
+    @brief
+        Constructor. Registers the Object.
+    */
+    NotificationManager::NotificationManager()
+    {
+        RegisterRootObject(NotificationManager);
+
+        this->highestIndex_ = 0;
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    NotificationManager::~NotificationManager()
+    {
+
+    }
+
+    /**
+    @brief
+        Registers a Notification within the NotificationManager and makes sure that the Notification is sent to all the NotificationListeners associated with its sender.
+    @param notification
+        The Notification to be registered.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationManager::registerNotification(Notification* notification)
+    {
+
+        if(notification == NULL) //!< A NULL-Notification cannot be registered.
+            return false;
+
+        std::time_t time = std::time(0); //TODO: Doesn't this expire? //!< Get current time.
+
+        this->allNotificationsList_.insert(std::pair<std::time_t,Notification*>(time,notification));
+
+        if(notification->getSender() == NONE) //!< If the sender has no specific name, then the Notification is only added to the list of all Notifications.
+            return true;
+
+        bool all = false;
+        if(notification->getSender() == ALL) //!< If all are the sender, then the Notifications is added to every NotificationListener.
+            all = true;
+
+        //!< Insert the notification in all listeners that have its sender as target.
+        for(std::map<NotificationListener*,int>::iterator it = this->listenerList_.begin(); it != this->listenerList_.end(); it++) //!< Iterate through all listeners.
+        {
+            std::set<std::string> set = it->first->getTargetsSet();
+            if(all || set.find(notification->getSender()) != set.end() || set.find(ALL) != set.end()) //TODO: Make sure this works.
+            {
+                this->notificationLists_[it->second]->insert(std::pair<std::time_t,Notification*>(time,notification)); //!< Insert the Notification in the Notifications list of the current NotificationListener.
+                it->first->update(notification, time); //!< Update the listener.
+                std::map<Notification*, unsigned int>::iterator counterIt = this->listenerCounter_.find(notification);
+                if(counterIt == this->listenerCounter_.end())
+                    this->listenerCounter_[notification] = 1;
+                else
+                    this->listenerCounter_[notification] = counterIt->second + 1;
+            }
+        }
+
+        COUT(4) << "Notification registered with the NotificationManager." << std::endl;
+
+        return true;
+    }
+
+    /**
+    @brief
+        Unregisters a Notification within the NotificationManager.
+    @param notification
+        A pointer to the Notification to be unregistered.
+    @param listener
+        A pointer to the NotificationListener the Notification is unregistered for.
+    */
+    void NotificationManager::unregisterNotification(Notification* notification, NotificationListener* listener)
+    {
+        assert(notification);
+        assert(listener);
+
+        // If the Notification was removed from the list of Notifications of the input NotificationListener, the counter for the Notification of the number of NotificationListeners it is present in is decremented.
+        if(this->removeNotification(notification, *(this->notificationLists_.find(this->listenerList_.find(listener)->second)->second)))
+            this->listenerCounter_[notification] = this->listenerCounter_[notification] - 1;
+
+        // If the Notification is no longer present in any of the NotificationListeners it can be removed from the map of all Notifications and be destroyed.
+        if(this->listenerCounter_[notification] == (unsigned int) 0)
+        {
+            this->removeNotification(notification, this->allNotificationsList_);
+            this->listenerCounter_.erase(notification);
+            notification->destroy();
+        }
+
+        COUT(4) << "Notification unregistered with the NotificationManager." << std::endl;
+    }
+
+    /**
+    @brief
+        Helper method that removes an input notification form an input map.
+    @param notification
+        A pointer to the notification to be removed.
+    @param map
+        The map the notification should be removed from.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationManager::removeNotification(Notification* notification, std::multimap<std::time_t, Notification*>& map)
+    {
+        // Iterates through all items in the map until the Notification is found.
+        //TODO: Do more efficiently?
+        for(std::multimap<std::time_t, Notification*>::iterator it = map.begin(); it != map.end(); it++)
+        {
+            if(it->second == notification)
+            {
+                map.erase(it);
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+    @brief
+        Registers a NotificationListener within the NotificationManager.
+    @param listener
+        The NotificationListener to be registered.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationManager::registerListener(NotificationListener* listener)
+    {
+        this->highestIndex_ += 1;
+        int index = this->highestIndex_;
+
+        this->listenerList_[listener] = index; //!< Add the NotificationListener to the list of listeners.
+
+        std::set<std::string> set = listener->getTargetsSet(); //TODO: Does this work?
+
+        //! If all senders are the target of the listener, then the list of notification for that specific listener is te same as the list of all Notifications.
+        if(set.find(ALL) != set.end())
+        {
+            this->notificationLists_[index] = &this->allNotificationsList_;
+            COUT(4) << "NotificationListener registered with the NotificationManager." << std::endl;
+            return true;
+        }
+
+        this->notificationLists_[index] = new std::multimap<std::time_t,Notification*>;
+        std::multimap<std::time_t,Notification*> map = *this->notificationLists_[index];
+
+        //! Iterate through all Notifications to determine whether any of them should belong to the newly registered NotificationListener.
+        for(std::multimap<std::time_t,Notification*>::iterator it = this->allNotificationsList_.begin(); it != this->allNotificationsList_.end(); it++)
+        {
+            if(set.find(it->second->getSender()) != set.end()) //!< Checks whether the overlay has the sender of the current notification as target.
+            {
+                map.insert(std::pair<std::time_t, Notification*>(it->first, it->second));
+                std::map<Notification*, unsigned int>::iterator counterIt = this->listenerCounter_.find(it->second);
+                if(counterIt == this->listenerCounter_.end())
+                    this->listenerCounter_[it->second] = 1;
+                else
+                    this->listenerCounter_[it->second] = counterIt->second + 1;
+            }
+        }
+
+        listener->update(); //!< Update the listener.
+
+        COUT(4) << "NotificationListener registered with the NotificationManager." << std::endl;
+
+        return true;
+    }
+
+    /**
+    @brief
+        Unregisters a NotificationListener withing the NotificationManager.
+    */
+    void NotificationManager::unregisterListener(NotificationListener* listener)
+    {
+        assert(listener);
+
+        int identifier = this->listenerList_.find(listener)->second;
+        std::multimap<std::time_t, Notification*>* map = this->notificationLists_.find(identifier)->second;
+
+        // Make sure all Notifications are removed.
+        std::multimap<std::time_t, Notification*>::iterator it = map->begin();
+        while(it != map->end())
+        {
+            this->unregisterNotification(it->second, listener);
+            it = map->begin();
+        }
+
+        this->listenerList_.erase(listener);
+        this->notificationLists_.erase(identifier);
+
+        // If the map is not the map of all notifications, delete it.
+        if(map != &this->allNotificationsList_)
+            delete map;
+
+        COUT(4) << "NotificationListener unregistered with the NotificationManager." << std::endl;
+    }
+
+    /**
+    @brief
+        Fetches the Notifications for a specific NotificationListener in a specified timeframe.
+    @param listener
+        The NotificationListener the Notifications are fetched for.
+    @param map
+        A multimap, in which the notifications are stored.
+    @param timeFrameStart
+        The start time of the timeframe.
+    @param timeFrameEnd
+        The end time of the timeframe.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationManager::getNotifications(NotificationListener* listener, std::multimap<std::time_t,Notification*>* map, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd)
+    {
+        if(listener == NULL || map == NULL)
+            return false;
+
+        std::multimap<std::time_t,Notification*>* notifications = this->notificationLists_[this->listenerList_[listener]]; //!< The Notifications for the input NotificationListener.
+
+        if(notifications == NULL) //!< Returns NULL, if there are no Notifications.
+            return true;
+
+        std::multimap<std::time_t,Notification*>::iterator it, itLowest, itHighest;
+        itLowest = notifications->lower_bound(timeFrameStart);
+        itHighest = notifications->upper_bound(timeFrameStart);
+
+        for(it = itLowest; it != itHighest; it++) //!< Iterate through the Notifications from the start of the time Frame to the end of it.
+        {
+            map->insert(std::pair<std::time_t,Notification*>(it->first,it->second)); //!< Add the found Notifications to the map.
+        }
+
+        return true;
+    }
+
+}
Index: code/trunk/src/modules/notifications/NotificationManager.h
===================================================================
--- code/trunk/src/modules/notifications/NotificationManager.h	(revision 7164)
+++ code/trunk/src/modules/notifications/NotificationManager.h	(revision 7164)
@@ -0,0 +1,107 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of the NotificationManager class.
+*/
+
+#ifndef _NotificationManager_H__
+#define _NotificationManager_H__
+
+#include "notifications/NotificationsPrereqs.h"
+
+#include <ctime>
+#include <map>
+#include <string>
+
+#include "util/Singleton.h"
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        The Singleton NotificationManager functions as a gateway between Notifications and NotificationListeners.
+        It receives, organizes Notifications and the redistributes them to the specific NotificationListeners.
+    @author
+        Damian 'Mozork' Frick
+    */
+    class _NotificationsExport NotificationManager : public Singleton<NotificationManager>, public OrxonoxClass
+    {
+            friend class Singleton<NotificationManager>;
+        public:
+            NotificationManager();
+            virtual ~NotificationManager();
+
+            static const std::string ALL; //!< Static string to indicate a sender that sends to all NotificationListeners.
+            static const std::string NONE; //!< Static string to indicare a sender that sends to no specific NotificationListener.
+
+            bool registerNotification(Notification* notification); //!< Registers a Notification within the NotificationManager.
+            void unregisterNotification(Notification* notification, NotificationListener* listener); //!< Unregisters a Notification within the NotificationManager.
+            bool registerListener(NotificationListener* listener); //!< Registers a NotificationListener within the NotificationManager.
+            void unregisterListener(NotificationListener* listener); //!< Unregisters a NotificationListener withing the NotificationManager.
+
+            bool getNotifications(NotificationListener* listener, std::multimap<std::time_t,Notification*>* map, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd); //!< Returns the Notifications for a specific NotificationListener in a specified timeframe.
+
+            /**
+            @brief Fetches the Notifications for a specific NotificationListener starting at a specified time.
+            @param listener The NotificationListener the Notifications are fetched for.
+            @param map A multimap, in which the notifications are stored.
+            @param timeFrameStart The start time the Notifications are fetched from.
+            @return Returns true if successful.
+            */
+            bool getNotifications(NotificationListener* listener, std::multimap<std::time_t,Notification*>* map, const std::time_t & timeFrameStart)
+                { return this->getNotifications(listener, map, timeFrameStart, std::time(0)); }
+            /**
+            @brief Fetches the Notifications for a specific NotificationListener starting at a specified timespan before now.
+            @param listener The NotificationListener the Notifications are fetched for.
+            @param map A multimap, in which the notifications are stored.
+            @param timeDelay The timespan.
+            @return Returns true if successful.
+            */
+            bool getNotifications(NotificationListener* listener, std::multimap<std::time_t,Notification*>* map, int timeDelay)
+                { return this->getNotifications(listener, map, std::time(0)-timeDelay, std::time(0)); }
+
+        private:
+            static NotificationManager* singletonPtr_s;
+
+            int highestIndex_; //!< This variable holds the highest index (resp. key) in notificationLists_s, to secure that no key appears twice.
+
+            std::multimap<std::time_t,Notification*> allNotificationsList_; //!< Container where all notifications are stored.
+            std::map<NotificationListener*,int> listenerList_; //!< Container where all NotificationListeners are stored with a number as identifier.
+            std::map<int,std::multimap<std::time_t,Notification*>*> notificationLists_; //!< Container where all Notifications, for each identifier (associated with a NotificationListener), are stored.
+            std::map<Notification*, unsigned int> listenerCounter_; //!< A container to store the number of NotificationListeners a Notification is registered with.
+
+            bool removeNotification(Notification* notification, std::multimap<std::time_t, Notification*>& map); //!< Helper method that removes an input notification form an input map.
+
+    };
+
+}
+
+#endif /* _NotificationManager_H__ */
Index: code/trunk/src/modules/notifications/NotificationOverlay.cc
===================================================================
--- code/trunk/src/modules/notifications/NotificationOverlay.cc	(revision 7164)
+++ code/trunk/src/modules/notifications/NotificationOverlay.cc	(revision 7164)
@@ -0,0 +1,136 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of the NotificationOverlay class.
+*/
+
+#include "NotificationOverlay.h"
+
+#include "util/Exception.h"
+#include "core/CoreIncludes.h"
+#include "Notification.h"
+#include "NotificationQueue.h"
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        Constructor. Intializes the class.
+    */
+    NotificationOverlay::NotificationOverlay(BaseObject* creator) : OverlayText(creator)
+    {
+        RegisterObject(NotificationOverlay);
+        this->initialize();
+    }
+
+    /**
+    @brief
+        Constructor. Initializes the class creates a graphical representation of the input Notification for the input Queue.
+    @param queue
+        A pointer to the queue the NotificatonOverlay belongs to.
+    @param notification
+        A pointer to the Notification represented by this overlay.
+    @throws Argument
+        Throws an Argument-Exception if either no Notification or no NotificationQueue were input.
+    */
+    NotificationOverlay::NotificationOverlay(NotificationQueue* queue, Notification* notification) : OverlayText(NULL)
+    {
+        this->initialize();
+
+        if(notification == NULL || queue == NULL) //!> If either notification or queue are not given an Exception is thrown.
+        {
+            ThrowException(Argument, "There were NULL-Pointer arguments in NotificationOverlay creation.");
+        }
+
+        this->queue_ = queue;
+        this->defineOverlay();
+
+        this->processNotification(notification);
+    }
+
+    /**
+    @brief
+        Initializes and Registers the object.
+    */
+    void NotificationOverlay::initialize(void)
+    {
+        this->queue_ = NULL;
+    }
+
+    /**
+    @brief
+        Set some Overlay-specific values.
+    */
+    void NotificationOverlay::defineOverlay(void)
+    {
+        this->setFont(this->queue_->getFont());
+        this->setTextSize(this->queue_->getFontSize());
+
+        this->setPosition(this->queue_->getPosition());
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    NotificationOverlay::~NotificationOverlay()
+    {
+    }
+
+    /**
+    @brief
+        Processes the input notification, resp. sees to it. that the NotificationOverlay displays the Notification message.
+    @param notification
+        A pointer to the notification that should be processed.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationOverlay::processNotification(Notification* notification)
+    {
+        if(notification == NULL)
+            return false;
+        this->setCaption(clipMessage(notification->getMessage()));
+        this->notification_ = notification;
+        return true;
+    }
+
+    /**
+    @brief
+        Clips the input message so that it meets the requirements for the maximal length of Notifications given by the NotificationQueue.
+    */
+    std::string NotificationOverlay::clipMessage(const std::string & message)
+    {
+        if(message.length() <= static_cast<unsigned int>(this->queue_->getNotificationLength())) //!< If the message is not too long.
+            return message;
+        return message.substr(0, this->queue_->getNotificationLength());
+    }
+
+}
Index: code/trunk/src/modules/notifications/NotificationOverlay.h
===================================================================
--- code/trunk/src/modules/notifications/NotificationOverlay.h	(revision 7164)
+++ code/trunk/src/modules/notifications/NotificationOverlay.h	(revision 7164)
@@ -0,0 +1,83 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of the NotificationOverlay class.
+*/
+
+
+#ifndef _NotificationOverlay_H__
+#define _NotificationOverlay_H__
+
+#include "notifications/NotificationsPrereqs.h"
+
+#include <string>
+#include "overlays/OverlayText.h"
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        The NotificationOverlay is used to display single Notifications, then bundled in a NotificationQueue.
+    @author
+        Damian 'Mozork' Frick
+    */
+    class _NotificationsExport NotificationOverlay : public OverlayText
+    {
+
+        public:
+            NotificationOverlay(BaseObject* creator);
+            NotificationOverlay(NotificationQueue* queue, Notification* notification);
+            virtual ~NotificationOverlay();
+
+            bool processNotification(Notification* notification); //!< Processes the input Notification.
+
+            /**
+            @brief Sets the font size of this overlay's text.
+            @param size The font size.
+            */
+            inline void setFontSize(float size)
+                { this->setTextSize(size); }
+
+        protected:
+            std::string clipMessage(const std::string & message); //!< Clips the input message if too long.
+
+        private:
+            NotificationQueue* queue_; //!< The NotificationQeue this overlay belongs to.
+            Notification* notification_; //!< The Notification this overlay displays.
+
+            void initialize(void); //!< Initializes the object.
+            void defineOverlay(void); //!< Sets some overlay-specific values.
+
+    };
+
+}
+
+#endif /* _NotificationOverlay_H__ */
Index: code/trunk/src/modules/notifications/NotificationQueue.cc
===================================================================
--- code/trunk/src/modules/notifications/NotificationQueue.cc	(revision 7164)
+++ code/trunk/src/modules/notifications/NotificationQueue.cc	(revision 7164)
@@ -0,0 +1,455 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of the NotificationQueue class.
+*/
+
+#include "NotificationQueue.h"
+
+#include "util/Convert.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "NotificationOverlay.h"
+#include "NotificationManager.h"
+
+namespace orxonox
+{
+
+    CreateFactory(NotificationQueue);
+
+    const std::string NotificationQueue::DEFAULT_FONT("VeraMono");
+    const Vector2 NotificationQueue::DEFAULT_POSITION(0.0,0.0);
+    const float NotificationQueue::DEFAULT_FONT_SIZE = 0.025f;
+
+    /**
+    @brief
+        Constructor. Creates and initializes the object.
+    */
+    NotificationQueue::NotificationQueue(BaseObject* creator) : OverlayGroup(creator)
+    {
+        this->registered_ = false;
+
+        RegisterObject(NotificationQueue);
+        this->initialize();
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    NotificationQueue::~NotificationQueue()
+    {
+        this->targets_.clear();
+        this->clear();
+
+        if(this->registered_)
+            NotificationManager::getInstance().unregisterListener(this);
+    }
+
+    /**
+    @brief
+        Initializes the object.
+        Registers the object, initializes variables, sets default values and registers the queue with the NotificationManager.
+    */
+    void NotificationQueue::initialize(void)
+    {
+        this->size_ = 0;
+        this->tickTime_ = 0.0;
+
+        NotificationManager::getInstance().registerListener(this);
+        this->registered_ = true;
+    }
+
+    /**
+    @brief
+        Sets the defaults.
+    */
+    void NotificationQueue::setDefaults(void)
+    {
+        this->setMaxSize(DEFAULT_SIZE);
+        this->setNotificationLength(DEFAULT_LENGTH);
+        this->setDisplayTime(DEFAULT_DISPLAY_TIME);
+        this->setPosition(DEFAULT_POSITION);
+
+        this->setTargets(NotificationManager::ALL);
+
+        this->setFontSize(DEFAULT_FONT_SIZE);
+        this->setFont(DEFAULT_FONT);
+    }
+
+    /**
+    @brief
+        Method for creating a NotificationQueue object through XML.
+    */
+    void NotificationQueue::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        SUPER(NotificationQueue, XMLPort, xmlElement, mode);
+
+        this->setDefaults();
+
+        XMLPortParam(NotificationQueue, "maxSize", setMaxSize, getMaxSize, xmlElement, mode);
+        XMLPortParam(NotificationQueue, "notificationLength", setNotificationLength, getNotificationLength, xmlElement, mode);
+        XMLPortParam(NotificationQueue, "displayTime", setDisplayTime, getDisplayTime, xmlElement, mode);
+        XMLPortParam(NotificationQueue, "targets", setTargets, getTargets, xmlElement, mode);
+        XMLPortParam(NotificationQueue, "font", setFont, getFont, xmlElement, mode);
+        XMLPortParam(NotificationQueue, "fontSize", setFontSize, getFontSize, xmlElement, mode);
+        XMLPortParam(NotificationQueue, "position", setPosition, getPosition, xmlElement, mode);
+
+        COUT(3) << "NotificationQueue '" << this->getName() << "' created." << std::endl;
+    }
+
+    /**
+    @brief
+        Updates the queue from time to time.
+    @param dt
+        The time interval that has passed since the last tick.
+    */
+    void NotificationQueue::tick(float dt)
+    {
+        this->tickTime_ += dt; //!< Add the time interval that has passed to the time counter.
+        if(this->tickTime_ >= 1.0) //!< If the time counter is greater than 1s all Notifications that have expired are removed, if it is smaller we wait to the next tick.
+        {
+            this->timeLimit_.time = std::time(0)-this->displayTime_; //!< Container containig the current time.
+
+            std::multiset<NotificationOverlayContainer*, NotificationOverlayContainerCompare>::iterator it;
+            it = this->containers_.begin();
+            while(it != this->containers_.upper_bound(&this->timeLimit_)) //!< Iterate through all elements whose creation time is smaller than the current time minus the display time.
+            {
+                this->removeContainer(*it);
+                this->scroll(Vector2(0.0f,-(1.1f*this->getFontSize())));
+                it = this->containers_.begin(); //TODO: Needed?
+            }
+
+            this->tickTime_ = 0.0f; //!< Reset time counter.
+        }
+    }
+
+    /**
+    @brief
+        Updates the NotificationQueue.
+        Updates by clearing the queue and requesting all relevant Notifications from the NotificationManager and inserting the in the queue.
+    */
+    void NotificationQueue::update(void)
+    {
+        this->clear();
+
+        std::multimap<std::time_t,Notification*>* notifications = new std::multimap<std::time_t,Notification*>;
+        if(!NotificationManager::getInstance().getNotifications(this, notifications, this->displayTime_)) //!< Get the Notifications sent in the interval form now to minus the display time.
+        {
+            COUT(1) << "NotificationQueue update failed due to undetermined cause." << std::endl;
+            return;
+        }
+
+        if(notifications->empty())
+            return;
+
+        for(std::multimap<std::time_t,Notification*>::iterator it = notifications->begin(); it != notifications->end(); it++) //!> Add all Notifications.
+        {
+            this->addNotification(it->second, it->first);
+        }
+
+        delete notifications;
+
+        COUT(4) << "NotificationQueue '" << this->getName() << "' updated." << std::endl;
+    }
+
+    /**
+    @brief
+        Updates the NotificationQueue by adding an new Notification.
+    @param notification
+        Pointer to the Notification.
+    @param time
+        The time the Notification was sent.
+    */
+    void NotificationQueue::update(Notification* notification, const std::time_t & time)
+    {
+        this->addNotification(notification, time);
+
+        std::multiset<NotificationOverlayContainer*, NotificationOverlayContainerCompare>::iterator it;
+        while(this->getSize() > this->getMaxSize())
+        {
+            it = this->containers_.begin();
+            this->removeContainer(*it);
+            this->scroll(Vector2(0.0f,-(1.1f*this->getFontSize())));
+        }
+
+        COUT(4) << "NotificationQueue '" << this->getName() << "' updated. A new Notifications has been added." << std::endl;
+    }
+
+    /**
+    @brief
+        Sets the maximum number of displayed Notifications.
+    @param size
+        The size to be set.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationQueue::setMaxSize(int size)
+    {
+        if(size < 0)
+            return false;
+        this->maxSize_ = size;
+        this->update();
+        return true;
+    }
+
+    /**
+    @brief
+        Sets the maximum number of characters a Notification message displayed by this queue is allowed to have.
+    @param length
+        The length to be set.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationQueue::setNotificationLength(int length)
+    {
+        if(length < 0)
+            return false;
+        this->notificationLength_ = length;
+        this->update();
+        return true;
+    }
+
+    /**
+    @brief
+        Sets the maximum number of seconds a Notification is displayed.
+    @param time
+        The number of seconds the Notifications is displayed.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationQueue::setDisplayTime(int time)
+    {
+        if(time < 0)
+            return false;
+        this->displayTime_ = time;
+        this->update();
+        return true;
+    }
+
+    /**
+    @brief
+        Produces all targets concatinated as string, with kommas (',') as seperators.
+    @param string
+        Pointer to a string which will be used by the method to fill with the concatination of the targets.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationQueue::getTargets(std::string* string) const
+    {
+        if(string == NULL)
+        {
+            COUT(4) << "Input string must have memory allocated." << std::endl;
+            return false;
+        }
+        string->clear();
+        bool first = true;
+        for(std::set<std::string>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); it++) //!< Iterate through the set of targets.
+        {
+            if(!first)
+            {
+                *string += ',';
+            }
+            else
+            {
+                first = false;
+            }
+            *string += *it;
+        }
+
+        return true;
+    }
+
+    /**
+    @brief
+        Sets the targets of the queue.
+        The targets are the senders whose Notifications are displayed in this queue.
+    @param targets
+        Accepts a string of targets, each seperated by commas (','), spaces are ignored.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationQueue::setTargets(const std::string & targets)
+    {
+        this->targets_.clear();
+
+        std::string* pTemp;
+        unsigned int index = 0;
+        while( index < targets.size() ) //!< Go through the string, character by character until the end is reached.
+        {
+            pTemp = new std::string();
+            while(index < targets.size() && targets[index] != ',' && targets[index] != ' ')
+            {
+                *pTemp += targets[index];
+                index++;
+            }
+            index++;
+            this->targets_.insert(*pTemp);
+        }
+
+        return true;
+    }
+
+    /**
+    @brief
+        Sets the font size.
+    @param size
+        The font size.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationQueue::setFontSize(float size)
+    {
+        if(size <= 0)
+            return false;
+        this->fontSize_ = size;
+        for (std::map<Notification*, NotificationOverlayContainer*>::iterator it = this->overlays_.begin(); it != this->overlays_.end(); it++) //!< Set the font size for each overlay.
+        {
+            it->second->overlay->setFontSize(size);
+        }
+        return true;
+    }
+
+    /**
+    @brief
+        Sets the font.
+    @param font
+        The font.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationQueue::setFont(const std::string & font)
+    {
+        this->font_ = font;
+        for (std::map<Notification*, NotificationOverlayContainer*>::iterator it = this->overlays_.begin(); it != this->overlays_.end(); it++) //!< Set the font for each overlay.
+        {
+            it->second->overlay->setFont(font);
+        }
+        return true;
+    }
+
+    /**
+    @brief
+        Scrolls the NotificationQueue, meaning all NotificationOverlays are moved the input vector.
+    @param pos
+        The vector the NotificationQueue is scrolled.
+    */
+    void NotificationQueue::scroll(const Vector2 pos)
+    {
+        for (std::map<Notification*, NotificationOverlayContainer*>::iterator it = this->overlays_.begin(); it != this->overlays_.end(); ++it) //!< Scroll each overlay.
+        {
+            it->second->overlay->scroll(pos);
+        }
+    }
+
+    /**
+    @brief
+        Aligns all the Notifications to the position of the NotificationQueue.
+    */
+    void NotificationQueue::positionChanged(void)
+    {
+        int counter = 0;
+        for (std::multiset<NotificationOverlayContainer*, NotificationOverlayContainerCompare>::iterator it = this->containers_.begin(); it != this->containers_.end(); it++) //!< Set the position for each overlay.
+        {
+            (*it)->overlay->setPosition(this->getPosition());
+            (*it)->overlay->scroll(Vector2(0.0f,(1.1f*this->getFontSize())*counter));
+            counter++;
+        }
+    }
+
+    /**
+    @brief
+        Adds a Notification, to the queue.
+        It inserts it into the storage containers, creates an corresponding overlay and a container.
+    @param notification
+        The Notification.
+    @param time
+        The time.
+    */
+    void NotificationQueue::addNotification(Notification* notification, const std::time_t & time)
+    {
+        NotificationOverlayContainer* container = new NotificationOverlayContainer;
+        container->overlay = new NotificationOverlay(this, notification);
+        container->notification = notification;
+        container->time = time;
+        std::string timeString = std::ctime(&time);
+        timeString.erase(timeString.length()-1);
+        const std::string& addressString = multi_cast<std::string>(reinterpret_cast<unsigned long>(notification));
+        container->name = "NotificationOverlay(" + timeString + ")&" + addressString;
+
+        this->containers_.insert(container);
+        this->overlays_[notification] = container;
+        this->addElement(container->overlay);
+        this->size_= this->size_+1;
+
+        container->overlay->scroll(Vector2(0.0f,(1.1f*this->getFontSize())*(this->getSize()-1)));
+    }
+
+    /**
+    @brief
+        Removes a container from the queue.
+    @param container
+        A pointer to the container.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationQueue::removeContainer(NotificationOverlayContainer* container)
+    {
+        if(this->size_ == 0) //!< You cannot remove anything if the queue is empty.
+            return false;
+
+        // Unregister the NotificationQueue with the NotificationManager.
+        NotificationManager::getInstance().unregisterNotification(container->notification, this);
+
+        this->removeElement(container->overlay);
+        this->containers_.erase(container);
+        this->overlays_.erase(container->notification);
+        container->overlay->destroy();
+        delete container;
+        this->size_= this->size_-1;
+
+        return true;
+    }
+
+    /**
+    @brief
+        Clears the queue by removing all containers.
+    */
+    void NotificationQueue::clear(void)
+    {
+        std::multiset<NotificationOverlayContainer*, NotificationOverlayContainerCompare>::iterator it = this->containers_.begin();
+        while(it != this->containers_.end())
+        {
+            this->removeContainer(*it);
+            it = this->containers_.begin();
+        }
+    }
+
+}
Index: code/trunk/src/modules/notifications/NotificationQueue.h
===================================================================
--- code/trunk/src/modules/notifications/NotificationQueue.h	(revision 7164)
+++ code/trunk/src/modules/notifications/NotificationQueue.h	(revision 7164)
@@ -0,0 +1,213 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of the NotificationQueue class.
+*/
+
+#ifndef _NotificationOueue_H__
+#define _NotificationOueue_H__
+
+#include "notifications/NotificationsPrereqs.h"
+
+#include <ctime>
+#include <map>
+#include <set>
+#include <string>
+
+#include "util/Math.h"
+#include "tools/interfaces/Tickable.h"
+#include "overlays/OverlayGroup.h"
+#include "interfaces/NotificationListener.h"
+
+namespace orxonox
+{
+
+    //! Container to allow easy handling.
+    struct NotificationOverlayContainer
+    {
+        NotificationOverlay* overlay; //!< Pointer to the NotificationOverlay, everything is about.
+        Notification* notification; //!< The Notification displayed by the overlay.
+        time_t time; //!< The time the Notification was sent and thus first displayed.
+        std::string name; //!< The name of the overlay.
+    };
+
+    //! Struct to allow ordering of NotificationOverlayContainers.
+    struct NotificationOverlayContainerCompare {
+        bool operator() (const NotificationOverlayContainer* const & a, const NotificationOverlayContainer* const & b) const
+            { return a->time < b->time; } //!< Ordered by time.
+    };
+
+    /**
+    @brief
+        Displays Notifications from specific senders.
+        Beware! The NotificationQueue is an OverlayGruop and thus cannot be be a sub-element of an OverlayGroup (at least no for now.)
+
+        Creating a NotificationQueue through XML goes as follows:
+        Be aware that the NotificationQueue must be inside the <Level></Level> tags or bad things will happen.
+        <NotificationQueue
+            name = "SuperQueue" //Name of your OverlayQueue.
+            maxSize = "5" //The maximum number of Notifications displayed. (Default is 5)
+            notificationLength = "64" //The maximum number of characters of a Notification, that are displayed. (Default is 64)
+            displayTime = "30" //The time a Notification is displayed in seconds. (Default is 30)
+            targets = "target1, target2" //The senders this NotificationQueue displays Notifications from. (all, if all Notifications should be displayed.)
+            font = "VeraMono" //The font (Default is VeraMono)
+            fontSize = '0.4' //The font size. (Default is 0.025)
+            position = "0.0, 0.0" //The position of the NotificationQueue. (Default is 0.0,0.0)
+        />
+    @author
+        Damian 'Mozork' Frick
+    */
+
+    class _NotificationsExport NotificationQueue : public OverlayGroup, public Tickable, public NotificationListener
+    {
+
+        public:
+            NotificationQueue(BaseObject* creator);
+            virtual ~NotificationQueue();
+
+            virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); //!< Method for creating a NotificationQueue object through XML.
+
+            virtual void tick(float dt); //!< To update from time to time.
+
+            void update(void); //!< Updates the queue.
+            void update(Notification* notification, const std::time_t & time); //!< Adds a Notification to the queue.
+
+            /**
+            @brief Returns the maximum number of Notifications displayed.
+            @return Returns maximum size.
+            */
+            inline int getMaxSize() const
+                { return this->maxSize_; }
+            /**
+            @brief Returns the current number of Notifications displayed.
+            @return Returns the size of the queue.
+            */
+            inline int getSize() const
+                { return this->size_; }
+            /**
+            @brief Returns the maximum length in characters a Notification message is allowed to have.
+            @return Returns the maximum Notification length.
+            */
+            inline int getNotificationLength() const
+                { return this->notificationLength_; }
+            /**
+            @brief Returns the time interval the Notification is displayed.
+            @return Returns the display time.
+            */
+            inline int getDisplayTime() const
+                { return this->displayTime_; }
+            /**
+            @brief Returns the position of the NotificationQueue.
+            @return Returns the position.
+            */
+            inline const Vector2 & getPosition() const
+                { return this->position_; }
+            /**
+            @brief Returns the font size used to display the Notifications.
+            @return  Returns the font size.
+            */
+            inline float getFontSize() const
+                { return this->fontSize_; }
+            /**
+            @brief Returns the font used to display the Notifications.
+            @return Returns the font.
+            */
+            inline const std::string & getFont() const
+                { return this->font_; }
+
+            /**
+            @brief Returns the targets of this queue, reps. the senders which Notifications are displayed in this queue.
+            @return Retuns a set of string holding the different targets.
+            */
+            inline const std::set<std::string> & getTargetsSet()
+                { return this->targets_; }
+            bool getTargets(std::string* string) const; //!< Returns a string consisting of the concatination of the targets.
+
+            /**
+            @brief Sets the position of the NotificationQueue.
+            @param pos The position.
+            */
+            inline void setPosition(Vector2 pos)
+                { this->position_ = pos; this->positionChanged(); }
+
+            void scroll(const Vector2 pos); //!< Scrolls the NotificationQueue, meaning all NotificationOverlays are moved the input vector.
+
+        private:
+            static const int DEFAULT_SIZE = 5; //!< The default maximum number of Notifications displayed.
+            static const int DEFAULT_LENGTH = 64; //!< The default maximum number of characters displayed.
+            static const int DEFAULT_DISPLAY_TIME = 30; //!< The default display time.
+            static const float DEFAULT_FONT_SIZE; //!< The default font size.
+
+            static const std::string DEFAULT_FONT; //!< The default font.
+            static const Vector2 DEFAULT_POSITION; //!< the default position.
+
+            int maxSize_; //!< The maximal number of Notifications displayed.
+            int size_; //!< The number of Notifications displayed.
+            int notificationLength_; //!< The maximal number of characters a Notification-message is allowed to have.
+            int displayTime_; //!< The time a Notification is displayed.
+            Vector2 position_; //!< The position of the NotificationQueue.
+
+            std::set<std::string> targets_; //!< The targets the Queue displays Notifications of.
+
+            float fontSize_; //!< The font size.
+            std::string font_; //!< The font.
+
+            std::multiset<NotificationOverlayContainer*, NotificationOverlayContainerCompare> containers_; //!< Multiset, because the ordering is based on, not necessarily unique, timestamps.
+            std::map<Notification*, NotificationOverlayContainer*> overlays_; //!< Mapping notifications to their corresponding overlay containers, for easier association and finding.
+
+            float tickTime_; //!< Helper variable, to not have to check for overlays that have been displayed too long, every tick.
+            NotificationOverlayContainer timeLimit_; //!< Helper object to check against to determine whether Notifications have expired.
+
+            bool registered_; //!< Helper variable to remember whether the NotificationQueue is registered already.
+
+            void initialize(void); //!< Initializes the object.
+            void setDefaults(void); //!< Helper method to set the default values.
+
+            bool setMaxSize(int size); //!< Sets the maximum number of displayed Notifications.
+            bool setNotificationLength(int length); //!< Sets the maximum number of characters a Notification message displayed by this queue is allowed to have.
+            bool setDisplayTime(int time); //!< Sets the maximum number of seconds a Notification is displayed.
+
+            bool setTargets(const std::string & targets); //!< Set the targets of this queue.
+
+            bool setFontSize(float size); //!< Set the font size.
+            bool setFont(const std::string & font); //!< Set the font.
+
+            void positionChanged(void); //!< Aligns all the Notifications to the position of the NotificationQueue.
+
+            void addNotification(Notification* notification, const std::time_t & time); //!< Add a notification to the queue.
+            bool removeContainer(NotificationOverlayContainer* container); //!< Remove a container from the queue.
+
+            void clear(void); //!< Clear the queue.
+
+    };
+
+}
+
+#endif /* _NotificationOverlay_H__ */
Index: code/trunk/src/modules/notifications/NotificationsPrereqs.h
===================================================================
--- code/trunk/src/modules/notifications/NotificationsPrereqs.h	(revision 7164)
+++ code/trunk/src/modules/notifications/NotificationsPrereqs.h	(revision 7164)
@@ -0,0 +1,73 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief
+    Shared library macros, enums, constants and forward declarations for the questsystem module
+*/
+
+#ifndef _NotificationsPrereqs_H__
+#define _NotificationsPrereqs_H__
+
+#include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(NOTIFICATIONS_STATIC_BUILD)
+#  ifdef NOTIFICATIONS_SHARED_BUILD
+#    define _NotificationsExport __declspec(dllexport)
+#  else
+#    if defined( __MINGW32__ )
+#      define _NotificationsExport
+#    else
+#      define _NotificationsExport __declspec(dllimport)
+#    endif
+#  endif
+#elif defined ( ORXONOX_GCC_VISIBILITY )
+#  define _NotificationsExport  __attribute__ ((visibility("default")))
+#else
+#  define _NotificationsExport
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+    class Notification;
+    class NotificationManager;
+    class NotificationOverlay;
+    class NotificationQueue;
+}
+
+#endif /* _NotificationsPrereqs_H__ */
Index: code/trunk/src/modules/questsystem/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/questsystem/CMakeLists.txt	(revision 7163)
+++ code/trunk/src/modules/questsystem/CMakeLists.txt	(revision 7164)
@@ -19,6 +19,4 @@
 )
 
-ADD_SUBDIRECTORY(notifications)
-
 ORXONOX_ADD_LIBRARY(questsystem
   MODULE
@@ -33,6 +31,6 @@
   LINK_LIBRARIES
     orxonox
+    notifications
     objects
-    overlays
   SOURCE_FILES ${QUESTSYSTEM_SRC_FILES}
 )
Index: code/trunk/src/modules/questsystem/QuestsystemPrereqs.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestsystemPrereqs.h	(revision 7163)
+++ code/trunk/src/modules/questsystem/QuestsystemPrereqs.h	(revision 7164)
@@ -82,10 +82,4 @@
     class QuestManager;
     class QuestNotification;
-
-    // notifications
-    class Notification;
-    class NotificationManager;
-    class NotificationOverlay;
-    class NotificationQueue;
 }
 
