1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
5 #include "cmConfigure.h" // IWYU pragma: keep
9 #include "cmCursesStandardIncludes.h"
10 #include "cmStateTypes.h"
12 class cmCursesMainForm
;
17 cmCursesWidget(int width
, int height
, int left
, int top
);
18 virtual ~cmCursesWidget();
20 cmCursesWidget(cmCursesWidget
const&) = delete;
21 cmCursesWidget
& operator=(cmCursesWidget
const&) = delete;
24 * Handle user input. Called by the container of this widget
25 * when this widget has focus. Returns true if the input was
28 virtual bool HandleInput(int& key
, cmCursesMainForm
* fm
, WINDOW
* w
) = 0;
31 * Change the position of the widget. Set isNewPage to true
32 * if this widget marks the beginning of a new page.
34 virtual void Move(int x
, int y
, bool isNewPage
);
37 * Set/Get the value (setting the value also changes the contents
38 * of the field buffer).
40 virtual void SetValue(const std::string
& value
);
41 virtual const char* GetValue();
44 * Get the type of the widget (STRING, PATH etc...)
46 cmStateEnums::CacheEntryType
GetType() { return this->Type
; }
49 * If there are any, print the widget specific commands
50 * in the toolbar and return true. Otherwise, return false
51 * and the parent widget will print.
53 virtual bool PrintKeys() { return false; }
56 * Set/Get the page this widget is in.
58 void SetPage(int page
) { this->Page
= page
; }
59 int GetPage() { return this->Page
; }
61 friend class cmCursesMainForm
;
64 cmStateEnums::CacheEntryType Type
;
67 // The page in the main form this widget is in