Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtappbuilder / src / ab / proj.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23
24 /*
25  *      $XConsortium: proj.h /main/3 1995/11/06 17:45:59 rswiston $
26  *
27  * @(#)proj.h   1.11 16 Feb 1994        cde_app_builder/src/
28  *
29  *      RESTRICTED CONFIDENTIAL INFORMATION:
30  *      
31  *      The information in this document is subject to special
32  *      restrictions in a confidential disclosure agreement between
33  *      HP, IBM, Sun, USL, SCO and Univel.  Do not distribute this
34  *      document outside HP, IBM, Sun, USL, SCO, or Univel without
35  *      Sun's specific written approval.  This document and all copies
36  *      and derivative works thereof must be returned or destroyed at
37  *      Sun's request.
38  *
39  *      Copyright 1993 Sun Microsystems, Inc.  All rights reserved.
40  *
41  */
42
43 /*
44  * proj.h
45  * Header file for the project window
46  */
47
48 #ifndef _PROJ_H_
49 #define _PROJ_H_
50
51 #include <Xm/Xm.h>
52 #include <ab_private/ui_util.h>
53 #include "dtb_utils.h"
54
55 #define IMPORT_BY_REF   0
56 #define IMPORT_BY_COPY  1
57 #define IMPORT_AS_BIL   2
58 #define IMPORT_AS_UIL   3
59
60 typedef enum { 
61     AB_OPEN_PROJ_CHOOSER = 0, 
62     AB_SAVE_PROJ_AS_CHOOSER,
63     AB_IMPORT_CHOOSER, 
64     AB_EXPORT_CHOOSER,
65     AB_SAVE_MOD_AS_CHOOSER,
66     AB_CHOOSER_TYPE_NUM_VALUES
67 } AB_CHOOSER_TYPE; 
68
69 typedef enum
70 {
71     PROJ_STATUS_MOD_PATH,
72     PROJ_STATUS_PROJ_PATH, /* number of valid values - MUST BE LAST */
73     PROJ_STATUS_NUM_VALUES
74         /* ANSI: no comma after last enum item! */
75 } PROJ_STATUS_INFO;
76
77 typedef struct {
78     Widget              child;
79     AB_CHOOSER_TYPE     chooser_type;
80     BOOL                ImportAsBil;
81     BOOL                ImportByCopy;
82     BOOL                writeEncapsulated;
83 } ChooserInfoRec, *ChooserInfo;
84     
85
86 /*
87  * This is only used for projects right now, but it can be used for other
88  * types of saves, as well.
89  */
90 #define AB_SAVE_CANCELLED       (-1)    /* errors are negative */
91 #define AB_SAVE_NORMAL          1
92 #define AB_SAVE_SAVE_AS         2
93
94 typedef int ProjSaveCallbackFuncRec(int status);
95 typedef ProjSaveCallbackFuncRec *ProjSaveCallbackFunc;
96
97 int     proj_init(void);
98
99 void    proj_add_objects(
100             AB_OBJ      *obj
101         );
102
103 void    proj_delete_objects(
104             AB_OBJ      *obj
105         );
106
107 void    proj_register_actions(
108             XtAppContext app
109         );
110
111 void    proj_select(
112             AB_OBJ      *module
113         );
114
115 void    proj_deselect(
116             AB_OBJ      *module
117         );
118
119 void    proj_toggle_select(
120             AB_OBJ      *module
121         );
122
123 extern int      proj_set_project(
124                     ABObj       project
125                 );
126
127 extern int      proj_destroy_project(
128                     ABObj       proj
129                 );
130
131 extern ABObj    proj_get_project(
132                 );
133
134 extern int      proj_set_cur_module(
135                     ABObj       module
136                 );
137
138 extern ABObj    proj_get_cur_module(
139                 );
140
141 extern int      proj_rename_module(
142                     ABObj    module,
143                     STRING   name
144                 );
145
146 extern void     proj_update_node(
147                     ABObj       obj
148                 );
149
150 extern int      proj_update_stat_region(
151                     PROJ_STATUS_INFO    type,
152                     STRING              value
153                 );
154
155 extern BOOL     proj_check_unsaved_edits(
156                     ABObj       root 
157                 );
158
159 extern void     proj_create_new_proj(
160                     STRING      proj_name
161                 );
162
163 extern void     proj_name_proj( void ); 
164
165 extern int      proj_set_files_exploded(ABObj project);
166
167 extern int      proj_unset_files_exploded(ABObj project);
168
169 extern void     proj_show_save_as_proj_chooser(
170                     Widget      widget
171                 );
172
173 extern void     proj_show_name_dlg(
174                     ABObj       module,
175                     Widget      parent
176                 );
177
178 extern void     proj_show_export_bil_chooser(
179                     Widget      widget,
180                     ABObj       obj
181                 );
182
183 extern BOOL     proj_is_exploded(ABObj project);
184
185 extern int      proj_overwrite_existing_file(
186                     char                *file,
187                     ABObj               obj,
188                     BOOL                encapsulating,
189                     BOOL                Exporting,
190                     BOOL                changed_dir,
191                     STRING              old_proj_dir,
192                     DTB_MODAL_ANSWER    *answer
193                 );
194
195 extern void     proj_save_needed(
196                         ProjSaveCallbackFunc saveDoneCB /* may be NULL */
197                 );
198
199 extern int      proj_save_encapsulated(
200                     ABObj       obj,
201                     STRING      file_name
202                 );
203
204 extern int      proj_save_exploded(     /* one file per module */
205                     ABObj       obj,
206                     char        *exp_path,
207                     BOOL        changed_dir,
208                     BOOL        encap_file
209                 );
210
211 extern int      proj_show_proj_dir(void);
212
213
214 extern void     proj_open_proj_okCB(
215                     Widget                      widget,
216                     XtPointer                   client_data,
217                     XmSelectionBoxCallbackStruct *call_data
218                 );
219
220 extern void     proj_cancelCB(
221                     Widget                      widget,
222                     XtPointer                   client_data,
223                     XmSelectionBoxCallbackStruct *call_data
224                 );
225
226
227 extern void     proj_unmap_chooserCB(
228                     Widget                      widget,
229                     XtPointer                   client_data,
230                     XtPointer                   call_data
231                 );
232
233 extern void     proj_show_save_proj_as_chooser(
234                     Widget                      widget,
235                     ProjSaveCallbackFunc        saveDoneCB
236                 );
237
238 extern void     proj_show_dialog(void);
239
240 extern void     proj_import_okCB(
241                     Widget                      widget,
242                     XtPointer                   client_data,
243                     XmSelectionBoxCallbackStruct *call_data
244                 );
245
246 extern STRING   proj_cvt_mod_file_to_rel_path(
247                     STRING      mod_path,
248                     STRING      proj_path
249                 );
250
251 extern void     proj_set_menus(
252                     AB_CHOOSER_TYPE     chooser_type,
253                     BOOL                active
254                 );
255
256 extern Boolean  proj_verify_name(
257                     STRING              new_name,
258                     BOOL                ObjIsModule,
259                     DtbMessageData      msgData,
260                     Widget              parent,
261                     ABObj               newObj
262                 );
263
264 #endif /* _PROJ_H_ */