cmCursesForm.h 1.6 KB

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