cmCursesForm.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. public:
  11. cmCursesForm();
  12. virtual ~cmCursesForm();
  13. // Description:
  14. // Handle user input.
  15. virtual void HandleInput() = 0;
  16. // Description:
  17. // Display form.
  18. virtual void Render(int left, int top, int width, int height) = 0;
  19. // Description:
  20. // This method should normally called only by the form.
  21. // The only exception is during a resize.
  22. virtual void UpdateStatusBar() = 0;
  23. // Description:
  24. // During a CMake run, an error handle should add errors
  25. // to be displayed afterwards.
  26. virtual void AddError(const char*, const char*) {}
  27. // Description:
  28. // Turn debugging on. This will create ccmakelog.txt.
  29. static void DebugStart();
  30. // Description:
  31. // Turn debugging off. This will close ccmakelog.txt.
  32. static void DebugEnd();
  33. // Description:
  34. // Write a debugging message.
  35. static void LogMessage(const char* msg);
  36. // Description:
  37. // Return the FORM. Should be only used by low-level methods.
  38. FORM* GetForm() { return this->Form; }
  39. static cmCursesForm* CurrentForm;
  40. protected:
  41. static cmsys::ofstream DebugFile;
  42. static bool Debug;
  43. cmCursesForm(const cmCursesForm& form);
  44. void operator=(const cmCursesForm&);
  45. FORM* Form;
  46. };
  47. #endif // cmCursesForm_h