IText.hpp
1 /*
2  * Copyright © 2013 mathdu07
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef ITEXT_H_
19 #define ITEXT_H_
20 
21 #include <SFML/Graphics.hpp>
22 
23 namespace sf
24 {
25 namespace ui
26 {
27 
28 class IText
29 {
30 public:
31  //METHODS ------------------------------------------------------------
32  virtual ~IText();
33  //--------------------------------------------------------------------
34 
35  //GETTERS/SETTERS ----------------------------------------------------
41  virtual const sf::String& getText() const = 0;
42 
51  virtual void setText(sf::String const &text) = 0;
52 
58  virtual const sf::Font* getFont() const = 0;
59 
65  virtual void setFont(sf::Font const &font) = 0;
66 
72  virtual unsigned int getFontSize() const = 0;
73 
81  virtual void setFontSize(unsigned int size) = 0;
82 
88  virtual sf::Color getFontColor() const = 0;
89 
97  virtual void setFontColor(sf::Color color) = 0;
98  //--------------------------------------------------------------------
99 };
100 
101 } /* namespace ui */
102 } /* namespace sf */
103 #endif /* ITEXT_H_ */
104 
virtual void setFontColor(sf::Color color)=0
Sets the color's font of the text.
virtual const sf::Font * getFont() const =0
virtual const sf::String & getText() const =0
virtual void setText(sf::String const &text)=0
Sets the text's string of the component Don't forget to set the font.
virtual sf::Color getFontColor() const =0
virtual void setFontSize(unsigned int size)=0
Set the font's size of the component.
An interface that allow component to have a text.
Definition: IText.hpp:28
virtual unsigned int getFontSize() const =0
virtual void setFont(sf::Font const &font)=0
Sets the font of the component's text.