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   dialog.h
26   	 * @ingroup INTERNALAPI
27   	 * @brief  internal methods for user interface dialog
28   	 * @author Tobias Achterberg
29   	 */
30   	
31   	/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32   	
33   	#ifndef __SCIP_DIALOG_H__
34   	#define __SCIP_DIALOG_H__
35   	
36   	
37   	#include "scip/def.h"
38   	#include "scip/type_retcode.h"
39   	#include "scip/type_set.h"
40   	#include "scip/type_dialog.h"
41   	#include "scip/pub_dialog.h"
42   	
43   	#ifdef __cplusplus
44   	extern "C" {
45   	#endif
46   	
47   	/*
48   	 * dialog handler
49   	 */
50   	
51   	/** copies the given dialog to a new scip */
52   	SCIP_RETCODE SCIPdialogCopyInclude(
53   	   SCIP_DIALOG*          dialog,             /**< dialog */
54   	   SCIP_SET*             set                 /**< SCIP_SET of SCIP to copy to */
55   	   );
56   	
57   	/** creates a dialog handler */
58   	SCIP_RETCODE SCIPdialoghdlrCreate(
59   	   SCIP_SET*             set,                /**< global SCIP settings */
60   	   SCIP_DIALOGHDLR**     dialoghdlr          /**< pointer to store dialog handler */
61   	   );
62   	
63   	/** frees a dialog handler and it's dialog tree */
64   	SCIP_RETCODE SCIPdialoghdlrFree(
65   	   SCIP*                 scip,               /**< SCIP data structure */
66   	   SCIP_DIALOGHDLR**     dialoghdlr          /**< pointer to dialog handler */
67   	   );
68   	
69   	/** executes the root dialog of the dialog handler */
70   	SCIP_RETCODE SCIPdialoghdlrExec(
71   	   SCIP_DIALOGHDLR*      dialoghdlr,         /**< dialog handler */
72   	   SCIP_SET*             set                 /**< global SCIP settings */
73   	   );
74   	
75   	/** makes given dialog the root dialog of dialog handler; captures dialog and releases former root dialog */
76   	SCIP_RETCODE SCIPdialoghdlrSetRoot(
77   	   SCIP*                 scip,               /**< SCIP data structure */
78   	   SCIP_DIALOGHDLR*      dialoghdlr,         /**< dialog handler */
79   	   SCIP_DIALOG*          dialog              /**< dialog to be the root */
80   	   );
81   	
82   	
83   	
84   	
85   	/*
86   	 * dialog
87   	 */
88   	
89   	/** creates and captures a user interface dialog */
90   	SCIP_RETCODE SCIPdialogCreate(
91   	   SCIP_DIALOG**         dialog,             /**< pointer to store the dialog */
92   	   SCIP_DECL_DIALOGCOPY  ((*dialogcopy)),    /**< copy method of dialog or NULL if you don't want to copy your plugin into sub-SCIPs */
93   	   SCIP_DECL_DIALOGEXEC  ((*dialogexec)),    /**< execution method of dialog */
94   	   SCIP_DECL_DIALOGDESC  ((*dialogdesc)),    /**< description output method of dialog, or NULL */
95   	   SCIP_DECL_DIALOGFREE  ((*dialogfree)),    /**< destructor of dialog to free user data, or NULL */
96   	   const char*           name,               /**< name of dialog: command name appearing in parent's dialog menu */
97   	   const char*           desc,               /**< description of dialog used if description output method is NULL */
98   	   SCIP_Bool             issubmenu,          /**< is the dialog a sub-menu? */
99   	   SCIP_DIALOGDATA*      dialogdata          /**< user defined dialog data */
100  	   );
101  	
102  	/** captures a dialog */
103  	void SCIPdialogCapture(
104  	   SCIP_DIALOG*          dialog              /**< dialog */
105  	   );
106  	
107  	/** releases a dialog */
108  	SCIP_RETCODE SCIPdialogRelease(
109  	   SCIP*                 scip,               /**< SCIP data structure */
110  	   SCIP_DIALOG**         dialog              /**< pointer to dialog */
111  	   );
112  	
113  	/** executes dialog */
114  	SCIP_RETCODE SCIPdialogExec(
115  	   SCIP_DIALOG*          dialog,             /**< dialog */
116  	   SCIP_SET*             set,                /**< global SCIP settings */
117  	   SCIP_DIALOGHDLR*      dialoghdlr,         /**< dialog handler */
118  	   SCIP_DIALOG**         nextdialog          /**< pointer to store the next dialog to process */
119  	   );
120  	
121  	/** adds a sub-dialog to the given dialog as menu entry and captures the sub-dialog */
122  	SCIP_RETCODE SCIPdialogAddEntry(
123  	   SCIP_DIALOG*          dialog,             /**< dialog */
124  	   SCIP_SET*             set,                /**< global SCIP settings */
125  	   SCIP_DIALOG*          subdialog           /**< sub-dialog to add as menu entry in dialog */
126  	   );
127  	
128  	#ifdef __cplusplus
129  	}
130  	#endif
131  	
132  	#endif
133