Scippy

SCIP

Solving Constraint Integer Programs

pub_dialog.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2014 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file pub_dialog.h
17  * @ingroup PUBLICMETHODS
18  * @brief public methods for user interface dialog
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_PUB_DIALOG_H__
25 #define __SCIP_PUB_DIALOG_H__
26 
27 
28 #include "scip/def.h"
29 #include "scip/type_retcode.h"
30 #include "scip/type_scip.h"
31 #include "scip/type_dialog.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /*
38  * dialog handler
39  */
40 
41 /** returns the root dialog of the dialog handler */
42 extern
44  SCIP_DIALOGHDLR* dialoghdlr /**< dialog handler */
45  );
46 
47 /** clears the input command buffer of the dialog handler */
48 extern
50  SCIP_DIALOGHDLR* dialoghdlr /**< dialog handler */
51  );
52 
53 /** returns TRUE iff input command buffer is empty */
54 extern
56  SCIP_DIALOGHDLR* dialoghdlr /**< dialog handler */
57  );
58 
59 /** returns the next word in the handler's command buffer; if the buffer is empty, displays the given prompt or the
60  * current dialog's path and asks the user for further input; the user must not free or modify the returned string
61  */
62 extern
64  SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler */
65  SCIP_DIALOG* dialog, /**< current dialog */
66  const char* prompt, /**< prompt to display, or NULL to display the current dialog's path */
67  char** inputword, /**< pointer to store the next word in the handler's command buffer */
68  SCIP_Bool* endoffile /**< pointer to store whether the end of the input file was reached */
69  );
70 
71 /** adds a single line of input to the dialog handler which is treated as if the user entered the command line */
72 extern
74  SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler */
75  const char* inputline /**< input line to add */
76  );
77 
78 /** adds a command to the command history of the dialog handler; if a dialog is given, the command is preceeded
79  * by the dialog's command path; if no command is given, only the path to the dialog is added to the command history
80  */
81 extern
83  SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler */
84  SCIP_DIALOG* dialog, /**< current dialog, or NULL */
85  const char* command, /**< command string to add to the command history, or NULL */
86  SCIP_Bool escapecommand /**< should special characters in command be prefixed by an escape char? */
87  );
88 
89 
90 
91 
92 /*
93  * dialog
94  */
95 
96 /** returns TRUE iff a dialog entry matching exactly the given name is existing in the given dialog */
97 extern
99  SCIP_DIALOG* dialog, /**< dialog */
100  const char* entryname /**< name of the dialog entry to find */
101  );
102 
103 /** searches the dialog for entries corresponding to the given name;
104  * If a complete match is found, the entry is returned as "subdialog" and
105  * the return value is 1.
106  * If no dialog entry completely matches the given "entryname", the number
107  * of entries with names beginning with "entryname" is returned. If this
108  * number is 1, the single match is returned as "subdialog". Otherwise,
109  * "subdialog" is set to NULL.
110  */
111 extern
113  SCIP_DIALOG* dialog, /**< dialog */
114  const char* entryname, /**< name of the dialog entry to find */
115  SCIP_DIALOG** subdialog /**< pointer to store the found dialog entry */
116  );
117 
118 /** displays the dialog's menu */
119 extern
121  SCIP_DIALOG* dialog, /**< dialog */
122  SCIP* scip /**< SCIP data structure */
123  );
124 
125 /** displays the entry for the dialog in it's parent's menu */
126 extern
128  SCIP_DIALOG* dialog, /**< dialog */
129  SCIP* scip /**< SCIP data structure */
130  );
131 
132 /** displays all dialog entries with names starting with the given "entryname" */
133 extern
135  SCIP_DIALOG* dialog, /**< dialog */
136  SCIP* scip, /**< SCIP data structure */
137  const char* entryname /**< name of the dialog entry to find */
138  );
139 
140 /** gets the name of the current path in the dialog tree, separated by the given character */
141 extern
142 void SCIPdialogGetPath(
143  SCIP_DIALOG* dialog, /**< dialog */
144  const char sepchar, /**< separation character to insert in path */
145  char* path /**< string buffer to store the path */
146  );
147 
148 /** gets the command name of the dialog */
149 extern
150 const char* SCIPdialogGetName(
151  SCIP_DIALOG* dialog /**< dialog */
152  );
153 
154 /** gets the description of the dialog */
155 extern
156 const char* SCIPdialogGetDesc(
157  SCIP_DIALOG* dialog /**< dialog */
158  );
159 
160 /** returns whether the dialog is a sub menu */
161 extern
163  SCIP_DIALOG* dialog /**< dialog */
164  );
165 
166 /** gets the parent dialog of the given dialog */
167 extern
169  SCIP_DIALOG* dialog /**< dialog */
170  );
171 
172 /** gets the array of sub-dialogs associated with the given dialog */
173 extern
175  SCIP_DIALOG* dialog /**< dialog */
176  );
177 
178 /** gets the number of sub-dialogs associated with the given dialog */
179 extern
181  SCIP_DIALOG* dialog /**< dialog */
182  );
183 
184 /** gets the user defined data associated with the given dialog */
185 extern
187  SCIP_DIALOG* dialog /**< dialog */
188  );
189 
190 /** sets user data of dialog; user has to free old data in advance! */
191 extern
192 void SCIPdialogSetData(
193  SCIP_DIALOG* dialog, /**< dialog */
194  SCIP_DIALOGDATA* dialogdata /**< new dialog user data */
195  );
196 
197 #ifdef __cplusplus
198 }
199 #endif
200 
201 #endif
202