Menus 10.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/* 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   : Menus.h                                */
17 18 19
/*                                                 */
/* Purpose: Handle browser menus.                  */
/*                                                 */
20
/* Author : A.D.Hodgkinson                         */
21 22
/*                                                 */
/* History: 20-Nov-96: Created.                    */
23 24
/***************************************************/

25 26 27 28 29 30 31
/* Main menu (menu from the icon bar icon) component IDs */

#define MainInfo                        0x10000 /* Item leading to the Info window            */
#define MainChoices                     0x10001 /* Item leading to Choices window             */
#define MainOpenURL                     0x10002 /* Item leading to the Open URL dialogue      */
#define MainShowHotlist                 0x10003 /* Item leading to the Hotlist                */
#define MainQuit                        0x10004
32 33 34 35 36 37
#define MainCache                       0x10005 /* Broadcast appropriate AppControl message   */

/* Main menu event codes */

#define EMainCache                      0x10005
#define EMainToBeShown                  0x101ff
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65

/* Choices menu component IDs - these control what defaults any new */
/* browser windows will take.                                       */

#define ChoicesURLBar                   0x10200
#define ChoicesButtonBar                0x10201
#define ChoicesStatusBar                0x10202
#define ChoicesUnderlineLinks           0x10203
#define ChoicesUseDocumentColours       0x10204
#define ChoicesShowForegroundImages     0x10205
#define ChoicesShowBackgroundImages     0x10206
#define ChoicesFullScreen               0x10207

#define ChoicesSave                     0x10208 /* Save the choices (with no save dialogue) */

/* Choices menu event codes */

#define EChoicesToBeShown               0x103ff

/* Document menu (main menu from a browser window) component IDs */
/* - all lead to other submenus.                                 */

#define DocumentFile                    0x10400
#define DocumentNavigate                0x10401
#define DocumentHotlist                 0x10402
#define DocumentResources               0x10403
#define DocumentUtilities               0x10404
#define DocumentDisplay                 0x10405
66
#define DocumentHistory                 0x10406
67
#define DocumentHelp                    0x10407
68 69 70 71 72 73 74 75

/* Document menu event codes */

#define EDocumentToBeShown              0x105ff
#define EDocumentHidden                 0x105fe

/* File menu component IDs */

76 77 78 79 80 81 82 83
#define FileSaveFrame                   0x10600 /* Leading to Save dialogue for saving frame source      */
#define FileSaveParent                  0x10601 /* Leading to Save dialogue for saving parent source     */
#define FileSaveAncestor                0x10607 /* Leading to Save dialogue for saving ancestor source   */
#define FilePrint                       0x10602 /* Item leading to the Print dialogue                    */
#define FileExport                      0x10603 /* Item leading to the Export submenu                    */
#define FileSaveFrameLocation           0x10604 /* Leading to Save dialogue for saving current location  */
#define FileSaveParentLocation          0x10605 /* Leading to Save dialogue for saving parent location   */
#define FileSaveAncestorLocation        0x10606 /* Leading to Save dialogue for saving ancestor location */
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106

/* File menu event codes */

#define EFileToBeShown                  0x107ff

/* Export menu component IDs */

#define ExportAsDraw                    0x10800 /* Leading to Save dialogue for saving page as Draw     */
#define ExportAsText                    0x10801 /* Leading to Save dialogue for saving page as Text     */
#define ExportLink                      0x10802 /* Leading to Save dialogue for saving link             */
#define ExportPicture                   0x10803 /* Leading to Save dialogue for saving foreground image */
#define ExportBackground                0x10804 /* Leading to Save dialogue for saving background image */

/* Export menu event codes */

#define EExportToBeShown                0x109ff

/* Oops, thinking in base 10. Where's 0x10a00, 0x10c00 and 0x10e00? */
/* Reserved for future expansion, of course ;-)                     */
/*                                                                  */
/* Encoding (internationalisation) menu event codes                 */

#define EEncodingSelect                 0x11000 /* Raised when any item in the Encoding menu and its submenus is selected */
107
#define EEncodingFromDocument           0x11001 /* The user selected "From document" at the top of the Encoding menu      */
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122

#define EEncodingToBeShown              0x111ff

/* Navigate menu component IDs */

#define NavigateOpenURL                 0x11200 /* Item leading to the Open URL dialogue */
#define NavigateHome                    0x11201 /* Go to Home page                       */
#define NavigateBack                    0x11202 /* Go back in local history              */
#define NavigateForward                 0x11203 /* Go forward in local history           */
#define NavigateReload                  0x11204 /* Reload this page                      */
#define NavigateLoadAllImages           0x11205 /* Load all images                       */
#define NavigateStopAllFetches          0x11206 /* Stop all fetches                      */

