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