home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / helper.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.7 KB  |  77 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 _HELPER_APP_
  20. #define _HELPER_APP_
  21.  
  22. class CHelperApp : public CObject
  23. {
  24. private:
  25.     friend class CSpawnList;
  26.     friend class COwnedAndLostList;
  27.     friend class COwnedLostItem;
  28.  
  29.     static CPtrList m_cplHelpers;
  30.     POSITION m_rIndex;
  31. public:
  32.     CHelperApp()    {
  33.         m_rIndex = m_cplHelpers.AddTail((void *)this);
  34.         how_handle = HANDLE_UNKNOWN;
  35.     }
  36.     ~CHelperApp()   {
  37.         m_cplHelpers.RemoveAt(m_rIndex);
  38.     }
  39.  
  40.     int     iPos;
  41.     NET_cdataStruct *cd_item;
  42.     int     how_handle;
  43.     CString csCmd;
  44.     BOOL    bChanged;
  45.     BOOL    bNewType;
  46.     BOOL    bChangedExts; 
  47.     CString    strFileClass;  // Windows registry file type class
  48.  
  49.     CString csMimePrefPrefix; //Prefix of the mime type - if this helper is associated with a MIME type specd. thru' prefs...CRN_MIME
  50. };
  51.  
  52.  
  53. //
  54. // INI file strings to tell how to handle mime types
  55. //
  56. #define MIME_INTERNALLY "browser-handle-internal"
  57. #define MIME_PROMPT     "browser-handle-promptuser"
  58. #define MIME_SAVE       "browser-handle-internal-savetodisk"
  59. #define MIME_SHELLEXECUTE      "browser-handle-shellexecute"
  60. #define MIME_OLE      "browser-handle-oleserver"
  61.  
  62. // Helper functions
  63. extern NET_cdataStruct *
  64. fe_NewFileType(LPCSTR lpszDescription, LPCSTR lpszExtension, LPCSTR lpszMimeType, LPCSTR lpszOpenCmd);
  65.  
  66. extern BOOL fe_RemoveFileType(NET_cdataStruct *);
  67.  
  68. extern BOOL fe_ChangeFileType(NET_cdataStruct *, LPCSTR lpszMimeType, int nHowToHandle, LPCSTR lpszOpenCmd);
  69.  
  70. extern BOOL fe_CanHandleByOLE(char** exts, short numOfExt);
  71. extern BOOL fe_SetHandleByOLE(char* mimeType, CHelperApp* app,BOOL handleByOLE);
  72. extern BOOL fe_IsHandleByOLE(char* mimeType);
  73. extern BOOL  CopyRegKeys(HKEY  hKeyOldName, HKEY  hKeyNewName, DWORD subkeys, DWORD maxSubKeyLen, DWORD maxClassLen,                   DWORD values,
  74.                    DWORD maxValueNameLen,DWORD maxValueLen,const char *OldPath,const char *NewPath);
  75. extern void SetShellOpenCommand(LPCSTR lpszFileClass, LPCSTR lpszCmdString);
  76. #endif /* _HELPER_APP_ */
  77.