1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-05-09 06:42:18 +08:00
CMake/Source/CursesDialog/cmCursesForm.h
Kitware Robot bdca8b01d2 Modernize: Use #pragma once in all header files
#pragma once is a widely supported compiler pragma, even though it is
not part of the C++ standard. Many of the issues keeping #pragma once
from being standardized (distributed filesystems, build farms, hard
links, etc.) do not apply to CMake - it is easy to build CMake on a
single machine. CMake also does not install any header files which can
be consumed by other projects (though cmCPluginAPI.h has been
deliberately omitted from this conversion in case anyone is still using
it.) Finally, #pragma once has been required to build CMake since at
least August 2017 (7f29bbe6 enabled server mode unconditionally, which
had been using #pragma once since September 2016 (b13d3e0d)). The fact
that we now require C++11 filters out old compilers, and it is unlikely
that there is a compiler which supports C++11 but does not support
#pragma once.
2020-09-03 09:30:21 -04:00

64 lines
1.5 KiB
C++

/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#pragma once
#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include "cmsys/FStream.hxx"
#include "cmCursesStandardIncludes.h"
class cmCursesForm
{
public:
cmCursesForm();
virtual ~cmCursesForm();
cmCursesForm(cmCursesForm const&) = delete;
cmCursesForm& operator=(cmCursesForm const&) = delete;
// Description:
// Handle user input.
virtual void HandleInput() = 0;
// Description:
// Display form.
virtual void Render(int left, int top, int width, int height) = 0;
// Description:
// This method should normally called only by the form.
// The only exception is during a resize.
virtual void UpdateStatusBar() = 0;
// Description:
// During a CMake run, an error handle should add errors
// to be displayed afterwards.
virtual void AddError(const std::string&, const char*) {}
// Description:
// Turn debugging on. This will create ccmakelog.txt.
static void DebugStart();
// Description:
// Turn debugging off. This will close ccmakelog.txt.
static void DebugEnd();
// Description:
// Write a debugging message.
static void LogMessage(const char* msg);
// Description:
// Return the FORM. Should be only used by low-level methods.
FORM* GetForm() { return this->Form; }
static cmCursesForm* CurrentForm;
protected:
static cmsys::ofstream DebugFile;
static bool Debug;
FORM* Form;
};