[8446] | 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 | /** |
---|
| 30 | @file NotificationQueueCEGUI.h |
---|
| 31 | @brief Definition of the NotificationQueueCEGUI class. |
---|
| 32 | @ingroup Notifications |
---|
| 33 | */ |
---|
| 34 | |
---|
| 35 | #ifndef _NotificationOueueCEGUI_H__ |
---|
| 36 | #define _NotificationOueueCEGUI_H__ |
---|
| 37 | |
---|
| 38 | #include "notifications/NotificationsPrereqs.h" |
---|
| 39 | |
---|
| 40 | #include <string> |
---|
[8448] | 41 | #include "util/Math.h" |
---|
[8446] | 42 | |
---|
| 43 | #include "NotificationManager.h" |
---|
[8448] | 44 | |
---|
[8446] | 45 | #include "NotificationQueue.h" |
---|
| 46 | |
---|
| 47 | namespace orxonox // tolua_export |
---|
| 48 | { // tolua_export |
---|
| 49 | |
---|
| 50 | /** |
---|
| 51 | @brief |
---|
[8448] | 52 | Displays @ref orxonox::Notification "Notifications" using CEGUI. |
---|
[8446] | 53 | |
---|
[8448] | 54 | Apart form the parameters inherited by the @ref orxonox::NotificationQueue "NotificationQueue", there are some more parameters that influence the behavior of the NotificationQueueCEGUI: |
---|
| 55 | - @b displaySize The size of the window that displays the NotificationQueue. |
---|
| 56 | - @b position The position if the window that displays the NotificationQueue. |
---|
| 57 | - @b alignment The horizontal alignment of the displayed Notifications. |
---|
| 58 | - @b fontSize The font size of the displayed Notifications. |
---|
| 59 | - @b fontColor The font color of the displayed Notifications. |
---|
[8446] | 60 | |
---|
| 61 | @author |
---|
| 62 | Damian 'Mozork' Frick |
---|
| 63 | |
---|
[8448] | 64 | @see NotificationQueue |
---|
[8446] | 65 | @ingroup Notifications |
---|
| 66 | */ |
---|
| 67 | class _NotificationsExport NotificationQueueCEGUI // tolua_export |
---|
| 68 | : public NotificationQueue |
---|
| 69 | { // tolua_export |
---|
| 70 | |
---|
| 71 | public: |
---|
[9667] | 72 | NotificationQueueCEGUI(Context* context); |
---|
[8446] | 73 | virtual ~NotificationQueueCEGUI(); |
---|
| 74 | |
---|
[11071] | 75 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; |
---|
[8636] | 76 | |
---|
[11071] | 77 | virtual void changedName(void) override; |
---|
[8662] | 78 | |
---|
[8448] | 79 | void destroy(bool noGraphics = false); // Destroys the NotificationQueue. |
---|
| 80 | |
---|
| 81 | void setDisplaySize(const Vector4& size); // Set the size of the window that displays the NotificationQueue. |
---|
[8636] | 82 | |
---|
[8448] | 83 | /** |
---|
| 84 | @brief Get the size of the window that displays the NotificationQueue. |
---|
| 85 | @return Returns a vector with the display size. |
---|
| 86 | */ |
---|
| 87 | inline const Vector4& getDisplaySize(void) const |
---|
| 88 | { return this->displaySize_; } |
---|
[8656] | 89 | void displaySizeChanged(void); // Is called when the display size has changed. |
---|
[8448] | 90 | |
---|
| 91 | void setPosition(const Vector4& position); // Set the position of the window that displays the NotificationQueue. |
---|
| 92 | /** |
---|
| 93 | @brief Get the position of the window that displays the NotificationQueue. |
---|
| 94 | @return Returns a vector with the position. |
---|
| 95 | */ |
---|
| 96 | inline const Vector4& getPosition(void) const |
---|
| 97 | { return this->position_; } |
---|
[8656] | 98 | void positionChanged(void); // Is called when the NotificationQueue's position has changed. |
---|
[8448] | 99 | |
---|
| 100 | void setAlignment(const std::string& alignment); // Set the horizontal alignment of the Notifications text. |
---|
| 101 | /** |
---|
| 102 | @brief Get the horizontal alignment of the Notifications text. |
---|
| 103 | @return Returns a string with the horizontal alignment property. |
---|
| 104 | */ |
---|
| 105 | inline const std::string& getAlignment(void) |
---|
| 106 | { return this->alignment_; } |
---|
[8656] | 107 | void alignmentChanged(void); // Is called when the horizontal alignment of the Notifications text has changed. |
---|
[8448] | 108 | |
---|
| 109 | void setFontSize(unsigned int size); // Set the font size of the text displayed by this NotificationQueue. |
---|
| 110 | /** |
---|
| 111 | @brief Get the font size of the text displayed by this NotificationQueue. |
---|
| 112 | @return Returns the font size. |
---|
| 113 | */ |
---|
| 114 | inline unsigned int getFontSize(void) |
---|
| 115 | { return this->fontSize_; } |
---|
[8656] | 116 | void fontSizeChanged(void); // Is called when the font size of the text displayed by this NotificationQueue has changed. |
---|
[8448] | 117 | |
---|
| 118 | void setFontColor(const Vector4& color); // Set the font color if the text displayed by this NotificationQueue. |
---|
| 119 | /** |
---|
| 120 | @brief Get the font color of the text displayed by this NotificationQueue. |
---|
| 121 | @return Returns a vector with the components being RGBA, with values from 0 to 1. |
---|
| 122 | */ |
---|
| 123 | inline const Vector4& getFontColor(void) const |
---|
| 124 | { return this->fontColor_; } |
---|
| 125 | /** |
---|
| 126 | @brief Get the font color of the text displayed by this NotificationQueue. |
---|
| 127 | @return Returns a string with the ARGB values in hexadecimal format. |
---|
| 128 | */ |
---|
| 129 | inline const std::string& getFontColorStr(void) const |
---|
| 130 | { return this->fontColorStr_; } |
---|
[8656] | 131 | void fontColorChanged(void); // Is called when the font color if the text displayed by this NotificationQueue has changed. |
---|
[8448] | 132 | |
---|
[8450] | 133 | static NotificationQueueCEGUI* getQueue(const std::string& name); // tolua_export // Get the NotificationQueueCEGUI with the input name. |
---|
[8446] | 134 | |
---|
| 135 | protected: |
---|
[8662] | 136 | void registerVariables(); |
---|
| 137 | |
---|
[11071] | 138 | virtual void create(void) override; // Creates the NotificationQueue in lua. |
---|
[8636] | 139 | |
---|
[11071] | 140 | virtual void notificationPushed(Notification* notification) override; // Is called by the NotificationQueue when a Notification was pushed |
---|
| 141 | virtual void notificationPopped(void) override; // Is called by the NotificationQueue when a Notification was popped. |
---|
| 142 | virtual void notificationRemoved(unsigned int index) override; // Is called when a Notification was removed. |
---|
[8446] | 143 | |
---|
[11071] | 144 | virtual void clear(bool noGraphics = false) override; // Clears the NotificationQueue by removing all NotificationContainers. |
---|
[8450] | 145 | |
---|
| 146 | protected: |
---|
| 147 | static const std::string NOTIFICATION_LAYER; //!< The name of the NotificationLayer menu sheet. |
---|
[8446] | 148 | |
---|
| 149 | private: |
---|
[8448] | 150 | Vector4 displaySize_; //!< The size of the window that displays the NotificationQueue. |
---|
| 151 | Vector4 position_; //!< The position of the window that displays the NotificationQueue. |
---|
| 152 | std::string alignment_; //!< The horizontal alignment of the Notifications text. |
---|
| 153 | unsigned int fontSize_; //!< The font size of the Notifications text. |
---|
| 154 | Vector4 fontColor_; //!< The font color of the Notifications text as a vector, in RGBA form, with values from 0 to 1. |
---|
| 155 | std::string fontColorStr_; //!< The font color of the Notifications text as a string with the ARGB hexadecimal values. |
---|
[8446] | 156 | |
---|
[8636] | 157 | void initialize(void); // Initializes The NotificationQueueCEGUI. |
---|
| 158 | |
---|
[8446] | 159 | }; // tolua_export |
---|
| 160 | |
---|
| 161 | } // tolua_export |
---|
| 162 | |
---|
| 163 | #endif /* _NotificationQueueCEGUI_H__ */ |
---|