cmCursesMainForm.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef __cmCursesMainForm_h
  2. #define __cmCursesMainForm_h
  3. #include "../cmStandardIncludes.h"
  4. #include "cmCursesForm.h"
  5. #include "cmCursesStandardIncludes.h"
  6. class cmCursesCacheEntryComposite;
  7. class cmCursesMainForm : public cmCursesForm
  8. {
  9. public:
  10. cmCursesMainForm(std::vector<std::string> const& args);
  11. virtual ~cmCursesMainForm();
  12. // Description:
  13. // Set the widgets which represent the cache entries.
  14. void InitializeUI();
  15. // Description:
  16. // Handle user input.
  17. virtual void HandleInput();
  18. // Description:
  19. // Display form. Use a window of size width x height, starting
  20. // at top, left.
  21. virtual void Render(int left, int top, int width, int height);
  22. // Description:
  23. // Returns true if an entry with the given key is in the
  24. // list of current composites.
  25. bool LookForCacheEntry(const char* key);
  26. enum {
  27. MIN_WIDTH = 65,
  28. MIN_HEIGHT = 6,
  29. IDEAL_WIDTH = 80,
  30. MAX_WIDTH = 512
  31. };
  32. // Description:
  33. // This method should normally called only by the form.
  34. // The only exception is during a resize.
  35. virtual void UpdateStatusBar();
  36. // Description:
  37. // This method should normally called only by the form.
  38. // The only exception is during a resize.
  39. void PrintKeys();
  40. // Description:
  41. // During a CMake run, an error handle should add errors
  42. // to be displayed afterwards.
  43. virtual void AddError(const char* message, const char* title);
  44. // Description:
  45. // Used to run cmake.
  46. void RunCMake(bool generateMakefiles);
  47. protected:
  48. cmCursesMainForm(const cmCursesMainForm& from);
  49. void operator=(const cmCursesMainForm&);
  50. void FillCacheManagerFromUI();
  51. void RePost();
  52. void RemoveEntry(const char* value);
  53. std::vector<cmCursesCacheEntryComposite*>* m_Entries;
  54. std::vector<std::string> m_Errors;
  55. std::vector<std::string> m_Args;
  56. std::vector<std::string> m_HelpMessage;
  57. static const char* s_ConstHelpMessage;
  58. FIELD** m_Fields;
  59. std::string m_WhereSource;
  60. std::string m_WhereCMake;
  61. int m_Height;
  62. int m_NumberOfVisibleEntries;
  63. bool m_AdvancedMode;
  64. bool m_OkToGenerate;
  65. };
  66. #endif // __cmCursesMainForm_h