- Timestamp:
- May 12, 2011, 12:31:23 AM (13 years ago)
- Location:
- code/branches/tutoriallevel3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tutoriallevel3
- Property svn:mergeinfo changed
/code/branches/tutoriallevel (added) merged: 7828-7831,7894,8370 /code/branches/tutoriallevel2 (added) merged: 8371,8374,8376-8378,8444-8451
- Property svn:mergeinfo changed
-
code/branches/tutoriallevel3/src/modules/notifications/NotificationQueue.h
r7552 r8453 46 46 47 47 #include "tools/interfaces/Tickable.h" 48 #include "interfaces/NotificationListener.h"49 48 50 namespace orxonox // tolua_export51 { // tolua_export49 namespace orxonox 50 { 52 51 53 52 /** … … 78 77 Displays @ref orxonox::Notification "Notifications" from specific senders. 79 78 80 There are quite some parameters that influence the behavio ur of the NotificationQueue:79 There are quite some parameters that influence the behavior of the NotificationQueue: 81 80 - @b name The name of the NotificationQueue. It needs to be unique. 82 81 - @b senders The senders that are targets of this NotificationQueue, i.e. the names of senders whose Notifications this NotificationQueue displays. … … 89 88 @ingroup Notifications 90 89 */ 91 class _NotificationsExport NotificationQueue // tolua_export 92 : public Tickable, public NotificationListener 93 { // tolua_export 90 class _NotificationsExport NotificationQueue : public Tickable 91 { 94 92 95 93 public: 96 NotificationQueue(const std::string& name, const std::string& senders = Notification Manager::ALL, unsigned int size = NotificationQueue::DEFAULT_SIZE, unsigned int displayTime = NotificationQueue::DEFAULT_DISPLAY_TIME);94 NotificationQueue(const std::string& name, const std::string& senders = NotificationListener::ALL, unsigned int size = NotificationQueue::DEFAULT_SIZE, unsigned int displayTime = NotificationQueue::DEFAULT_DISPLAY_TIME); 97 95 virtual ~NotificationQueue(); 98 99 //! Destroys the NotificationQueue.100 void destroy(bool noGraphics = false); // tolua_export101 96 102 97 virtual void tick(float dt); //!< To update from time to time. … … 121 116 { return this->maxSize_; } 122 117 123 void setDisplayTime( unsignedint time); //!< Sets the maximum number of seconds a Notification is displayed.118 void setDisplayTime(int time); //!< Sets the maximum number of seconds a Notification is displayed. 124 119 /** 125 120 @brief Returns the time interval the Notification is displayed. 126 121 @return Returns the display time. 127 122 */ 128 inline unsignedint getDisplayTime() const123 inline int getDisplayTime() const 129 124 { return this->displayTime_; } 130 125 // tolua_end … … 144 139 { return this->targets_; } 145 140 146 // tolua_begin147 141 void setTargets(const std::string & targets); //!< Set the targets of this NotificationQueue. 148 const std::string& getTargets(void) const; //!< Returns a string consisting of the concatination of the targets. 149 // tolua_end 142 const std::string& getTargets(void) const; //!< Returns a string consisting of the concatenation of the targets. 143 144 bool tidy(void); // Pops all Notifications from the NotificationQueue. 145 146 protected: 147 /** 148 @brief Is called when a notification was pushed. 149 @param notification The Notification that was pushed. 150 */ 151 virtual void notificationPushed(Notification* notification) {} 152 /** 153 @brief Is called when a notification was popped. 154 */ 155 virtual void notificationPopped(void) {} 156 /** 157 @brief Is called when a notification was removed. 158 @param index The index the removed notification was at. 159 */ 160 virtual void notificationRemoved(unsigned int index) {} 161 162 virtual void clear(bool noGraphics = false); //!< Clears the NotificationQueue by removing all NotificationContainers. 163 164 protected: 165 static const unsigned int DEFAULT_SIZE = 5; //!< The default maximum number of Notifications displayed. 166 static const unsigned int DEFAULT_DISPLAY_TIME = 30; //!< The default display time. 167 static const int INF = -1; //!< Constant denoting infinity. 150 168 151 169 private: 152 static const unsigned int DEFAULT_SIZE = 5; //!< The default maximum number of Notifications displayed.153 static const unsigned int DEFAULT_DISPLAY_TIME = 30; //!< The default display time.154 155 170 std::string name_; //!< The name of the NotificationQueue. 156 171 157 172 unsigned int maxSize_; //!< The maximal number of Notifications displayed. 158 173 unsigned int size_; //!< The number of Notifications displayed. 159 unsignedint displayTime_; //!< The time a Notification is displayed.174 int displayTime_; //!< The time a Notification is displayed. 160 175 161 176 bool registered_; //!< Helper variable to remember whether the NotificationQueue is registered already. … … 169 184 NotificationContainer timeLimit_; //!< Helper object to check against to determine whether Notifications have expired. 170 185 171 void create(void); //!< Creates the NotificationQueue in lua.172 173 186 void setName(const std::string& name); //!< Sets the name of the NotificationQueue. 174 187 … … 177 190 void remove(const std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator& containerIterator); //!< Removes the Notification that is stored in the input NotificationContainer. 178 191 179 void clear(bool noGraphics = false); //!< Clears the NotificationQueue by removing all NotificationContainers.192 }; 180 193 181 }; // tolua_export 194 } 182 195 183 } // tolua_export 184 185 #endif /* _NotificationOverlay_H__ */ 196 #endif /* _NotificationQueue_H__ */
Note: See TracChangeset
for help on using the changeset viewer.