home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / cxstubs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.0 KB  |  100 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 __Context_Stubs_H
  20. //    Avoid include redundancy
  21. //
  22. #define __Context_Stubs_H
  23.  
  24. //    Purpose:    Create a stub context class that will allow deriving contexts
  25. //                  from the abstract context easier.
  26. //              Only derive from the stub context iff you context has a very limited
  27. //                  implementation (such as no or little UI, no CDC, etc....).
  28.  
  29. //    Required Includes
  30. //
  31. #include "cxabstra.h"
  32.  
  33. class CStubsCX : public CAbstractCX {
  34.     ULONG m_ulRefCount;
  35.     LPUNKNOWN m_pOuterUnk;
  36.  
  37. public:
  38.     // IUnknown Interface
  39.     STDMETHODIMP         QueryInterface(REFIID,LPVOID *);
  40.     STDMETHODIMP_(ULONG) AddRef(void);
  41.     STDMETHODIMP_(ULONG) Release(void);
  42.  
  43.     // IContext Interface
  44.     
  45.     //  All this context does is define empty member functions
  46.     //      from the abstract pure virtual class.
  47. #define FE_DEFINE(funkage, returns, args) virtual returns funkage args;
  48. #include "mk_cx_fn.h"
  49.  
  50. public:
  51.     //  Other overridables we must define as stubs.
  52.     virtual void GetUrlExitRoutine(URL_Struct *pUrl, int iStatus, MWContext *pContext);
  53.     virtual void TextTranslationExitRoutine(PrintSetup *pTextFE);
  54.  
  55. #ifdef LAYERS
  56.        virtual BOOL HandleLayerEvent(CL_Layer * pLayer, CL_Event * pEvent) 
  57.           { return FALSE; }
  58.        virtual BOOL HandleEmbedEvent(LO_EmbedStruct *embed, CL_Event * pEvent) 
  59.           { return FALSE; }
  60. #endif
  61.  
  62.        virtual void UpdateStopState(MWContext *pContext);
  63.  
  64. public:
  65.     //  Construction/destruction (sets context type).
  66.     CStubsCX();
  67.     CStubsCX(ContextType ctMyType, MWContextType XPType);
  68.     CStubsCX(LPUNKNOWN pOuterUnk);
  69.     CStubsCX(LPUNKNOWN pOuterUnk, ContextType ctMyType, MWContextType XPType);
  70.     ~CStubsCX();
  71. };
  72.  
  73. class CFrameCX: public CStubsCX {
  74. private:
  75.     CFrameGlue *m_pFrame;
  76.  
  77. public:
  78.     CFrameCX(ContextType ctMyType, CFrameGlue *pFrame);
  79.     ~CFrameCX();
  80.  
  81. //    Progress helpers.
  82. protected:
  83.     int32 m_lOldPercent;
  84. public:
  85.     int32 QueryProgressPercent();
  86.     void SetProgressBarPercent(MWContext *pContext, int32 lPercent);
  87.  
  88.     void StartAnimation();
  89.     void StopAnimation();
  90.  
  91.     void Progress(MWContext *pContext, const char *pMessage);
  92.     void AllConnectionsComplete(MWContext *pContext);
  93.     
  94.     CWnd *GetDialogOwner() const;
  95.  
  96.     CFrameGlue *GetFrame() const { return m_pFrame; }
  97. };
  98.  
  99. #endif // __Context_Stubs_H
  100.