2023-12-16 17:36:57 +01:00
|
|
|
#pragma once
|
2024-11-27 20:44:36 +01:00
|
|
|
|
2023-12-16 17:36:57 +01:00
|
|
|
#include "WUPSConfigItem.h"
|
|
|
|
#include <string>
|
|
|
|
#include <wups/config.h>
|
|
|
|
|
|
|
|
namespace WUPSConfigAPIBackend {
|
2024-11-27 20:44:36 +01:00
|
|
|
class WUPSConfigItemV1 final : public WUPSConfigItem {
|
2023-12-16 17:36:57 +01:00
|
|
|
public:
|
2024-11-27 20:44:36 +01:00
|
|
|
WUPSConfigItemV1(std::string_view configId,
|
|
|
|
std::string_view displayName,
|
|
|
|
const WUPSConfigAPIItemCallbacksV1 &callbacks,
|
|
|
|
void *context);
|
2023-12-16 17:36:57 +01:00
|
|
|
|
|
|
|
~WUPSConfigItemV1() override;
|
|
|
|
|
|
|
|
[[nodiscard]] std::string getCurrentValueDisplayImpl() const;
|
|
|
|
|
|
|
|
[[nodiscard]] std::string getCurrentValueDisplay() const override;
|
|
|
|
|
|
|
|
[[nodiscard]] std::string getCurrentValueSelectedDisplay() const override;
|
|
|
|
|
|
|
|
void onSelected(bool isSelected) const override;
|
|
|
|
|
|
|
|
void onButtonPressed(WUPSConfigButtons buttons) const override;
|
|
|
|
|
|
|
|
[[nodiscard]] bool isMovementAllowed() const override;
|
|
|
|
|
|
|
|
void restoreDefault() const override;
|
|
|
|
|
|
|
|
void onCloseCallback() override;
|
|
|
|
|
|
|
|
void setConfigId(const std::string &configId) override;
|
|
|
|
|
|
|
|
const std::string &getConfigId() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void *mContext;
|
|
|
|
std::string mConfigId;
|
|
|
|
std::string mDefaultValue;
|
|
|
|
WUPSConfigAPIItemCallbacksV1 mCallbacks{};
|
|
|
|
};
|
|
|
|
} // namespace WUPSConfigAPIBackend
|