home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / regproto.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.7 KB  |  104 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 __PROTOREG_H
  20. //    Avoid include redundancy
  21. //
  22. #define __PROTOREG_H
  23.  
  24. //    Purpose:    Handle registration of external protocol registrations.
  25. //    Comments:    Made to interact with DDE servers, and OLE automation servers.
  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 CProtocolRegistry    {
  39. protected:
  40.     static CPtrList m_Registry;
  41.     POSITION m_rIndex;
  42.  
  43.     CProtocolRegistry();
  44.     ~CProtocolRegistry();
  45. };
  46.  
  47. class CProtocolItem : public CProtocolRegistry    {    
  48. protected:
  49.     enum    {
  50.         m_DDE,
  51.         m_OLE
  52.     };
  53.     int m_iType;
  54.     CString m_csProtocol;
  55.     CString m_csServiceName;
  56.  
  57.     CProtocolItem(CString& csProtocol, CString& csServiceName, int iType);
  58.     ~CProtocolItem();
  59.     
  60. public:
  61.     int GetType();
  62.     CString GetServiceName();
  63.     
  64.     static CProtocolItem *Find(CString& csProtocol);
  65.     virtual BOOL OpenURL(URL_Struct *pURL, MWContext *pContext, FO_Present_Types iFormatOut) = 0;
  66. };
  67.  
  68. class COLEProtocolItem : public CProtocolItem   {
  69. protected:
  70.     COLEProtocolItem(CString& csProtocol, CString& csServiceName);
  71.  
  72. public:
  73.     //  Consider these the contructor, destructor, but with retvals.
  74.     static BOOL OLERegister(CString& csProtocol, CString& csServiceName);
  75.     static BOOL OLEUnRegister(CString& csProtocol, CString& csServiceName);
  76.  
  77.     //  Must override.
  78.     BOOL OpenURL(URL_Struct *pURL, MWContext *pContext, FO_Present_Types iFormatOut);
  79. };
  80.  
  81. class CDDEProtocolItem : public CProtocolItem    {
  82. protected:
  83.     CDDEProtocolItem(CString& csProtocol, CString& csServiceName);
  84.     
  85. public:
  86.     //    Consider these the constructor, destructor, but with retvals.
  87.     static BOOL DDERegister(CString &csProtocol, CString &csServiceName);
  88.     static BOOL DDEUnRegister(CString &csProtocol, CString &csServiceName);
  89.     
  90.     //    Must override.
  91.     BOOL OpenURL(URL_Struct *pURL, MWContext *pContext, FO_Present_Types iFormatOut);
  92. };
  93.  
  94. //    Global variables
  95. //
  96.  
  97. //    Macros
  98. //
  99.  
  100. //    Function declarations
  101. //
  102.  
  103. #endif // __PROTOREG_H
  104.