home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / ngdwtrst.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.9 KB  |  99 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 __TRUST_H
  20. //    Avoid include redundancy
  21. //
  22. #define __TRUST_H
  23.  
  24. //    Purpose:    Contain a database of trusted/nontrusted applications which we will
  25. //                  either spawn without user decision, or never spawn at all.
  26. //    Comments:   Created to basically inform the user of potential security risks to their
  27. //                  local machine.  This is not a solution, but is a stop gap measure.
  28. //    Revision History:
  29. //      04-10-95    created GAB
  30. //
  31.  
  32. //    Required Includes
  33. //
  34.  
  35. //    Constants
  36. //
  37.  
  38. //    Structures
  39. //
  40. class CTrust    {   //  A matter of feeling.
  41.     CString m_csExeName;    //  The name of the application of which we have an opinion.
  42.  
  43. public:
  44.     enum Relationship    {
  45.         m_Stranger, //  Don't talk to strangers.
  46.         m_Friend    //  Geordi and Hue
  47.     };
  48. private:
  49.     Relationship m_rFeeling;    //  How we feel about this app.
  50.  
  51. public:
  52.     Relationship GetRelationship() {
  53.         return m_rFeeling;
  54.     }
  55.  
  56.     void SetRelationship(Relationship feeling) {
  57.         m_rFeeling = feeling;
  58.     }
  59.  
  60.     CString GetExeName()    {
  61.         return m_csExeName;
  62.     }
  63.  
  64.     CTrust(CString& csExeName, Relationship rFeeling)    {
  65.         m_csExeName = csExeName;
  66.         m_rFeeling = rFeeling;
  67.     }
  68. };
  69.  
  70. class CSpawnList    {   //  List of children we would like to have.
  71.     CPtrList m_cplOpinions; //  List of apps which we have opinions on.
  72.  
  73. public:
  74.     CSpawnList();   //  Create, read list from INI
  75.     ~CSpawnList();  //  Destroy, write list to INI
  76.  
  77.     // Returns whether or not the application can be launched. If it isn't know whether
  78.     // or not the application is trusted, a dialog is displayed asking the user what to do
  79.     BOOL CanSpawn(CString& csExeName, CWnd *pWnd);
  80.  
  81.     // Returns TRUE if we should ask the user before downloading a file of this type or
  82.     // FALSE if the user has indicated we trust it
  83.     BOOL    PromptBeforeOpening(LPCSTR lpszExeName);
  84.  
  85.     // Sets whether we should prompt before opening a downloaded file of this type
  86.     void    SetPromptBeforeOpening(LPCSTR lpszExeName, BOOL);
  87. };
  88.  
  89. //    Global variables
  90. //
  91.  
  92. //    Macros
  93. //
  94.  
  95. //    Function declarations
  96. //
  97.  
  98. #endif // __TRUST_H
  99.