home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / urlecho.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.3 KB  |  103 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 __URLECHO_H
  20. //    Avoid include redundancy
  21. //
  22. #define __URLECHO_H
  23.  
  24. //    Purpose:    Monitor loaded URLs and their referrers
  25. //    Comments:    Implementing since API through netlib finally made clear.
  26. //    Revision History:
  27. //        01-18-95    created GAB
  28. //
  29.  
  30. //    Required Includes
  31. //
  32.  
  33. //    Constants
  34. //
  35.  
  36. //    Structures
  37. //
  38. class CEchoRegistry    {
  39. protected:
  40.     static CPtrList m_Registry;
  41.     POSITION m_rIndex;
  42.  
  43.     CEchoRegistry()    {
  44.     }
  45.     ~CEchoRegistry()    {
  46.         m_Registry.RemoveAt(m_rIndex);
  47.     }
  48. };
  49.  
  50. class CEchoItem : public CEchoRegistry    {    
  51. protected:
  52.     enum    {
  53.         m_DDE,
  54.         m_OLE
  55.     };
  56.     int m_iType;
  57.  
  58.     CEchoItem(int iType) : CEchoRegistry()    {
  59.         m_iType = iType;
  60.     }
  61.     
  62.     virtual void EchoURL(CString& csURL, CString& csMimeType, DWORD dwWindowID, CString& csReferrer) = 0;    
  63. public:
  64.     int GetType()    {
  65.         return(m_iType);
  66.     }
  67.     
  68.     static void Echo(CString& csURL, CString& csMimeType, DWORD dwWindowID, CString& csReferrer);
  69. };
  70.  
  71. class CDDEEchoItem : public CEchoItem    {
  72.     CString m_csServiceName;
  73.     
  74. protected:
  75.     CDDEEchoItem(CString& csServiceName) : CEchoItem(m_DDE)    {
  76.         m_rIndex = m_Registry.AddTail(this);
  77.         m_csServiceName = csServiceName;
  78.     }
  79.  
  80.     //    Must override.
  81.     void EchoURL(CString& csURL, CString& csMimeType, DWORD dwWindowID, CString& csReferrer);
  82.     
  83. public:
  84.     CString GetServiceName()    {
  85.         return(m_csServiceName);
  86.     }
  87.  
  88.     //    Consider these the constructor, destructor.
  89.     static void DDERegister(CString &csServiceName);
  90.     static BOOL DDEUnRegister(CString &csServiceName);    
  91. };
  92.  
  93. //    Global variables
  94. //
  95.  
  96. //    Macros
  97. //
  98.  
  99. //    Function declarations
  100. //
  101.  
  102. #endif // __URLECHO_H
  103.