/* Navigate menu event codes */

123
#define ENavigateToBeShown              0x113ff
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172

/* Hotlist menu (from document menu) component IDs */

#define HotlistShowHotlist              0x11400
#define HotlistAddThisPage              0x11401
#define HotlistRemoveThisPage           0x11402
#define HotlistSaveHotlist              0x11403

/* Hotlist menu event codes (NB for showing the hotlist, */
/* use EButtonBarViewHotlist, and for adding items use   */
/* EButtonBarAddToHotlist).                              */

#define EHotlistRemoveThisPage          0x11402
#define EHotlistSaveHotlist             0x11403

#define EHotlistToBeShown               0x115ff
#define EHotlistHidden                  0x115fe
#define EHotlistCancelDrag              0x115fd

#define EHotlistSelectAll               0x115fc
#define EHotlistClearSelect             0x115fb
#define EHotlistOpenAll                 0x115fa
#define EHotlistCloseAll                0x115f9
#define EHotlistDelete                  0x115f8
#define EHotlistShowDescriptions        0x115f7
#define EHotlistShowURLs                0x115f6

/* Utilities menu component IDs */

#define UtilsFindText                   0x11600
#define UtilsURLBar                     0x11601
#define UtilsButtonBar                  0x11602
#define UtilsStatusBar                  0x11603
#define UtilsUnderlineLinks             0x11604
#define UtilsUseDocumentColours         0x11605
#define UtilsShowForegroundImages       0x11606
#define UtilsShowBackgroundImages       0x11607
#define UtilsFullScreen                 0x11608

/* Utilities menu event codes */

#define EUtilsToBeShown                 0x117ff

/* Main hotlist window - miscellaneous menu component IDs. These */
/* are largely independent of other browser operation and so     */
/* only those that absolutely must to be here are included.      */

#define MiscHotlistSaveObject           0x11800

173 174 175 176 177 178
/* History menu component IDs */

#define HistorySaveLocal                0x11a00
#define HistorySaveGlobal               0x11a01
#define HistoryEmptyLocal               0x11a02
#define HistoryEmptyGlobal              0x11a03
179
#define HistoryEmptyImage               0x11a04
180 181 182 183 184

/* History menu event codes */

#define EHistoryToBeShown               0x11bff

185 186 187 188 189 190
/* Help menu event codes */

#define EHelpFromHelpString             0x11dff
#define EHelpReleaseNotes               0x11dfe
#define EHelpAboutPage                  0x11dfd

191 192 193 194 195 196 197 198 199
/* (The range 0x11d00 to 0x11d7f map to Controls file entries */
/* JumpTo00 to JumpTo7f which hold URLs to go to - this event */
/* may thus be used to command a jump to a specific URL from  */
/* any source, not just a menu item. This event is trapped    */
/* through the handle_miscellaneous_event function.           */

#define EHelpGenericBase                0x11d00
#define EHelpGenericTop                 0x11d7f

200 201
/* Function prototypes */

202 203
int            menus_item_selected          (int eventcode,ToolboxEvent * event,IdBlock * idb,void * handle);
int            menus_toggle_tick            (ObjectId o, ComponentId c);
204

205 206 207 208 209 210 211 212
int            menus_show_main              (int eventcode,ToolboxEvent * event,IdBlock * idb,void * handle);
int            menus_show_utils             (int eventcode,ToolboxEvent * event,IdBlock * idb,void * handle);
int            menus_show_file              (int eventcode,ToolboxEvent * event,IdBlock * idb,void * handle);
int            menus_show_navigate          (int eventcode,ToolboxEvent * event,IdBlock * idb,void * handle);
int            menus_show_choices           (int eventcode,ToolboxEvent * event,IdBlock * idb,void * handle);
int            menus_show_export            (int eventcode,ToolboxEvent * event,IdBlock * idb,void * handle);
int            menus_show_document          (int eventcode,ToolboxEvent * event,IdBlock * idb,void * handle);
int            menus_show_history           (int eventcode,ToolboxEvent * event,IdBlock * idb,void * handle);
213

214 215
int            menus_hide_document          (int eventcode,ToolboxEvent * event,IdBlock * idb,void * handle);
int            menus_close_document_if_mine (browser_data * b);
216

217 218
HStream      * menus_document_opened_over   (void);
browser_data * menus_document_over_browser  (void);
219 220 221 222 223


int            menus_help_from_help_string  (int eventcode, ToolboxEvent * event, IdBlock * idb, void * handle);
int            menus_help_release_notes     (int eventcode, ToolboxEvent * event, IdBlock * idb, void * handle);
int            menus_help_about_page        (int eventcode, ToolboxEvent * event, IdBlock * idb, void * handle);
224
void           menus_help_miscellaneous     (browser_data * b, int which);