Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/questsystem3/src/orxonox/overlays/notifications/Notification.h @ 2560

Last change on this file since 2560 was 2383, checked in by dafrick, 16 years ago

Some verry small changes…

File size: 2.5 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Damian 'Mozork' Frick
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _Notification_H__
30#define _Notification_H__
31
32#include "OrxonoxPrereqs.h"
33
34#include <string>
35
36#include "core/BaseObject.h"
37
38namespace orxonox {
39
40    /**
41    @brief
42        This is rather temporary, so don't start relying on it, some better version will come soon but the Interface will not likely be the same.
43    @author
44        Damian 'Mozork' Frick
45    */
46    class _OrxonoxExport Notification : public BaseObject
47    {
48        public:
49            Notification(BaseObject* creator);
50            Notification(const std::string & message, const std::string & title = "", float time = DISPLAY_TIME);
51            virtual ~Notification();
52           
53            bool send(void);
54           
55            inline bool isSent(void) const
56                { return this->sent_; }
57            inline const std::string & getTitle(void) const
58                { return this->title_; }
59            inline const std::string & getMessage(void) const
60                { return this->message_; }
61            inline const float getDisplayTime(void) const
62                { return displayTime_; }
63           
64            bool setTitle(const std::string & title);
65            bool setMessage(const std::string & message);
66            bool setDisplayTime(float time);
67           
68        private:
69            static const float DISPLAY_TIME = 4.0;
70       
71            std::string title_; //!< The title of the Notification.
72            std::string message_; //!< The Notification message.
73            float displayTime_; //!< The time duration the Notification is displayed in seconds.
74            bool sent_; //!< Whether Notification has been sent, if so it cannot be changed.
75           
76            void initialize(void);
77       
78    };
79
80}
81
82#endif /* _Notification_H__ */
Note: See TracBrowser for help on using the repository browser.