/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying1file LICENSE.rst or https://cmake.org/licensing for details. */2#pragma once34#include "cmConfigure.h" // IWYU pragma: keep56#include <string>78#include "cmsys/FStream.hxx"910#include "cmCursesStandardIncludes.h"1112class cmCursesForm13{14public:15cmCursesForm();16virtual ~cmCursesForm();1718cmCursesForm(cmCursesForm const&) = delete;19cmCursesForm& operator=(cmCursesForm const&) = delete;2021// Description:22// Handle user input.23virtual void HandleInput() = 0;2425// Description:26// Display form.27virtual void Render(int left, int top, int width, int height) = 0;2829// Description:30// This method should normally called only by the form.31// The only exception is during a resize.32virtual void UpdateStatusBar() = 0;3334// Description:35// During a CMake run, an error handle should add errors36// to be displayed afterwards.37virtual void AddError(std::string const&, char const*) {}3839// Description:40// Turn debugging on. This will create ccmakelog.txt.41static void DebugStart();4243// Description:44// Turn debugging off. This will close ccmakelog.txt.45static void DebugEnd();4647// Description:48// Write a debugging message.49static void LogMessage(char const* msg);5051// Description:52// Return the FORM. Should be only used by low-level methods.53FORM* GetForm() { return this->Form; }5455static cmCursesForm* CurrentForm;5657// Description:58// Handle resizing the form with curses.59void HandleResize();6061protected:62static cmsys::ofstream DebugFile;63static bool Debug;6465FORM* Form;66};676869