Toolbars 4.38 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   : Toolbars.h                             */
17
/*                                                 */
18
/* Purpose: Toolbar-related functions for the      */
19 20
/*          browser.                               */
/*                                                 */
21
/* Author : A.D.Hodgkinson                         */
22 23
/*                                                 */
/* History: 21-Nov-96: Created.                    */
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
/***************************************************/

/* Magic number definitions */

#define InternalBottomLeft 1
#define InternalTopLeft    2
#define ExternalBottomLeft 4
#define ExternalTopLeft    8

/* The range of messages that can be in the status bar. */
/* These are defined in order of priority, the first    */
/* having the lowest. Items which decay are not worked  */
/* out by toolbars_update_status, and must be set       */
/* explicitly with toolbars_update_specific_status.     */

typedef enum status_type
{
  Toolbars_Status_NoType = -1, /* To indicate no current status at all */
  Toolbars_Status_Ready,       /* Just 'ready', no other info          */
  Toolbars_Status_Viewing,     /* Viewing '(URL / title)'              */
  Toolbars_Status_Formatting,  /* Formatting '(URL)'                   */
  Toolbars_Status_Processing,  /* Processing '(URL)'                   */
  Toolbars_Status_GetPics,     /* Number of images being fetched       */
  Toolbars_Status_Fetching,    /* Fetching '(URL)'                     */
  Toolbars_Status_LinkTo,      /* Showing a link to something (decays) */
  Toolbars_Status_Help         /* Showing interactive help (decays)    */
}
status_type;

/* Function prototypes */

ObjectId          toolbars_get_upper              (browser_data * b);
ObjectId          toolbars_get_lower              (browser_data * b);

58
void              toolbars_set_presence           (browser_data * b, unsigned int flags);
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
void              toolbars_move_gadgets           (browser_data * p);

int               toolbars_animation              (int eventcode, WimpPollBlock * b, IdBlock * idb, browser_data * handle);
int               toolbars_animation_drift        (int eventcode, WimpPollBlock * b, IdBlock * idb, browser_data * handle);
int               toolbars_animate_slow           (int eventcode, WimpPollBlock * b, IdBlock * idb, void * handle);

void              toolbars_hide_cgi               (char * url);
void              toolbars_hide_internal          (char * iurl);

_kernel_oserror * toolbars_update_status          (browser_data * b, status_type type);
_kernel_oserror * toolbars_cancel_status          (browser_data * b, status_type type);
int               toolbars_timeout_status         (int eventcode, WimpPollBlock * b, IdBlock * idb, browser_data * handle);
_kernel_oserror * toolbars_remove_status_item     (browser_data * b, browser_data * ancestor);

void              toolbars_update_progress        (browser_data * b);
void              toolbars_update_url             (browser_data * b);
75 76
_kernel_oserror * toolbars_update_dialler_time    (browser_data * b);
_kernel_oserror * toolbars_update_dialler_status  (browser_data * b);
77 78 79 80 81 82 83 84 85 86 87 88

int               toolbars_button_height          (browser_data * b);
int               toolbars_url_height             (browser_data * b);
int               toolbars_status_height          (browser_data * b);

_kernel_oserror * toolbars_set_button_states      (browser_data * b);
_kernel_oserror * toolbars_set_all_button_states  (void);

void              toolbars_merged_to_status       (browser_data * b, ObjectId t);
void              toolbars_merged_to_url          (browser_data * b, ObjectId t);
void              toolbars_set_bistate_state      (browser_data * b, ObjectId t, int state);
void              toolbars_set_tristate_state     (browser_data * b, ObjectId t, int state);