home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / apicx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.1 KB  |  81 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 _APICX_H
  20. #define _APICX_H
  21.  
  22. #ifndef __APIAPI_H
  23.     #include "apiapi.h"
  24. #endif
  25. #ifndef __NSGUIDS_H
  26.     #include "nsguids.h"
  27. #endif
  28.  
  29. // Define these for graceful type coping
  30.  
  31. typedef struct MWContext_ MWContext;
  32. typedef struct URLStruct_ URLStruct;
  33. typedef struct PrintSetup_ PrintSetup;
  34.  
  35. class IMWContext: public IUnknown
  36. {
  37. public:
  38.  
  39.     //  The context functions of the class, all pure virtual at this level.
  40.     //  This is a special hack to autogenerate the functions as pure virtual.
  41.     //  See the header mk_cx_fn.h for more insight.
  42.     //  This more or less must be the first thing done in the class, to get all the
  43.     //      virtual tables correct in classes to come.
  44.  
  45. #define FE_DEFINE(funkage, returns, args) virtual returns funkage args = 0;
  46. #include "mk_cx_fn.h"
  47.  
  48.     //  The URL exit routine.
  49.     //  This is called by CFE_GetUrlExitRoutine, which should be passed as the exit routine
  50.     //      in any calls to NET_GetURL....
  51.     virtual void GetUrlExitRoutine(URL_Struct *pUrl, int iStatus, MWContext *pContext) = 0;
  52.  
  53.     //  The text translation exit routine.
  54.     //  This is called by CFE_TextTranslationExitRoutine, which should be passed as the exit
  55.     //      routine in any calls to XL_TranslateText....
  56.     virtual void TextTranslationExitRoutine(PrintSetup *pTextFE) = 0;
  57.  
  58.     //  XP Context accessor
  59.     virtual MWContext *GetContext() const = 0;
  60.  
  61.     //    This function is very important.
  62.     //    It allows you to write code which can detect when a context
  63.     //        is actually in the process of being destroyed.
  64.     //    In many cases, you will receive callbacks from the XP libraries
  65.     //        while the context is being destroyed.  If you GPF, then use
  66.     //        this function to better detect your course of action.
  67.     virtual BOOL IsDestroyed() const = 0;
  68.  
  69.     //    Function to load a URL with this context, with the custom exit routing handler.
  70.     //    Use this to NET_GetURL instead or XL_TranslateText instead.
  71.     virtual int GetUrl(URL_Struct *pUrl, FO_Present_Types iFormatOut, BOOL bReallyLoad = TRUE, BOOL bForceNew = FALSE) = 0;
  72.  
  73.     //    Generic brain dead interface to load a URL.
  74.     //    This used to be known as OnNormalLoad.
  75.     virtual int NormalGetUrl(const char *pUrl, const char *pReferrer = NULL, const char *pTarget = NULL, BOOL bForceNew = FALSE) = 0;
  76. };
  77.  
  78. typedef IMWContext *LPMWCONTEXT;
  79.  
  80. #endif
  81.