home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / central / uerrmgr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.2 KB  |  92 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.  *    uerrmgr.h, Mac front end
  21.  *    
  22.  *    Created 6/18/94 by atotic
  23.  *    
  24.  *    Definiton of ErrorManager, a utility class that handles display of error
  25.  *  messages.
  26.  *****************************************************************************/
  27.  
  28. #pragma once
  29.  
  30. #include <Types.h>
  31.  
  32. struct CStr255;
  33.  
  34. /*----------------------------------------------------------------------------
  35.     class ErrorManager - Utility class, no instances are created
  36.     
  37.     Function:
  38.     Error manager provides utility routines for displaying
  39.     dialog boxes:
  40.     
  41.     PrepareToInteract -- makes sure that Netscape is frontmost application
  42.     
  43.     Implementation:
  44.     
  45.     All plain alerts (simple text + buttons) use standard Toolbox 
  46.     alert routines.
  47.     If we are in the background, notification manager is used
  48.     to notify the user to bring application to front.
  49.     No instances of ErrorManager should be created.
  50.  -----------------------------------------------------------------------------*/
  51. #include "reserr.h"
  52.  
  53. // STILL UNDER CONSTRUCTION. FUNCTIONS WILL BE DEFINED AS NEEDED.
  54. class ErrorManager    {
  55. public:
  56.     static const CStr255 OSNumToStr(OSErr err);
  57.  
  58.     // Call this before displaying any dialogs. It makes sure that the
  59.     // application is in the foreground. The routine will not 
  60.     // return until application is in the foreground
  61.     static void PrepareToInteract();
  62.     
  63.     // Just like PrepareToInteract, except that it returns FALSE
  64.     // if application has not been brought to foreground within wait seconds
  65.     static Boolean TryToInteract(long wait);
  66.     
  67.     // Displays a vanilla alert. All strings inside the alert are 
  68.     // supplied by caller
  69.     static void PlainAlert (const CStr255& s1, 
  70.                         const char * s2 = NULL, 
  71.                         const char * s3 = NULL, 
  72.                         const char * s4 = NULL);
  73.                         
  74.     // Displays the alert specified by resID
  75.     static void    PlainAlert( short resID );
  76.  
  77.     // Yes or No box. All strings supplied by the caller
  78.     static Boolean PlainConfirm(const char * s1, 
  79.                         const char * s2 = NULL, 
  80.                         const char * s3 = NULL, 
  81.                         const char * s4 = NULL);
  82.     // Prints a string "message :err"
  83.     static void ErrorNotify(OSErr err, const CStr255& message);
  84.     static OSType sAlertApp;    // Application that handles our alerts
  85. };
  86.  
  87. extern "C" char * XP_GetString( int resID );
  88. extern "C" char * GetCString( short resID );
  89. CStr255 GetPString( ResIDT id );
  90. void    MoveResourceMapBelowApp();
  91.  
  92.