Phoenard
PHNTextContainer.h
Go to the documentation of this file.
1 /*
2 The MIT License (MIT)
3 
4 This file is part of the Phoenard Arduino library
5 Copyright (c) 2014 Phoenard
6 
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13 
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
16 
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 THE SOFTWARE.
24 */
25 
30 #ifndef _PHN_TEXTCONTAINER_H_
31 #define _PHN_TEXTCONTAINER_H_
32 
33 #include <Arduino.h>
34 
42  public:
44  void setText(String textString);
46  void setText(int valueText) { setText((long) valueText); }
48  void setText(long valueText);
50  void setText(double valueText);
52  void setText(const char* text);
54  void clearText();
55 
57  virtual void setTextRaw(const char* text, int textLen);
58 
60  virtual const char* text();
61 
63  virtual int textLength();
64 };
65 
66 #endif
Abstraction for a widget that can store and update text.
Definition: PHNTextContainer.h:41
virtual void setTextRaw(const char *text, int textLen)
Sets the new text to display using a buffer and length.
void setText(int valueText)
Sets the new text to display using an integer value.
Definition: PHNTextContainer.h:46
virtual int textLength()
Gets the length of the text displayed.
Definition: PHNTextContainer.cpp:56
void setText(String textString)
Sets the new text to display using an Arduino type String.
Definition: PHNTextContainer.cpp:28
virtual const char * text()
Gets the text displayed.
void clearText()
Clears all the text, setting it to an Empty String.
Definition: PHNTextContainer.cpp:52