FastLED 3.9.15
Loading...
Searching...
No Matches
help.h
Go to the documentation of this file.
1#pragma once
2
3#include "fl/stl/string.h"
4#include "fl/stl/compiler_control.h" // IWYU pragma: keep
5#include "fl/stl/noexcept.h"
6#include "fl/ui/element.h"
7#include "platforms/ui_defs.h"
8
9#ifndef FASTLED_HAS_UI_HELP
10#define FASTLED_HAS_UI_HELP 0
11#endif
12
13namespace fl {
14
15#if !FASTLED_HAS_UI_HELP
17 public:
20
21 // Stub method for group setting (does nothing on non-WASM platforms)
22 void setGroup(const fl::string& groupName) { FASTLED_UNUSED(groupName); }
23
24 // Stub method for accessing markdown content
25 const fl::string& markdownContent() const { return mContent; }
26
27 private:
29};
30#endif
31
32class UIHelp : public UIElement {
33 public:
37
38 // Override setGroup to also update the implementation
39 void setGroup(const fl::string& groupName) FL_NOEXCEPT override {
40 UIElement::setGroup(groupName);
41 // Update the implementation's group if it has the method (WASM platforms)
42 mImpl.setGroup(groupName);
43 }
44
45 // Access to the markdown content
46 const fl::string& markdownContent() const FL_NOEXCEPT { return mImpl.markdownContent(); }
47
48 protected:
50};
51
52} // namespace fl
virtual void setGroup(const fl::string &groupName) FL_NOEXCEPT
Definition element.h:31
UIElement() FL_NOEXCEPT
void setGroup(const fl::string &groupName) FL_NOEXCEPT override
Definition help.h:39
FL_NO_COPY(UIHelp)
const fl::string & markdownContent() const FL_NOEXCEPT
Definition help.h:46
UIHelpImpl mImpl
Definition help.h:49
~UIHelp() FL_NOEXCEPT
Definition help.cpp.hpp:7
UIHelp(const char *markdownContent) FL_NOEXCEPT
Definition help.cpp.hpp:6
void setGroup(const fl::string &groupName)
Definition help.h:22
~UIHelpImpl() FL_NOEXCEPT
Definition help.h:19
const fl::string & markdownContent() const
Definition help.h:25
UIHelpImpl(const char *markdownContent)
Definition help.h:18
fl::string mContent
Definition help.h:28
Base definition for an LED controller.
Definition crgb.hpp:179
#define FASTLED_UNUSED(x)
#define FL_NOEXCEPT