ESPHome  2024.10.2
text_traits.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <utility>
4 
5 #include "esphome/core/helpers.h"
6 
7 namespace esphome {
8 namespace text {
9 
10 enum TextMode : uint8_t {
13 };
14 
15 class TextTraits {
16  public:
17  // Set/get the number value boundaries.
18  void set_min_length(int min_length) { this->min_length_ = min_length; }
19  int get_min_length() const { return this->min_length_; }
20  void set_max_length(int max_length) { this->max_length_ = max_length; }
21  int get_max_length() const { return this->max_length_; }
22 
23  // Set/get the pattern.
24  void set_pattern(std::string pattern) { this->pattern_ = std::move(pattern); }
25  std::string get_pattern() const { return this->pattern_; }
26 
27  // Set/get the frontend mode.
28  void set_mode(TextMode mode) { this->mode_ = mode; }
29  TextMode get_mode() const { return this->mode_; }
30 
31  protected:
34  std::string pattern_;
36 };
37 
38 } // namespace text
39 } // namespace esphome
TextMode get_mode() const
Definition: text_traits.h:29
void set_min_length(int min_length)
Definition: text_traits.h:18
int get_max_length() const
Definition: text_traits.h:21
void set_pattern(std::string pattern)
Definition: text_traits.h:24
BedjetMode mode
BedJet operating mode.
Definition: bedjet_codec.h:183
void set_max_length(int max_length)
Definition: text_traits.h:20
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
int get_min_length() const
Definition: text_traits.h:19
void set_mode(TextMode mode)
Definition: text_traits.h:28
std::string get_pattern() const
Definition: text_traits.h:25