1    	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2    	/*                                                                           */
3    	/*                  This file is part of the program and library             */
4    	/*         SCIP --- Solving Constraint Integer Programs                      */
5    	/*                                                                           */
6    	/*  Copyright (c) 2002-2023 Zuse Institute Berlin (ZIB)                      */
7    	/*                                                                           */
8    	/*  Licensed under the Apache License, Version 2.0 (the "License");          */
9    	/*  you may not use this file except in compliance with the License.         */
10   	/*  You may obtain a copy of the License at                                  */
11   	/*                                                                           */
12   	/*      http://www.apache.org/licenses/LICENSE-2.0                           */
13   	/*                                                                           */
14   	/*  Unless required by applicable law or agreed to in writing, software      */
15   	/*  distributed under the License is distributed on an "AS IS" BASIS,        */
16   	/*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17   	/*  See the License for the specific language governing permissions and      */
18   	/*  limitations under the License.                                           */
19   	/*                                                                           */
20   	/*  You should have received a copy of the Apache-2.0 license                */
21   	/*  along with SCIP; see the file LICENSE. If not visit scipopt.org.         */
22   	/*                                                                           */
23   	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24   	
25   	/**@file   scip_dialog.h
26   	 * @ingroup PUBLICCOREAPI
27   	 * @brief  public methods for dialog handler plugins
28   	 * @author Tobias Achterberg
29   	 * @author Timo Berthold
30   	 * @author Thorsten Koch
31   	 * @author Alexander Martin
32   	 * @author Marc Pfetsch
33   	 * @author Kati Wolter
34   	 * @author Gregor Hendel
35   	 * @author Leona Gottwald
36   	 */
37   	
38   	/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
39   	
40   	#ifndef __SCIP_SCIP_DIALOG_H__
41   	#define __SCIP_SCIP_DIALOG_H__
42   	
43   	
44   	#include "scip/def.h"
45   	#include "scip/type_dialog.h"
46   	#include "scip/type_retcode.h"
47   	#include "scip/type_scip.h"
48   	
49   	#ifdef __cplusplus
50   	extern "C" {
51   	#endif
52   	
53   	/**@addtogroup PublicDialogMethods
54   	 *
55   	 * @{
56   	 */
57   	
58   	/** creates and includes dialog
59   	 *
60   	 *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
61   	 *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
62   	 */
63   	SCIP_EXPORT
64   	SCIP_RETCODE SCIPincludeDialog(
65   	   SCIP*                 scip,               /**< SCIP data structure */
66   	   SCIP_DIALOG**         dialog,             /**< pointer to store the dialog */
67   	   SCIP_DECL_DIALOGCOPY  ((*dialogcopy)),    /**< copy method of dialog or NULL if you don't want to copy your plugin into sub-SCIPs */
68   	   SCIP_DECL_DIALOGEXEC  ((*dialogexec)),    /**< execution method of dialog */
69   	   SCIP_DECL_DIALOGDESC  ((*dialogdesc)),    /**< description output method of dialog, or NULL */
70   	   SCIP_DECL_DIALOGFREE  ((*dialogfree)),    /**< destructor of dialog to free user data, or NULL */
71   	   const char*           name,               /**< name of dialog: command name appearing in parent's dialog menu */
72   	   const char*           desc,               /**< description of dialog used if description output method is NULL */
73   	   SCIP_Bool             issubmenu,          /**< is the dialog a submenu? */
74   	   SCIP_DIALOGDATA*      dialogdata          /**< user defined dialog data */
75   	   );
76   	
77   	/** returns if the dialog already exists
78   	 *
79   	 *  @return TRUE is returned if the dialog exists, otherwise FALSE.
80   	 */
81   	SCIP_EXPORT
82   	SCIP_Bool SCIPexistsDialog(
83   	   SCIP*                 scip,               /**< SCIP data structure */
84   	   SCIP_DIALOG*          dialog              /**< dialog */
85   	   );
86   	
87   	/** captures a dialog
88   	 *
89   	 *  @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
90   	 *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
91   	 */
92   	SCIP_EXPORT
93   	SCIP_RETCODE SCIPcaptureDialog(
94   	   SCIP*                 scip,               /**< SCIP data structure */
95   	   SCIP_DIALOG*          dialog              /**< dialog */
96   	   );
97   	
98   	/** releases a dialog
99   	 *
100  	 *  @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
101  	 *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
102  	 */
103  	SCIP_EXPORT
104  	SCIP_RETCODE SCIPreleaseDialog(
105  	   SCIP*                 scip,               /**< SCIP data structure */
106  	   SCIP_DIALOG**         dialog              /**< pointer to the dialog */
107  	   );
108  	
109  	/** makes given dialog the root dialog of SCIP's interactive user shell; captures dialog and releases former root dialog
110  	 *
111  	 *  @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
112  	 *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
113  	 */
114  	SCIP_EXPORT
115  	SCIP_RETCODE SCIPsetRootDialog(
116  	   SCIP*                 scip,               /**< SCIP data structure */
117  	   SCIP_DIALOG*          dialog              /**< dialog to be the root */
118  	   );
119  	
120  	/** returns the root dialog of SCIP's interactive user shell
121  	 *
122  	 *  @return the root dialog of SCIP's interactive user shell is returned.
123  	 */
124  	SCIP_EXPORT
125  	SCIP_DIALOG* SCIPgetRootDialog(
126  	   SCIP*                 scip                /**< SCIP data structure */
127  	   );
128  	
129  	/** adds a sub dialog to the given dialog as menu entry and captures it
130  	 *
131  	 *  @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
132  	 *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
133  	 */
134  	SCIP_EXPORT
135  	SCIP_RETCODE SCIPaddDialogEntry(
136  	   SCIP*                 scip,               /**< SCIP data structure */
137  	   SCIP_DIALOG*          dialog,             /**< dialog to extend, or NULL for root dialog */
138  	   SCIP_DIALOG*          subdialog           /**< subdialog to add as menu entry in dialog */
139  	   );
140  	
141  	/** adds a single line of input which is treated as if the user entered the command line
142  	 *
143  	 *  @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
144  	 *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
145  	 */
146  	SCIP_EXPORT
147  	SCIP_RETCODE SCIPaddDialogInputLine(
148  	   SCIP*                 scip,               /**< SCIP data structure */
149  	   const char*           inputline           /**< input line to add */
150  	   );
151  	
152  	/** adds a single line of input to the command history which can be accessed with the cursor keys
153  	 *
154  	 *  @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
155  	 *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
156  	 */
157  	SCIP_EXPORT
158  	SCIP_RETCODE SCIPaddDialogHistoryLine(
159  	   SCIP*                 scip,               /**< SCIP data structure */
160  	   const char*           inputline           /**< input line to add */
161  	   );
162  	
163  	/** starts interactive mode of SCIP by executing the root dialog
164  	 *
165  	 *  @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
166  	 *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
167  	 *
168  	 *  @pre This method can be called if @p scip is in one of the following stages:
169  	 *       - \ref SCIP_STAGE_INIT
170  	 *       - \ref SCIP_STAGE_FREE
171  	 *
172  	 *  @post After calling this method \SCIP reaches one of the following stages depending on if and when the
173  	 *        interactive shell was closed:
174  	 *        - \ref SCIP_STAGE_PROBLEM if the interactive shell was closed after the problem was created
175  	 *        - \ref SCIP_STAGE_TRANSFORMED if the interactive shell was closed after the problem was transformed
176  	 *        - \ref SCIP_STAGE_PRESOLVING if the interactive shell was closed  during presolving
177  	 *        - \ref SCIP_STAGE_PRESOLVED if the interactive shell was closed after presolve
178  	 *        - \ref SCIP_STAGE_SOLVING if the interactive shell was closed during the tree search
179  	 *        - \ref SCIP_STAGE_SOLVED if the interactive shell was closed after the problem was solved
180  	 *        - \ref SCIP_STAGE_FREE if the interactive shell was closed after the problem was freed
181  	 *
182  	 *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
183  	 */
184  	SCIP_EXPORT
185  	SCIP_RETCODE SCIPstartInteraction(
186  	   SCIP*                 scip                /**< SCIP data structure */
187  	   );
188  	
189  	/**@} */
190  	
191  	#ifdef __cplusplus
192  	}
193  	#endif
194  	
195  	#endif
196