88efe62173ed2ccf8733bc4d9d85d324d9571d29
[platform/upstream/cmake.git] / Source / CursesDialog / cmCursesLongMessageForm.h
1 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2    file Copyright.txt or https://cmake.org/licensing for details.  */
3 #ifndef cmCursesLongMessageForm_h
4 #define cmCursesLongMessageForm_h
5
6 #include "cmConfigure.h" // IWYU pragma: keep
7
8 #include <string>
9 #include <vector>
10
11 #include "cmCursesForm.h"
12 #include "cmCursesStandardIncludes.h"
13
14 class cmCursesLongMessageForm : public cmCursesForm
15 {
16 public:
17   enum class ScrollBehavior
18   {
19     NoScroll,
20     ScrollDown
21   };
22
23   cmCursesLongMessageForm(std::vector<std::string> const& messages,
24                           const char* title, ScrollBehavior scrollBehavior);
25   ~cmCursesLongMessageForm() override;
26
27   cmCursesLongMessageForm(cmCursesLongMessageForm const&) = delete;
28   cmCursesLongMessageForm& operator=(cmCursesLongMessageForm const&) = delete;
29
30   // Description:
31   // Handle user input.
32   void HandleInput() override;
33
34   // Description:
35   // Display form. Use a window of size width x height, starting
36   // at top, left.
37   void Render(int left, int top, int width, int height) override;
38
39   // Description:
40   // This method should normally  called only by the form.
41   // The only exception is during a resize.
42   void PrintKeys();
43
44   // Description:
45   // This method should normally  called only by the form.
46   // The only exception is during a resize.
47   void UpdateStatusBar() override;
48
49 protected:
50   std::string Messages;
51   std::string Title;
52   ScrollBehavior Scrolling;
53
54   FIELD* Fields[2];
55 };
56
57 #endif // cmCursesLongMessageForm_h