home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / ownedlst.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.1 KB  |  82 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 OWNED_H
  20. #define OWNED_H
  21.  
  22. enum OL_HandleMethod { OL_OLD_NETSCAPE, OL_CURRENT_NETSCAPE, OL_OTHER_APP };
  23.  
  24. class COwnedLostItem
  25. {
  26. public:
  27.     CString m_csPrettyName;
  28.     CString m_csMimeType;
  29.     OL_HandleMethod m_nHandleMethod;
  30.     BOOL m_bIgnored;
  31.     BOOL m_bBroken;
  32.  
  33.     COwnedLostItem(CString mimeType);
  34.     COwnedLostItem(CString mimeType, CString ignored);
  35.  
  36.     void SetHandledViaNetscape();
  37.     void FetchPrettyName();
  38.     void SetIgnored(BOOL b) { m_bIgnored = b; };
  39.  
  40.     BOOL IsInternetShortcut();
  41.     CString GetInternetShortcutFileClass();
  42.     CString MakeInternetShortcutName();
  43.  
  44.     void SetHandleMethodViaFileClass(const CString& fileClass, const CString& netscapeName,
  45.                                        const CString& directoryName);
  46.     void GiveControlToNetscape();
  47.     
  48.     CString GetRegistryValue() 
  49.     { 
  50.         if (m_bIgnored) 
  51.             return "Ignored";
  52.         if (m_bBroken)
  53.             return "Broken";
  54.         return "Not ignored."; 
  55.     };
  56. };
  57.  
  58. class COwnedAndLostList
  59. {
  60. private:
  61.     CPtrArray m_OwnedList;
  62.     CPtrArray m_LostList;
  63.     
  64. public:
  65.     ~COwnedAndLostList();
  66.  
  67.     void ConstructLists();
  68.     void WriteLists();
  69.  
  70.     CPtrArray* GetLostList() { return &m_LostList; };
  71.     CPtrArray* GetOwnedList() { return &m_OwnedList; };
  72.  
  73.     BOOL IsInOwnedList(const CString& mimeType);
  74.     BOOL IsInLostList(const CString& mimeType);
  75.  
  76.     COwnedLostItem* RemoveFromLostList(const CString& mimeType);
  77.  
  78.     BOOL NonemptyLostIgnoredIntersection();
  79. };
  80.  
  81. #endif // OWNED_H
  82.