2011-12-13 21:23:17 +00:00
# pragma once
2009-04-16 11:14:13 +00:00
2012-12-19 17:24:53 +00:00
# include "Graphics.h"
2013-04-07 11:52:07 +00:00
# include "gui/Geometries.h"
2011-12-13 21:23:17 +00:00
2009-04-16 11:14:13 +00:00
2009-04-15 14:03:31 +00:00
/*
* CMessage . h , part of VCMI engine
*
* Authors : listed in file AUTHORS in main folder
*
* License : GNU General Public License v2 .0 or later
* Full text of license available in license . txt file , in main folder
*
2009-04-16 11:14:13 +00:00
*/
2011-02-06 17:26:27 +00:00
struct SDL_Surface ;
2009-04-16 11:14:13 +00:00
enum EWindowType { infoOnly , infoOK , yesOrNO } ;
class CInfoWindow ;
class CDefHandler ;
2011-12-22 13:05:19 +00:00
class CComponent ;
2009-04-16 11:14:13 +00:00
class CSelWindow ;
2012-05-13 15:04:21 +00:00
class ComponentResolved ;
2009-04-16 11:14:13 +00:00
2011-02-22 11:52:36 +00:00
/// Class which draws formatted text messages and generates chat windows
2009-04-16 11:14:13 +00:00
class CMessage
{
public :
2012-05-13 15:04:21 +00:00
//Function usd only in CMessage.cpp
2009-06-01 05:40:54 +00:00
static std : : pair < int , int > getMaxSizes ( std : : vector < std : : vector < SDL_Surface * > > * txtg , int fontHeight ) ;
static SDL_Surface * blitTextOnSur ( std : : vector < std : : vector < SDL_Surface * > > * txtg , int fontHeight , int & curh , SDL_Surface * ret , int xCenterPos = - 1 ) ; //xPos==-1 works as if ret->w/2
2012-05-13 15:04:21 +00:00
/// Draw border on exiting surface
2013-03-03 17:06:03 +00:00
static void drawBorder ( PlayerColor playerColor , SDL_Surface * ret , int w , int h , int x = 0 , int y = 0 ) ;
2012-05-13 15:04:21 +00:00
/// Draw simple dialog box (borders and background only)
2013-03-03 17:06:03 +00:00
static SDL_Surface * drawDialogBox ( int w , int h , PlayerColor playerColor = PlayerColor ( 1 ) ) ;
2012-05-13 15:04:21 +00:00
2013-03-03 17:06:03 +00:00
static void drawIWindow ( CInfoWindow * ret , std : : string text , PlayerColor player ) ;
2012-05-13 15:04:21 +00:00
/// split text in lines
2010-07-06 02:10:26 +00:00
static std : : vector < std : : string > breakText ( std : : string text , size_t maxLineWidth , EFonts font ) ;
2012-05-13 15:04:21 +00:00
/// constructor
2009-04-16 11:14:13 +00:00
static void init ( ) ;
2012-05-13 15:04:21 +00:00
/// destructor
2009-04-16 11:14:13 +00:00
static void dispose ( ) ;
} ;