Skip implicit link info for multiple OS X archs
[cmake.git] / Source / CursesDialog / cmCursesMainForm.h
blob40e04aa6bf109a6a6c6f887d8a044a44561a2aa8
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCursesMainForm.h,v $
5 Language: C++
6 Date: $Date: 2006-03-16 15:44:55 $
7 Version: $Revision: 1.24 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef __cmCursesMainForm_h
18 #define __cmCursesMainForm_h
20 #include "../cmStandardIncludes.h"
21 #include "cmCursesForm.h"
22 #include "cmCursesStandardIncludes.h"
24 class cmCursesCacheEntryComposite;
25 class cmCursesWidget;
26 class cmake;
28 /** \class cmCursesMainForm
29 * \brief The main page of ccmake
31 * cmCursesMainForm is the main page of ccmake.
33 class cmCursesMainForm : public cmCursesForm
35 public:
36 cmCursesMainForm(std::vector<std::string> const& args, int initwidth);
37 virtual ~cmCursesMainForm();
39 /**
40 * Set the widgets which represent the cache entries.
42 void InitializeUI();
44 /**
45 * Handle user input.
47 virtual void HandleInput();
49 /**
50 * Display form. Use a window of size width x height, starting
51 * at top, left.
53 virtual void Render(int left, int top, int width, int height);
55 /**
56 * Returns true if an entry with the given key is in the
57 * list of current composites.
59 bool LookForCacheEntry(const char* key);
61 enum {
62 MIN_WIDTH = 65,
63 MIN_HEIGHT = 6,
64 IDEAL_WIDTH = 80,
65 MAX_WIDTH = 512
68 /**
69 * This method should normally be called only by the form. The only
70 * exception is during a resize. The optional argument specifies the
71 * string to be displayed in the status bar.
73 virtual void UpdateStatusBar() { this->UpdateStatusBar(0); }
74 virtual void UpdateStatusBar(const char* message);
76 /**
77 * Display current commands and their keys on the toolbar. This
78 * method should normally called only by the form. The only
79 * exception is during a resize. If the optional argument process is
80 * specified and is either 1 (configure) or 2 (generate), then keys
81 * will be displayed accordingly.
83 void PrintKeys(int process = 0);
85 /**
86 * During a CMake run, an error handle should add errors
87 * to be displayed afterwards.
89 virtual void AddError(const char* message, const char* title);
91 /**
92 * Used to do a configure. If argument is specified, it does only the check
93 * and not configure.
95 int Configure(int noconfigure=0);
97 /**
98 * Used to generate
100 int Generate();
103 * Used by main program
105 int LoadCache(const char *dir);
108 * Progress callback
110 static void UpdateProgressOld(const char *msg, float prog, void*);
111 static void UpdateProgress(const char *msg, float prog, void*);
113 protected:
114 cmCursesMainForm(const cmCursesMainForm& from);
115 void operator=(const cmCursesMainForm&);
117 // Copy the cache values from the user interface to the actual
118 // cache.
119 void FillCacheManagerFromUI();
120 // Fix formatting of values to a consistent form.
121 void FixValue(cmCacheManager::CacheEntryType type,
122 const std::string& in, std::string& out) const;
123 // Re-post the existing fields. Used to toggle between
124 // normal and advanced modes. Render() should be called
125 // afterwards.
126 void RePost();
127 // Remove an entry from the interface and the cache.
128 void RemoveEntry(const char* value);
130 // Jump to the cache value with index idx. If string str is
131 // specified, it will stop on widget that contain that string.
132 void JumpToCacheEntry(int idx, const char* str);
134 // Copies of cache entries stored in the user interface
135 std::vector<cmCursesCacheEntryComposite*>* Entries;
136 // Errors produced during last run of cmake
137 std::vector<std::string> Errors;
138 // Command line argumens to be passed to cmake each time
139 // it is run
140 std::vector<std::string> Args;
141 // Message displayed when user presses 'h'
142 // It is: Welcome + info about current entry + common help
143 std::vector<std::string> HelpMessage;
145 // Common help
146 static const char* s_ConstHelpMessage;
148 // Fields displayed. Includes labels, new entry markers, entries
149 FIELD** Fields;
150 // Where is source of current project
151 std::string WhereSource;
152 // Where is cmake executable
153 std::string WhereCMake;
154 // Number of entries shown (depends on mode -normal or advanced-)
155 int NumberOfVisibleEntries;
156 bool AdvancedMode;
157 // Did the iteration converge (no new entries) ?
158 bool OkToGenerate;
159 // Number of pages displayed
160 int NumberOfPages;
162 int InitialWidth;
163 cmake *CMakeInstance;
165 std::string SearchString;
166 std::string OldSearchString;
167 bool SearchMode;
170 #endif // __cmCursesMainForm_h