cmCursesForm.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. 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 std::ofstream DebugFile;
  51. static bool Debug;
  52. cmCursesForm(const cmCursesForm& form);
  53. void operator=(const cmCursesForm&);
  54. FORM* Form;
  55. };
  56. #endif // __cmCursesForm_h