home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / stubfe / stubbm.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  6.3 KB  |  207 lines

  1. /* -*- Mode: C++; tab-width: 8; 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.    stub_bm.c --- stub functions dealing with front-end
  21.                  bookmarks handling.
  22. */
  23.  
  24. #include "structs.h"
  25. #include "ntypes.h"
  26. #include "bkmks.h"
  27.  
  28. /* The list of bookmarks has changed somehow, so any "bookmarks" menu needs to
  29.    be recreated.  This should be a cheap call, just setting a flag in the FE so
  30.    that it knows to recreate the menu later (like, when the user tries to view
  31.    it).  Recreating it immediately would be bad, because this can get called
  32.    much more often than is reasonable. */
  33. void
  34. BMFE_BookmarkMenuInvalid(MWContext* context)
  35. {
  36. }
  37.  
  38.  
  39. /* Edit the given item in the bookmarks property window.  If there is no
  40.    bookmarks property window currently, then the FE should ignore this call.
  41.    If the bookmarks property window is currently displaying some other entry,
  42.    then it should save any changes made to that entry (by calling BM_SetName,
  43.    etc.) before loading up this entry. */
  44. void
  45. BMFE_EditItem(MWContext* context,
  46.           BM_Entry* entry)
  47. {
  48. }
  49.  
  50. /* Use these to know when to allow refresh */
  51. void
  52. BMFE_StartBatch(MWContext* context)
  53. {
  54. }
  55.  
  56. void
  57. BMFE_EndBatch(MWContext* context)
  58. {
  59. }
  60.  
  61. /* The given entry is no longer valid (i.e., the user just deleted it).  So,
  62.    the given pointer is about to become invalid, and the FE should remove any
  63.    references to it it may have.  In particular, if it is the one being edited
  64.    in the bookmarks property window, then the FE should clear that window. */
  65. void
  66. BMFE_EntryGoingAway(MWContext* context,
  67.             BM_Entry* entry)
  68. {
  69. }
  70.  
  71. /* We've finished processing What's Changed.  The What's Changed window should
  72.    change to display the summary of what happened.   It should look something
  73.    like this:
  74.  
  75.              Done checking <157> Bookmarks. 
  76.              <134> documents were reached.
  77.              <27> documents have changed and are marked in blue.
  78.  
  79.              [ OK ]
  80.  
  81.    When the user clicks on the OK, the FE should just take down the window.
  82.    (It doesn't matter if the FE calls BM_CancelWhatsChanged(); it will be a
  83.    no-op in this situtation.) */
  84.  
  85. void
  86. BMFE_FinishedWhatsChanged(MWContext* context,
  87.               int32 totalchecked,
  88.               int32 numreached,
  89.               int32 numchanged)
  90. {
  91. }
  92.  
  93. /* return the clipboard contents */
  94. void*
  95. BMFE_GetClipContents(MWContext* context,
  96.              int32* length)
  97. {
  98. }
  99.  
  100. /* The user has requested to view the given url.  Show it to him in, using some
  101.    appropriate context.  Url may be targeted to a different window */
  102. void
  103. BMFE_GotoBookmark(MWContext* context,
  104.           const char* url,
  105.           const char* target)
  106. {
  107. }
  108.  
  109. /* measure the item and assign the width and height required to draw it into
  110.    the widget into width and height.  This is used only by BM_WidestEntry(); if
  111.    you don't need that call, you can just make this an empty stub. */
  112. void
  113. BMFE_MeasureEntry(MWContext* context,
  114.           BM_Entry* entry,
  115.           uint32* width,
  116.           uint32* height)
  117. {
  118. }
  119.  
  120. /* Create the bookmarks property window.  If one already exists, just bring it
  121.    to the front.  This will always be immediately followed by a call to
  122.    BMFE_EditItem(). */
  123. void
  124. BMFE_OpenBookmarksWindow(MWContext* context)
  125. {
  126. }
  127.  
  128. /* Create the find dialog, and fill it in as specified in the given
  129.    structure.  When the user hits the "Find" button in the dialog, call
  130.    BM_DoFindBookmark. */
  131. void*
  132. BMFE_OpenFindWindow(MWContext* context,
  133.             BM_FindInfo* findInfo)
  134. {
  135. }
  136.  
  137. /* Refresh each cell between and including first and last in the bookmarks
  138.    widget (if now is TRUE, the FE is expected to redraw them BEFORE returning,
  139.    otherwise the FE can simply invalidate them and wait for the redraw to
  140.    happen).  If BM_LAST_CELL is passed in as last, then it means paint from
  141.    the first to the end. */
  142. void
  143. BMFE_RefreshCells(MWContext* context,
  144.           int32 first,
  145.           int32 last,
  146.           XP_Bool now)
  147. {
  148. }
  149.  
  150. /* Make sure that the given entry is visible. */
  151. void
  152. BMFE_ScrollIntoView(MWContext* context,
  153.             BM_Entry* entry)
  154. {
  155. }
  156.  
  157. /* Save the given bucket o' bits as the clipboard.  This same bucket needs to
  158.    be returned later if BMFE_GetClipContents() is called. */
  159. void
  160. BMFE_SetClipContents(MWContext* context,
  161.              void* buffer,
  162.              int32 length)
  163. {
  164. }
  165.  
  166. /* Resize the widget to accomodate "visibleCount" number of entries vertically
  167.    and the width of widest entry the actual widget should NOT change size, just
  168.    the size of the scrollable area under it */
  169. void
  170. BMFE_SyncDisplay(MWContext* context)
  171. {
  172. }
  173.  
  174. /* We're in the process of doing a What's Changed operation.  The What's
  175.    Changed window should update to display the URL, the percentage (calculate
  176.    as done*100/total), and the total estimated time (given here as a
  177.    pre-formatted string).  The What's Changed window should end up looking
  178.    something like this:
  179.  
  180.              Checking <URL>... (<13> left)
  181.              {=====================    } (progress bar)
  182.  
  183.              Estimated time remaining: <2 hours 13 minutes>
  184.              (Remaining time depends on the sites selected and 
  185.              the network traffic).
  186.  
  187.  
  188.              [ Cancel ]
  189.  
  190.    It's up to the FE to notice the first time this is called and change its
  191.    window to display the info instead of the initial What's Changed screen.
  192.  
  193.    If the user ever hits Cancel (or does something equivilant, like destroys
  194.    the window), the FE must call BM_CancelWhatsChanged(). */
  195.  
  196. void
  197. BMFE_UpdateWhatsChanged(MWContext* context,
  198.             const char* url, /* If NULL, just display
  199.                         "Checking..." */
  200.             int32 done,
  201.             int32 total,
  202.             const char* totaltime)
  203. {
  204. }
  205.  
  206.  
  207.