CPropertyCombo.h 833 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include "CProperty.h"
  3. namespace WallpaperEngine::Core::Projects
  4. {
  5. using json = nlohmann::json;
  6. class CPropertyComboValue
  7. {
  8. public:
  9. std::string label;
  10. std::string value;
  11. };
  12. class CPropertyCombo : public CProperty
  13. {
  14. public:
  15. static CPropertyCombo* fromJSON (json data, const std::string& name);
  16. const std::string& getValue () const;
  17. std::string dump () const override;
  18. void update (const std::string& value) override;
  19. static const std::string Type;
  20. private:
  21. CPropertyCombo (const std::string& name, const std::string& text, std::string defaultValue);
  22. void addValue (std::string label, std::string value);
  23. std::vector <CPropertyComboValue*> m_values;
  24. std::string m_defaultValue;
  25. };
  26. };