home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / include / shistele.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  5.4 KB  |  133 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.  
  20. #ifndef SHISTELE_H
  21. #define SHISTELE_H
  22.  
  23. #include "xp_list.h"
  24.  
  25. /*
  26. ** This structure holds pointer so all saved data in the history. It is
  27. ** also used by URL_Structs and is ultimately fed to layout.
  28. **
  29. ** Warning: Don't change the names of the fields because they're used by
  30. ** macros.
  31. */
  32. typedef struct SHIST_SavedData {
  33.     void*        FormList;        /* layout data to recreate forms */
  34.     void*        EmbedList;        /* layout data to recreate embeds and applets */
  35.     void*        Grid;            /* layout data to recreate grids */
  36. #ifdef MOCHA
  37.     void*        Window;            /* window object for grid being resized */
  38.  
  39.     /* XXX none of this would be necessary if frameset docs were reparsed */
  40.     void*        OnLoad;            /* JavaScript onload event handler source */
  41.     void*        OnUnload;        /* JavaScript onunload event handler source */
  42.     void*        OnFocus;        /* JavaScript onfocus event handler source */
  43.     void*        OnBlur;            /* JavaScript onblur event handler source */
  44.     void*        OnHelp;            /* JavaScript onhelp event handler source */
  45.     void*        OnMouseOver;        /* JavaScript onmouseover event handler source */
  46.     void*        OnMouseOut;        /* JavaScript onmouseout event handler source */
  47.     void*        OnDragDrop;        /* JavaScript ondragdrop event handler source */
  48.     void*        OnMove;            /* JavaScript onmove event handler source */
  49.     void*        OnResize;        /* JavaScript onresize event handler source */
  50.     void*           style_stack;            /* JSSS style stack info */
  51. #endif
  52. } SHIST_SavedData;
  53.  
  54. /*
  55.     This structure encapsulates all of the information needed for the
  56.     session history.  It should contain stuff like a list of all of the
  57.     documents in the current history and a pointer to where the currently
  58.     viewed document sits in the chain.
  59.  
  60.     WARNING!!  Some slots of this structure are shared with URL_Struct and
  61.     net_CacheObject.  If you add a slot, decide whether it needs to be
  62.     shared as well.
  63. */
  64.  
  65. struct _History_entry {
  66.     char * title;                   /* title for this entry */
  67.     char * address;                 /* URL address string */
  68.     char * content_name;            /* Server-provided "real name", used for
  69.                                        default file name when saving. */
  70.     int    method;                  /* method of acessing URL */
  71.     char * referer;                    /* What document points to this url */
  72.     char * post_data;               /* post data */
  73.     int32  post_data_size;          /* post data size */
  74.     Bool   post_data_is_file;       /* is the post data a filename? */
  75.     char * post_headers;            /* content type for posted data */
  76.     int32  position_tag;            /* layout specific data for determining
  77.                                      * where in the document the user was
  78.                                      */
  79.     time_t last_modified;           /* time of last modification */
  80.     time_t last_access;             /* time of last access */
  81.     int    history_num;                 /* special hack to add navigation */
  82.  
  83.     SHIST_SavedData savedData;        /* layout data */
  84.  
  85.     PRPackedBool
  86.            is_binary,               /* is this a binary object pretending
  87.                                      * to be HTML? 
  88.                                      */
  89.            is_active,               /* is it an active stream? */
  90.            is_netsite,              /* did it come from netsite? */
  91.            replace;                 /* did it come from netsite? */
  92.  
  93.     int    transport_method;        /* network, disk cache, memory cache */
  94.  
  95.     uint32  refresh;                /* refresh interval */
  96.     char   *refresh_url;            /* URL to refresh */
  97.     char   *wysiwyg_url;            /* URL for WYSIWYG printing/saving */
  98.  
  99.     /* Security information */
  100.     int     security_on;                  /* is security on? */
  101.     char   *key_cipher;                      /* cipher being used */
  102.     int     key_size;                      /* size of the total key (in bits) */
  103.     int     key_secret_size;              /* secret portion (in bits) */
  104.     char   *key_issuer;                      /* XXX obsolete */
  105.     char   *key_subject;                    /* XXX obsolete */
  106.  
  107.     /* Unique identifier */
  108.     int32    unique_id;
  109.     int32    ref_count;
  110.  
  111.     /* Page services*/
  112.     char    *page_services_url;        /* If it supports services, what link is used */
  113.  
  114.     /* HTTP_11 support*/
  115.     char    *etag;                    /* Unique entity tag */
  116.     char    *origin_url;            /* original referrer of javascript: URL */
  117. };
  118.  
  119. #define SHIST_CAME_FROM_NETWORK       0
  120. #define SHIST_CAME_FROM_DISK_CACHE    1
  121. #define SHIST_CAME_FROM_MEMORY_CACHE  2
  122.  
  123. struct History_ {
  124.     XP_List  * list_ptr;        /* pointer to linked list */
  125.     int         cur_doc;        /* an index into the list that points to the current document */
  126.     History_entry *cur_doc_ptr;  /* a ptr to the current doc entry */
  127.     int32       num_entries;    /* size of the history list */
  128.     int32        max_entries;    /* maximum size of list; -1 == no limit */
  129. };
  130.  
  131.  
  132. #endif /* SHISTELE_H */
  133.