Screen.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. *
  3. * Copyright (c) 2020 Project CHIP Authors
  4. * All rights reserved.
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. /**
  19. * @file Screen.h
  20. *
  21. * Simple screen.
  22. *
  23. */
  24. #pragma once
  25. #include "Display.h"
  26. #if CONFIG_HAVE_DISPLAY
  27. #include "ScreenManager.h"
  28. #include <string>
  29. class Screen
  30. {
  31. public:
  32. enum FocusType
  33. {
  34. NONE,
  35. BLUR,
  36. UNBLUR,
  37. NEXT,
  38. PREVIOUS
  39. };
  40. virtual ~Screen() = default;
  41. virtual std::string GetTitle() { return "Untitled"; }
  42. virtual std::string GetButtonText(int id);
  43. virtual void Display() {}
  44. virtual void Enter(bool pushed) {}
  45. virtual void Exit(bool popped) {}
  46. virtual bool IsFocusable() { return false; }
  47. virtual void Focus(FocusType focus) {}
  48. virtual void Action() {}
  49. };
  50. #endif // CONFIG_HAVE_DISPLAY