cmCursesForm.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmCursesForm_h
  4. #define cmCursesForm_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include "cmCursesStandardIncludes.h"
  7. #include "cmsys/FStream.hxx"
  8. class cmCursesForm
  9. {
  10. CM_DISABLE_COPY(cmCursesForm)
  11. public:
  12. cmCursesForm();
  13. virtual ~cmCursesForm();
  14. // Description:
  15. // Handle user input.
  16. virtual void HandleInput() = 0;
  17. // Description:
  18. // Display form.
  19. virtual void Render(int left, int top, int width, int height) = 0;
  20. // Description:
  21. // This method should normally called only by the form.
  22. // The only exception is during a resize.
  23. virtual void UpdateStatusBar() = 0;
  24. // Description:
  25. // During a CMake run, an error handle should add errors
  26. // to be displayed afterwards.
  27. virtual void AddError(const char*, const char*) {}
  28. // Description:
  29. // Turn debugging on. This will create ccmakelog.txt.
  30. static void DebugStart();
  31. // Description:
  32. // Turn debugging off. This will close ccmakelog.txt.
  33. static void DebugEnd();
  34. // Description:
  35. // Write a debugging message.
  36. static void LogMessage(const char* msg);
  37. // Description:
  38. // Return the FORM. Should be only used by low-level methods.
  39. FORM* GetForm() { return this->Form; }
  40. static cmCursesForm* CurrentForm;
  41. protected:
  42. static cmsys::ofstream DebugFile;
  43. static bool Debug;
  44. FORM* Form;
  45. };
  46. #endif // cmCursesForm_h