1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010-2017 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>
6 // Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
8 // This program is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU Affero General Public License as
10 // published by the Free Software Foundation, either version 3 of the
11 // License, or (at your option) any later version.
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 Affero General Public License for more details.
18 // You should have received a copy of the GNU Affero General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #ifndef CHAT_TEXT_MANAGER_H
24 #define CHAT_TEXT_MANAGER_H
26 #include "nel/misc/rgba.h"
31 class CInterfaceGroup
;
38 /** Class to get chat text parameters, and to build new text lines
39 * \author Nicolas Vizerie
40 * \author Nevrax France
43 class CChatTextManager
46 //\name Text parameters. They are read from the interface database (the configuration of text is doned in config.xml)
48 uint
getTextFontSize() const;
49 uint
getTextMultiLineSpace() const;
50 bool isTextShadowed() const;
52 /** Build a new text multiline using the current chat text settings
53 * \param msg the actual text
54 * \param col the color of the text
55 * \param justified Should be true for justified text (stretch spaces of line to fill the full width)
56 * \param plaintext Text will not be parsed for uri markup links
58 NLGUI::CViewBase
*createMsgText(const std::string
&msg
, NLMISC::CRGBA col
, bool justified
= false, bool plaintext
= false);
60 static CChatTextManager
&getInstance();
63 static void releaseInstance();
69 static CChatTextManager
*_Instance
;
71 mutable NLMISC::CCDBNodeLeaf
*_TextFontSize
;
72 mutable NLMISC::CCDBNodeLeaf
*_TextMultilineSpace
;
73 mutable NLMISC::CCDBNodeLeaf
*_TextShadowed
;
74 mutable NLMISC::CCDBNodeLeaf
*_ShowTimestamps
;
76 // ctor, private because of singleton
80 bool showTimestamps() const;
82 NLGUI::CViewBase
*createMsgTextSimple(const std::string
&msg
, NLMISC::CRGBA col
, bool justified
, NLGUI::CInterfaceGroup
*commandGroup
);
83 NLGUI::CViewBase
*createMsgTextComplex(const std::string
&msg
, NLMISC::CRGBA col
, bool justified
, bool plaintext
, NLGUI::CInterfaceGroup
*commandGroup
);
86 // shortcut to get text manager instance
87 inline CChatTextManager
&getChatTextMngr() { return CChatTextManager::getInstance(); }