home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / stubfe / stubdlgs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  6.7 KB  |  241 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.    stubdlgs.c --- stub fe handling of dialog requests from backend (prompt for
  21.                   password, alerts, messages, etc.)
  22. */
  23.  
  24. #include "xp_core.h"
  25. #include "structs.h"
  26. #include "ntypes.h"
  27. #include "fe_proto.h"
  28.  
  29. /*
  30. ** FE_Alert - put up an alert dialog containing the given msg, over
  31. ** context.
  32. **
  33. ** This method should return immediately, without waiting for user
  34. ** input.
  35. */
  36. void
  37. FE_Alert(MWContext *context,
  38.      const char *msg)
  39. {
  40. }
  41.  
  42. /*
  43. ** FE_Message - put up an information dialog containing the given msg,
  44. ** over context.
  45. **
  46. ** This method should return immediately, without waiting for user
  47. ** input.
  48. */
  49. void
  50. FE_Message(MWContext *context,
  51.        const char *msg)
  52. {
  53. }
  54.  
  55.  
  56. /*
  57. ** FE_Confirm - Put up an confirmation dialog (with Yes and No
  58. ** buttons) and return TRUE if Yes/Ok was clicked and FALSE if
  59. ** No/Cancel was clicked.
  60. **
  61. ** This method should not return until the user has clicked on one of
  62. ** the buttons.
  63. */
  64. Bool
  65. FE_Confirm(MWContext *context,
  66.        const char *msg)
  67. {
  68. }
  69.  
  70. /*
  71. ** FE_Prompt - Put up a prompt dialog with the given message, a text
  72. ** field (with the value defaulted to dflt).  The user's response
  73. ** should be returned.
  74. **
  75. ** This method should not return until the user has clicked Ok (the
  76. ** return value should not be NULL) or they clicked Cancel (the return
  77. ** value should be NULL.)
  78. */
  79. char*
  80. FE_Prompt(MWContext *context,
  81.       const char *msg,
  82.       const char *dflt)
  83. {
  84. }
  85.  
  86. /*
  87. ** FE_PromptPassword - Put up a prompt dialog with the given message,
  88. ** a text field.  The user's response should be returned.
  89. **
  90. ** The text field should not show the characters as the user types them.
  91. ** Display them as X's, *'s, spaces, etc.
  92. **
  93. ** This method should not return until the user has clicked Ok (the
  94. ** return value should not be NULL) or they clicked Cancel (the return
  95. ** value should be NULL.)
  96. */
  97. char*
  98. FE_PromptPassword(MWContext *context,
  99.           const char *msg)
  100. {
  101. }
  102.  
  103. /*
  104. ** FE_PromptMessageSubject - Put up a prompt dialog with the given
  105. ** message, a text field.  The user's response should be returned.
  106. **
  107. ** The default value in the text field should be "(No Subject)",
  108. ** localized to the user's locale.
  109. **
  110. ** This method should not return until the user has clicked Ok (the
  111. ** return value should not be NULL) or they clicked Cancel (the return
  112. ** value should be NULL.)
  113. */
  114. char*
  115. FE_PromptMessageSubject(MWContext *context)
  116. {
  117. }
  118.  
  119. /*
  120. ** FE_PromptUsernameAndPassword - Put up a prompt dialog with the given
  121. ** message, a two text fields.  It should return TRUE if Ok was clicked
  122. ** and FALSE if Cancel was clicked.
  123. **
  124. ** The password text field should not show the characters as the user
  125. ** types them.  Display them as X's, *'s, spaces, etc.
  126. **
  127. ** This method should not return until the user has clicked Ok or Cancel.
  128. */
  129. Bool
  130. FE_PromptUsernameAndPassword(MWContext *context,
  131.                  const char *msg,
  132.                  char **username,
  133.                  char **password)
  134. {
  135. }
  136.  
  137.  
  138. /*
  139. ** FE_PromptForFileNam - Put up a file selection dialog with the given
  140. ** prompt string, 
  141. **
  142. ** the file selection box should open up viewing default_path.
  143. **
  144. ** if file_must_exist_p, the user should not be allowed to close the
  145. ** dialog with an invalid path selected.
  146. **
  147. ** if directories_allowed_p, directories can be selected.
  148. **
  149. ** After the user has clicked ok or cancel or given some other gesture
  150. ** to bring down the filesb, the ReadFileNameCallbackFunction should
  151. ** be called with the context, the textual path name, and the closure, as in
  152. ** 'fn(context, path, closure);'
  153. **
  154. ** Lastly, the function should return 0 if the path was acceptable and -1 if it
  155. ** was not.
  156. **
  157. ** This method should not return until the user has clicked Ok or Cancel.
  158. */
  159. int
  160. FE_PromptForFileName(MWContext *context,
  161.              const char *prompt_string,
  162.              const char *default_path,
  163.              XP_Bool file_must_exist_p,
  164.              XP_Bool directories_allowed_p,
  165.              ReadFileNameCallbackFunction fn,
  166.              void *closure)
  167. {
  168. }
  169.  
  170. /*
  171. ** FE_SaveDialog - Put up a dialog that basically says "I'm saving
  172. ** <foo> right now", cancel?
  173. **
  174. ** This function should not block, but should return after putting up the dialog.
  175. **
  176. ** If the user clicks cancel, the callback should call EDT_SaveCancel.
  177. **
  178. ** Note: This function has been overloaded for use in publishing as well.  There
  179. ** are three instances where this function will be called:
  180. **   1) Saving remote files to disk.
  181. **   2) Preparing to publish files remotely.
  182. **   3) Publishing files to a remote server.
  183. */
  184. void
  185. FE_SaveDialogCreate(MWContext *context,
  186.             int file_count,
  187.             ED_SaveDialogType save_type)
  188. {
  189. }
  190.  
  191. /*
  192. ** FE_SaveDialogSetFilename - for a save dialog that has been put up above the given
  193. ** context, set the filename being saved/published.
  194. */
  195. void
  196. FE_SaveDialogSetFilename(MWContext *context,
  197.              char *filename)
  198. {
  199. }
  200.  
  201. /*
  202. ** FE_SaveDialogDestroy - the backend calls this function to let us
  203. ** know that the save/publish operation has completed.  We should
  204. ** destroy the save dialog that has been used above the given context.
  205. */
  206. void
  207. FE_SaveDialogDestroy(MWContext *context,
  208.              int status,
  209.              char *filename)
  210. {
  211. }
  212.  
  213. /*
  214. ** FE_SaveFileExistsDialog - put up the standard dialog saying:
  215. ** "<foo> exists - overwrite?"  Yes to All, Yes, No, No to All.
  216. **
  217. ** return ED_SAVE_OVERWRITE_THIS if the user clicks Yes.
  218. ** return ED_SAVE_OVERWRITE_ALL if the user clicks Yes to All.
  219. ** return ED_SAVE_DONT_OVERWRITE_THIS if the user clicks No.
  220. ** return ED_SAVE_DONT_OVERWRITE_ALL if the user clicks No to All.
  221. */
  222. ED_SaveOption
  223. FE_SaveFileExistsDialog(MWContext *context,
  224.             char *filename)
  225. {
  226. }
  227.  
  228. /*
  229. ** FE_SaveErrorContinueDialog - put up a dialog that gives some
  230. ** textual represenation of the error status, and allow the user
  231. ** to decide if they want to continue or not.
  232. **
  233. ** Return TRUE if we should continue, and FALSE if we shouldn't.
  234. */
  235. Bool
  236. FE_SaveErrorContinueDialog(MWContext *context,
  237.                char *filename,
  238.                ED_FileError error)
  239. {
  240. }
  241.