FastLED 3.9.15
Loading...
Searching...
No Matches
description.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_DESCRIPTION
10#define FASTLED_HAS_UI_DESCRIPTION 0
11#endif
12
13namespace fl {
14
15#if !FASTLED_HAS_UI_DESCRIPTION
16
18 public:
19 UIDescriptionImpl(const char *name) { FASTLED_UNUSED(name); }
21
22 // Stub method for group setting (does nothing on non-WASM platforms)
23 void setGroup(const fl::string& groupName) { FASTLED_UNUSED(groupName); }
24};
25
26#endif
27
28class UIDescription : public UIElement {
29 public:
31 UIDescription(const char *name) FL_NOEXCEPT;
33
34 // Override setGroup to also update the implementation
35 void setGroup(const fl::string& groupName) FL_NOEXCEPT override {
36 UIElement::setGroup(groupName);
37 // Update the implementation's group if it has the method (WASM platforms)
38 mImpl.setGroup(groupName);
39 }
40
41 protected:
43};
44
45} // namespace fl
void setGroup(const fl::string &groupName) FL_NOEXCEPT override
Definition description.h:35
FL_NO_COPY(UIDescription)
UIDescriptionImpl mImpl
Definition description.h:42
UIDescription(const char *name) FL_NOEXCEPT
~UIDescription() FL_NOEXCEPT
UIDescriptionImpl(const char *name)
Definition description.h:19
~UIDescriptionImpl() FL_NOEXCEPT
Definition description.h:20
void setGroup(const fl::string &groupName)
Definition description.h:23
virtual void setGroup(const fl::string &groupName) FL_NOEXCEPT
Definition element.h:31
UIElement() FL_NOEXCEPT
Base definition for an LED controller.
Definition crgb.hpp:179
#define FASTLED_UNUSED(x)
#define FL_NOEXCEPT