UIText.h 919 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include "UIElement.h"
  3. class UITextElement : public UIElement
  4. {
  5. private:
  6. Framework::Text text;
  7. public:
  8. UITextElement();
  9. void setText(const Framework::Text& text);
  10. const Framework::Text& getText() const;
  11. virtual Framework::XML::Element* toUIML(
  12. Framework::Either<Block*, Entity*> zTarget,
  13. Entity* zActor) const override;
  14. };
  15. class UITextElementFactory : public UIElementFactory<UITextElement>
  16. {
  17. public:
  18. UITextElementFactory();
  19. virtual JSONObjectValidationBuilder* addToValidator(
  20. JSONObjectValidationBuilder* builder) const override;
  21. UITextElement* fromJson(Framework::JSON::JSONObject* zJson) const override;
  22. Framework::JSON::JSONObject* toJsonObject(
  23. UITextElement* zObject) const override;
  24. UITextElement* createElement(
  25. Framework::JSON::JSONObject* zJson) const override;
  26. const char* getTypeToken() const override;
  27. };