cmCursesForm.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmCursesForm_h
  11. #define cmCursesForm_h
  12. #include "cmCursesStandardIncludes.h"
  13. #include <cmsys/FStream.hxx>
  14. class cmCursesForm
  15. {
  16. public:
  17. cmCursesForm();
  18. virtual ~cmCursesForm();
  19. // Description:
  20. // Handle user input.
  21. virtual void HandleInput() = 0;
  22. // Description:
  23. // Display form.
  24. virtual void Render(int left, int top, int width, int height) = 0;
  25. // Description:
  26. // This method should normally called only by the form.
  27. // The only exception is during a resize.
  28. virtual void UpdateStatusBar() = 0;
  29. // Description:
  30. // During a CMake run, an error handle should add errors
  31. // to be displayed afterwards.
  32. virtual void AddError(const char*, const char*) {}
  33. // Description:
  34. // Turn debugging on. This will create ccmakelog.txt.
  35. static void DebugStart();
  36. // Description:
  37. // Turn debugging off. This will close ccmakelog.txt.
  38. static void DebugEnd();
  39. // Description:
  40. // Write a debugging message.
  41. static void LogMessage(const char* msg);
  42. // Description:
  43. // Return the FORM. Should be only used by low-level methods.
  44. FORM* GetForm()
  45. {
  46. return this->Form;
  47. }
  48. static cmCursesForm* CurrentForm;
  49. protected:
  50. static cmsys::ofstream DebugFile;
  51. static bool Debug;
  52. cmCursesForm(const cmCursesForm& form);
  53. void operator=(const cmCursesForm&);
  54. FORM* Form;
  55. };
  56. #endif // cmCursesForm_h