summaryrefslogtreecommitdiffstats
path: root/Source/CursesDialog/cmCursesMainForm.h
blob: 79f4609904bb523a6b7009f76642ff4a377ea453 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef __cmCursesMainForm_h
#define __cmCursesMainForm_h

#include <curses.h>
#include <form.h>
#include "../cmStandardIncludes.h"
#include "cmCursesForm.h"

class cmCursesCacheEntryComposite;

class cmCursesMainForm : public cmCursesForm
{
public:
  cmCursesMainForm(const char* whereSource, bool newCache);
  virtual ~cmCursesMainForm();
  
  // Description:
  // Set the widgets which represent the cache entries.
  void InitializeUI(WINDOW* w);
  
  // Description:
  // Handle user input.
  virtual void HandleInput();

  // Description:
  // Display form. Use a window of size width x height, starting
  // at top, left.
  virtual void Render(int left, int top, int width, int height);

  // Description:
  // Change the window containing the form.
  void SetWindow(WINDOW* w)
    { m_Window = w; }

  // Description:
  // Returns true if an entry with the given key is in the
  // list of current composites.
  bool LookForCacheEntry(const char* key);

protected:
  cmCursesMainForm(const cmCursesMainForm& from);
  void operator=(const cmCursesMainForm&);

  void UpdateCurrentEntry();
  void RunCMake(bool generateMakefiles);
  void FillCacheManagerFromUI();

  std::vector<cmCursesCacheEntryComposite*>* m_Entries;
  FIELD** m_Fields;
  WINDOW* m_Window;
  std::string m_WhereSource;
  int m_Height;
};

#endif // __cmCursesMainForm_h