Fix css style order when using external css files
[ryzomcore.git] / ryzom / client / src / interface_v3 / chat_text_manager.h
blob2cc71dd0ef29f99439d87e574df0993156980dc5
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #ifndef CHAT_TEXT_MANAGER_H
23 #define CHAT_TEXT_MANAGER_H
25 #include "nel/misc/rgba.h"
27 namespace NLGUI
29 class CViewBase;
30 class CInterfaceGroup;
33 namespace NLMISC{
34 class CCDBNodeLeaf;
37 /** Class to get chat text parameters, and to build new text lines
38 * \author Nicolas Vizerie
39 * \author Nevrax France
40 * \date 2003
42 class CChatTextManager
44 public:
45 //\name Text parameters. They are read from the interface database (the configuration of text is doned in config.xml)
46 //@{
47 uint getTextFontSize() const;
48 uint getTextMultiLineSpace() const;
49 bool isTextShadowed() const;
50 //@}
51 /** Build a new text multiline using the current chat text settings
52 * \param msg the actual text
53 * \param col the color of the text
54 * \param justified Should be true for justified text (stretch spaces of line to fill the full width)
55 * \param plaintext Text will not be parsed for uri markup links
57 NLGUI::CViewBase *createMsgText(const std::string &msg, NLMISC::CRGBA col, bool justified = false, bool plaintext = false);
58 // Singleton access
59 static CChatTextManager &getInstance();
61 // release memory
62 static void releaseInstance();
64 // Reset the manager
65 void reset();
67 private:
68 static CChatTextManager *_Instance;
70 mutable NLMISC::CCDBNodeLeaf *_TextFontSize;
71 mutable NLMISC::CCDBNodeLeaf *_TextMultilineSpace;
72 mutable NLMISC::CCDBNodeLeaf *_TextShadowed;
73 mutable NLMISC::CCDBNodeLeaf *_ShowTimestamps;
75 // ctor, private because of singleton
76 CChatTextManager();
77 ~CChatTextManager();
79 bool showTimestamps() const;
81 NLGUI::CViewBase *createMsgTextSimple(const std::string &msg, NLMISC::CRGBA col, bool justified, NLGUI::CInterfaceGroup *commandGroup);
82 NLGUI::CViewBase *createMsgTextComplex(const std::string &msg, NLMISC::CRGBA col, bool justified, bool plaintext, NLGUI::CInterfaceGroup *commandGroup);
85 // shortcut to get text manager instance
86 inline CChatTextManager &getChatTextMngr() { return CChatTextManager::getInstance(); }
88 #endif