home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / include / glhist.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  5.5 KB  |  189 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 GLHIST_H
  20. #define GLHIST_H
  21.  
  22. #include "ntypes.h"
  23.  
  24. typedef enum gh_SortColumn 
  25. {
  26.    eGH_NoSort = -1,
  27.    eGH_NameSort,
  28.    eGH_LocationSort,
  29.    eGH_FirstDateSort,
  30.    eGH_LastDateSort,
  31.    eGH_VisitCountSort
  32. }gh_SortColumn;
  33.  
  34. typedef struct _gh_HistEntry 
  35. {
  36.     char *  address;
  37.     time_t  last_accessed;
  38.     time_t  first_accessed;
  39.     int32   iCount;
  40.     int32   iFlags;
  41.     char *  pszName;
  42. }gh_HistEntry;
  43.  
  44. typedef struct _gh_HistEntryData
  45. {
  46.     time_t  last_accessed;
  47.     time_t  first_accessed;
  48.     int32   iCount;
  49.     int32   iFlags;    
  50.     char *  pszName;
  51. }gh_HistEntryData;
  52.  
  53. typedef enum gh_FilterOp 
  54. {
  55.    eGH_FOEquals,
  56.    eGH_FOEqualsNot,
  57.    
  58.    eGH_FOGreater,
  59.    eGH_FOGreaterEqual,
  60.    eGH_FOLess,
  61.    eGH_FOLessEqual,
  62.    
  63.    eGH_FOHas,
  64.    eGH_FOHasNot
  65. }gh_FilterOp;
  66.  
  67. typedef enum gh_FilterLogOp
  68. {
  69.    eGH_FLOAnd,
  70.    eGH_FLOOr
  71. }gh_FilterLogOp;
  72.  
  73. typedef struct _gh_FilterCondition
  74. {
  75.    enum gh_SortColumn enCol;
  76.    enum gh_FilterOp   enOp;
  77.    
  78.    union
  79.    {
  80.       char *  pszTest;
  81.       int32   iTest;
  82.    } tests;
  83. }gh_FilterCondition;
  84.  
  85. typedef struct _gh_Filter
  86. {
  87.    int32                         iNumConditions;
  88.    gh_FilterCondition *          pConditions;
  89.    gh_FilterLogOp *              enOps;
  90. }gh_Filter;
  91.  
  92. typedef struct _gh_NotifyMsg
  93. {
  94.    int32   iNotifyMsg;
  95.    char *  pszKey;
  96.    void *  pUserData;
  97. } gh_NotifyMsg;
  98.  
  99. typedef void *  GHHANDLE;
  100. typedef void *  GHURHANDLE;
  101.  
  102. #define GH_NOTIFY_UPDATE   1
  103. #define GH_NOTIFY_DELETE   2
  104.  
  105. #ifdef XP_WIN
  106.  typedef int (__cdecl *GHISTORY_NOTIFYPROC)( gh_NotifyMsg *pMsg );
  107. #else
  108.  typedef int (*GHISTORY_NOTIFYPROC)( gh_NotifyMsg *pMsg );
  109. #endif
  110.  
  111. XP_BEGIN_PROTOS
  112.  
  113. /* if the url was found in the global history then the then number of seconds since
  114.  * the last access is returned.  if the url is not found -1 is returned
  115.  */
  116. extern int GH_CheckGlobalHistory(char * url);
  117.  
  118. /* add or update the url in the global history
  119.  */
  120. extern void GH_UpdateGlobalHistory(URL_Struct * URL_s);
  121.  
  122. /* save the global history to a file and remove the list from memory
  123.  */
  124. /*extern void GH_CleanupGlobalHistory(void);*/
  125.  
  126. /* save the global history to a file and remove the list from memory
  127.  */
  128. extern void GH_SaveGlobalHistory(void);
  129.  
  130. /* free the global history list
  131.  */
  132. extern void GH_FreeGlobalHistory(void);
  133.  
  134. /* clear the entire global history list
  135.  */
  136. extern void GH_ClearGlobalHistory(void);
  137.  
  138. #if defined(XP_MAC) || defined(XP_UNIX)
  139. /* set the maximum time for an object in the Global history in
  140.  * number of seconds
  141.  */
  142. extern void GH_SetGlobalHistoryTimeout(int32 timeout_interval);
  143. #endif
  144.  
  145. /* start global history tracking
  146.  */
  147. extern void GH_InitGlobalHistory(void);
  148.  
  149. /* create an HTML stream and push a bunch of HTML about
  150.  * the global history
  151.  *
  152.  * returns -1
  153.  */
  154. extern int NET_DisplayGlobalHistoryInfoAsHTML( MWContext *context, URL_Struct *URL_s, int format_out );
  155.  
  156. /* 
  157. // Context/Handle based functions to retrieve a pseudo cursor on the
  158. // Global History list (using a specified sort/index).
  159. */
  160. extern GHHANDLE        GH_GetContext( enum gh_SortColumn   enGHSort, 
  161.                                       gh_Filter *          pFilter, 
  162.                                       GHISTORY_NOTIFYPROC  pfNotifyProc,
  163.                                       GHURHANDLE           hUR,                            
  164.                                       void *               pUserData );
  165. extern void            GH_ReleaseContext( GHHANDLE pContext, Bool bReleaseUR );
  166. extern gh_HistEntry *  GH_GetRecord( GHHANDLE pContext, uint32 uRow );
  167. extern void            GH_DeleteRecord( GHHANDLE pContext, uint32 uRow, Bool bGroup );
  168. extern uint32          GH_GetNumRecords( GHHANDLE pContext );
  169. extern gh_SortColumn   GH_GetSortField( GHHANDLE pContext );
  170. extern int             GH_UpdateURLTitle( URL_Struct *pUrl, char *pszTitle, Bool bFrameCell );
  171. extern int32           GH_GetRecordNum( GHHANDLE pContext, char *pszLocation );
  172. extern int             GH_GetMRUPage( char *pszURL, int iMaxLen );
  173. extern void            GH_FileSaveAsHTML( GHHANDLE pContext, MWContext *pMWContext );
  174. extern GHURHANDLE      GH_GetURContext( GHHANDLE pContext );
  175. extern void            GH_SupportUndoRedo( GHHANDLE pContext );
  176. extern void            GH_Undo( GHHANDLE pContext );
  177. extern void            GH_Redo( GHHANDLE pContext );
  178. extern Bool            GH_CanUndo( GHHANDLE pContext );
  179. extern Bool            GH_CanRedo( GHHANDLE pContext );
  180.  
  181. /* AutoComplete stuff */
  182. enum autoCompStatus {foundDone, notFoundDone, stillSearching, dontCallOnIdle};
  183. extern enum autoCompStatus urlMatch(const char *criteria, char **result, Bool freshStart, Bool scroll);
  184. extern void NET_RegisterEnableUrlMatchCallback(void);
  185.  
  186. XP_END_PROTOS
  187.  
  188. #endif /* GLHIST_H */
  189.