1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
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"
30 class CInterfaceGroup
;
37 /** Class to get chat text parameters, and to build new text lines
38 * \author Nicolas Vizerie
39 * \author Nevrax France
42 class CChatTextManager
45 //\name Text parameters. They are read from the interface database (the configuration of text is doned in config.xml)
47 uint
getTextFontSize() const;
48 uint
getTextMultiLineSpace() const;
49 bool isTextShadowed() const;
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);
59 static CChatTextManager
&getInstance();
62 static void releaseInstance();
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
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(); }