SaveFile 3.65 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
/* Copyright 1997 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/***************************************************/
/* File   : SaveFile.h                             */
/*                                                 */
/* Purpose: Handle the Save File dialogue (actual  */
/*          file saving is done in Save.c). Relies */
/*          on there being only one Save File      */
/*          dialogue open at a time (it is a       */
/*          shared object).                        */
/*                                                 */
/* Author : A.D.Hodgkinson                         */
/*                                                 */
/* History: 03-Sep-97: Created.                    */
27 28 29 30
/*                                                 */
/*          08-Dec-97: Added code for option or    */
/*                     radio buttons and auto      */
/*                     widthing of the dialogue.   */
31 32
/***************************************************/

33
/* Save File dialogue component IDs */
34

35 36 37 38
#define SaveFileDrag                    0x01200
#define SaveFileWrit                    0x01201
#define SaveFileCancel                  0x01202
#define SaveFileOK                      0x01203
39

40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
#define SaveFileOption                  0x01204
#define SaveFileRadio1                  0x01205
#define SaveFileRadio2                  0x01206

#define SaveFileCancelMarkNormal        0x01207
#define SaveFileOKMarkNormal            0x01208
#define SaveFileCancelMarkOption        0x01209
#define SaveFileOKMarkOption            0x0120a
#define SaveFileCancelMarkRadios        0x0120b
#define SaveFileOKMarkRadios            0x0120c

#define SaveFileBottomGapMarker         0x0120d
#define SaveFileRightGapMarker          0x0120e
#define SaveFileAutoWidthMarker         0x0120f

55 56 57
/* Save File dialogue event codes */

#define ESaveFileCancel                 0x01202
58 59 60
#define ESaveFileOK                     0x01203
#define ESaveFileOption                 0x01204
#define ESaveFileRadio                  0x01205
61 62 63

#define ESaveFileToBeShown              0x013ff
#define ESaveFileHidden                 0x013fe
64

65 66 67 68 69 70 71 72 73 74
/* Reason codes for savefile_open_for */

typedef enum savefile_open_reason
{
  save_as_html = 0,
  save_as_draw,
  save_as_text
}
savefile_open_reason;

75 76
/* Function prototypes */

77
_kernel_oserror * savefile_set_leafname          (ObjectId object, ComponentId component, char * leaf);
78
_kernel_oserror * savefile_set_leafname_from_url (ObjectId object, ComponentId component, char * url);
79
_kernel_oserror * savefile_set_filetype          (ObjectId object, ComponentId component, int type, int dont_record);
80

81
_kernel_oserror * savefile_open_for              (browser_data * b, savefile_open_reason reason);
82 83 84 85 86 87 88

int               savefile_to_be_shown           (int eventcode, ToolboxEvent * event, IdBlock * idb, void * handle);
int               savefile_hidden                (int eventcode, ToolboxEvent * event, IdBlock * idb, void * handle);

_kernel_oserror * savefile_close                 (ObjectId ancestor, int do_not_close);

void              savefile_return_dialogue_info  (ObjectId * window, ObjectId * ancestor);
89 90

int               savefile_alternative_selected  (void);