- Timestamp:
- Apr 8, 2009, 1:07:27 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/overlays/notifications/Notification.h
r2662 r2909 27 27 */ 28 28 29 /** 30 @file Notification.h 31 @brief Definition of the Notification class. 32 */ 33 29 34 #ifndef _Notification_H__ 30 35 #define _Notification_H__ … … 38 43 namespace orxonox 39 44 { 40 static const float NOTIFICATION_DISPLAY_TIME = 4.0;41 45 42 46 /** 43 47 @brief 44 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.48 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). 45 49 @author 46 50 Damian 'Mozork' Frick … … 48 52 class _OrxonoxExport Notification : public BaseObject 49 53 { 50 public: 51 Notification(BaseObject* creator); 52 Notification(BaseObject* creator, const std::string & message, const std::string & title = "", float time = NOTIFICATION_DISPLAY_TIME); 53 virtual ~Notification(); 54 55 bool send(void); 56 57 inline bool isSent(void) const 58 { return this->sent_; } 59 inline const std::string & getTitle(void) const 60 { return this->title_; } 61 inline const std::string & getMessage(void) const 62 { return this->message_; } 63 inline const float getDisplayTime(void) const 64 { return displayTime_; } 65 66 bool setTitle(const std::string & title); 67 bool setMessage(const std::string & message); 68 bool setDisplayTime(float time); 69 70 private: 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); 54 public: 55 Notification(BaseObject* creator); 56 Notification(const std::string & message); 57 virtual ~Notification(); 58 59 bool send(void); //!< Sends the Notification to the Notificationmanager, with sender NotificationManager::NONE; 60 bool send(const std::string & sender); //!< Sends the Notification to the Notificationmanager. 61 62 /** 63 @brief Checks whether the Notification was sent. 64 @return Returns true if the Notification was sent already. 65 */ 66 inline bool isSent(void) const 67 { return this->sent_; } 68 /** 69 @brief Returns the message of the Notification. 70 @return Returns the message of the Notification. 71 */ 72 inline const std::string & getMessage(void) const 73 { return this->message_; } 74 75 inline const std::string & getSender(void) const 76 { return this->sender_; } 77 78 bool setMessage(const std::string & message); //!< Sets the message of the notification. 79 80 private: 81 std::string message_; //!< The Notification message. 82 std::string sender_; //!< The sender of the notification. 83 bool sent_; //!< Whether Notification has been sent, if so it cannot be changed. 84 85 void initialize(void); 86 77 87 }; 88 78 89 } 79 90
Note: See TracChangeset
for help on using the changeset viewer.