- Timestamp:
- Apr 8, 2009, 1:36:05 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/overlays/notifications/Notification.h
r2909 r2910 27 27 */ 28 28 29 /**30 @file Notification.h31 @brief Definition of the Notification class.32 */33 34 29 #ifndef _Notification_H__ 35 30 #define _Notification_H__ … … 43 38 namespace orxonox 44 39 { 40 static const float NOTIFICATION_DISPLAY_TIME = 4.0; 45 41 46 42 /** 47 43 @brief 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).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. 49 45 @author 50 46 Damian 'Mozork' Frick … … 52 48 class _OrxonoxExport Notification : public BaseObject 53 49 { 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 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); 87 77 }; 88 89 78 } 90 79
Note: See TracChangeset
for help on using the changeset viewer.