home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / layout / lo_funcs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  6.6 KB  |  181 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifndef _LayoutFunctions_
  20. #define _LayoutFunctions_
  21. /*
  22.  * The idea is for the FE to create and fill in one of these
  23.  * structures, and then pass it to layout when creating the
  24.  * DocumentContext.  The document context will keep
  25.  * a pointer to this structure, and use the functions in it to
  26.  * interface with the FE.  The fe_context which is the first parameter
  27.  * of each of these functions, is the opaque object that the FE will
  28.  * use to determine which window this command is directed at, the fe_context
  29.  * object is passed as a separate value to LO_CreateDocumentContext() so
  30.  * that multiple fe_context objects can share the same fe_functions
  31.  * structure.
  32.  *
  33.  * Eventually this should be replaced with a JMC interface.
  34.  */
  35.  
  36. #include "lo_ele.h"
  37. #include "URL.h"
  38.  
  39. typedef struct fe_functions {
  40.     void (*ShiftImage)(void *fe_context,
  41.                         LO_ImageStruct *image);
  42.  
  43.     void (*GetJavaAppSize)(void *fe_context,
  44.             LO_JavaAppStruct *java, URL_ReloadMethod force_reload);
  45.     void (*GetEmbedSize)(void *fe_context,
  46.             LO_EmbedStruct *embed, URL_ReloadMethod force_reload);
  47.     void (*GetImageInfo)(void *fe_context,
  48.             LO_ImageStruct *image, URL_ReloadMethod force_reload);
  49.  
  50.     int (*GetTextInfo)(void *fe_context,
  51.             LO_TextStruct *text, LO_TextInfo *text_info);
  52.     char *(*TranslateISOText)(void *fe_context,
  53.             int charset, char *ISO_Text);
  54.  
  55.     void (*DisplayText)(void *fe_context,
  56.             int iLocation, LO_TextStruct *text, XP_Bool need_bg);
  57.     void (*DisplaySubtext)(void *fe_context,
  58.             int iLocation, LO_TextStruct *text,
  59.             int32 start_pos, int32 end_pos, XP_Bool need_bg);
  60.     void (*DisplayEmbed)(void *fe_context,
  61.             int iLocation, LO_EmbedStruct *embed);
  62.     void (*DisplayJavaApp)(void *fe_context,
  63.             int iLocation, LO_JavaAppStruct *java_app);
  64.     void (*DisplayImage)(void *fe_context,
  65.             int iLocation, LO_ImageStruct *image);
  66.     void (*DisplaySubImage)(void *fe_context,
  67.             int iLocation, LO_ImageStruct *image,
  68.             int32 x, int32 y, uint32 width, uint32 height);
  69.     void (*DisplayEdge)(void *fe_context,
  70.             int iLocation, LO_EdgeStruct *edge);
  71.     void (*DisplayTable)(void *fe_context,
  72.             int iLocation, LO_TableStruct *table);
  73.     void (*DisplaySubDoc)(void *fe_context,
  74.             int iLocation, LO_SubDocStruct *subdoc);
  75.     void (*DisplayCell)(void *fe_context,
  76.             int iLocation, LO_CellStruct *cell);
  77.     void (*DisplayLineFeed)(void *fe_context,
  78.         int iLocation, LO_LinefeedStruct *lfeed, XP_Bool need_bg);
  79.     void (*DisplayHR)(void *fe_context,
  80.             int iLocation, LO_HorizRuleStruct *hrule);
  81.     void (*DisplayBullet)(void *fe_context,
  82.             int iLocation, LO_BulletStruct *bullet);
  83.     void (*DisplayFormElement)(void *fe_context,
  84.             int iLocation, LO_FormElementStruct *form_element);
  85.  
  86.     void (*GetFormElementInfo)(void *fe_context,
  87.             LO_FormElementStruct *form_element);
  88.     void (*GetFormElementValue)(void *fe_context,
  89.             LO_FormElementStruct *form_element, XP_Bool hide);
  90.     void (*FormTextIsSubmit)(void *fe_context,
  91.             LO_FormElementStruct *single_text_ele);
  92.     void (*FreeFormElement)(void *fe_context,
  93.             LO_FormElementData *form_data);
  94.     void (*ResetFormElement)(void *fe_context,
  95.             LO_FormElementStruct *form_element);
  96.     void (*SetFormElementToggle)(void *fe_context,
  97.             LO_FormElementStruct *form_element, XP_Bool toggle);
  98.  
  99.     void (*FreeEdgeElement)(void *fe_context,
  100.             LO_EdgeStruct *edge);
  101.     void (*FreeEmbedElement)(void *fe_context,
  102.             LO_EmbedStruct *embed);
  103.     void (*HideJavaAppElement)(void *fe_context,
  104.             void *session_data);
  105.     void (*FreeImageElement)(void *fe_context,
  106.             LO_ImageStruct *image);
  107.  
  108.     void (*GetFullWindowSize)(void *fe_context,
  109.             int32 *width, int32 *height);
  110.     void (*GetEdgeMinSize)(void *fe_context,
  111.             int32 *size
  112. #if defined(XP_WIN) || defined(XP_OS2)
  113.             , Bool no_edge
  114. #endif
  115.             );
  116.     void (*LoadGridCellFromHistory)(void *fe_context,
  117.             void *hist, URL_ReloadMethod force_reload);
  118.     /* The void * return value here is an opaque fe_context
  119.      * object for the newly created grid window. */
  120.     void *(*MakeGridWindow)(void *fe_context,
  121.             void *history,
  122.             int32 x, int32 y, int32 width, int32 height,
  123.             char *url_str, char *window_name, int8 scrolling,
  124.             URL_ReloadMethod force_reload
  125. #if defined (XP_WIN) || defined (XP_MAC) || defined(XP_OS2)
  126.             , Bool no_edge
  127. #endif
  128.             );
  129.     void (*RestructureGridWindow)(void *fe_context,
  130.             int32 x, int32 y, int32 width, int32 height);
  131.     void *(*FreeGridWindow)(void *fe_context,
  132.             XP_Bool save_history);
  133.  
  134.     Bool (*SecurityDialog)(void *fe_context,
  135.             int message);
  136.  
  137.     void (*GetDocPosition)(void *fe_context,
  138.             int location, int32 *x, int32 *y);
  139.     void (*SetDocPosition)(void *fe_context,
  140.             int location, int32 x, int32 y);
  141.     void (*ScrollDocTo)(void *fe_context,
  142.             int location, int32 x, int32 y);
  143.     void (*SetDocDimension)(void *fe_context,
  144.             int location, int32 width, int32 height);
  145.     void (*ClearView)(void *fe_context,
  146.             int location);
  147.     void (*SetDocTitle)(void *fe_context,
  148.             char *title);
  149.     void (*SetBackgroundColor)(void *fe_context,
  150.             uint8 red, uint8 green, uint8 blue);
  151.  
  152.     void (*SetProgressBarPercent)(void *fe_context,
  153.             int32 percent);
  154.  
  155.     void (*LayoutNewDocument)(void *fe_context,
  156.         URL *url_struct, int32 *width, int32 *height,            /* tj */
  157.         int32 *margin_width, int32 *margin_height);
  158.     void (*FinishedLayout)(void *fe_context);
  159.     void (*BeginPreSection)(void *fe_context);
  160.     void (*EndPreSection)(void *fe_context);
  161.  
  162.     void (*GetTextFrame)(void *fe_context,
  163.         LO_TextStruct *text, int32 start, int32 end, XP_Rect *frame);
  164.  
  165.     void (*EraseBackground)(void *fe_context,
  166.             int location, int32 x, int32 y,
  167.             uint32 width, uint32 height,
  168.             LO_Color *bg, LO_ImageStruct *image);
  169.  
  170.     PRBool (*HandleLayerEvent)(void *fe_context,
  171.             CL_Layer *layer, CL_Event *event);
  172.  
  173.     void (*GetOrigin)(void *fe_context,
  174.             int location, int32 *x, int32 *y);
  175.     void (*SetOrigin)(void *fe_context,
  176.             int location, int32 x, int32 y);
  177.  
  178. } FE_Functions; /* tj */
  179.  
  180. #endif /* _LayoutFunctions_ */
  181.