home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / cntritem.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  4.1 KB  |  106 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 __CNTRITEM_H
  20. #define __CNTRITEM_H
  21. // cntritem.h : interface of the CNetscapeCntrItem class
  22. //
  23.  
  24. class CGenericDoc;
  25. class CGenericView;
  26.  
  27. class CNetscapeCntrItem : public COleClientItem
  28. {
  29.     DECLARE_SERIAL(CNetscapeCntrItem)
  30.  
  31. // Constructors
  32. public:
  33.     CNetscapeCntrItem(CGenericDoc* pContainer = NULL);
  34.         // Note: pContainer is allowed to be NULL to enable IMPLEMENT_SERIALIZE.
  35.         //  IMPLEMENT_SERIALIZE requires the class have a constructor with
  36.         //  zero arguments.  Normally, OLE items are constructed with a
  37.         //  non-NULL document pointer.
  38.  
  39. // Attributes
  40. public:
  41.     BOOL m_bLoading;    //  If we are currently loading, from the net until completed creation from file.
  42.     BOOL m_bBroken;     //  Consider this item broken.
  43.     BOOL m_bDelayed;    //  We have postponed loading of this item.
  44.     BOOL m_isDirty;
  45.     BOOL m_isFullPage;
  46.     BOOL m_bIsOleItem;
  47.     BOOL m_bSetExtents;
  48.  
  49.  
  50.     CString m_csAddress;    //  The url that this originated from, to avoid redundant reloads.
  51.     CString m_csFileName;   //  The local temp file this item is located in, so on destruction we can also delete this file.
  52.     CString m_csDosName;    //  The dos file name for m_csAddress if it is a local file.
  53.     BOOL    m_bCanSavedByOLE;
  54.     DISPID  m_idSavedAs;
  55.  
  56.     CFile m_cfOutput;   //  Output temporary file.
  57.     int m_iLock;    //  How many references to this item anyhow?  To avoid freeing at inappropiate times.
  58.     CPtrList m_cplUnblock;  //  List of layout elements to unblock once the load is complete.  Flushed on a per load basis.
  59.     CPtrList m_cplDisplay;  //  List of layout elements that we will manually update once the load is complete.  Flushed on a per load basis.
  60.     CPtrList m_cplElements; //  List of all layout elements referencing this item.
  61.  
  62.     BOOL m_bLocationBarShowing; //  Wether or not the URL bar was present in the Frame before we were activated.
  63.     BOOL m_bStarterBarShowing; //  Wether or not the URL bar was present in the Frame before we were activated.
  64.     CNetscapeCntrItem*    m_pOriginalItem;  // Needed when we reuse cached existing NPEmbeddedApp(s), e.g. when printing
  65.  
  66. //    Operations
  67. public:
  68.     CGenericDoc* GetDocument()
  69.         { return (CGenericDoc *)COleClientItem::GetDocument(); }
  70.     CGenericView* GetActiveView()
  71.         { return (CGenericView *)COleClientItem::GetActiveView(); }
  72.     BOOL IsDirty() {return m_isDirty;}
  73.  
  74.  
  75. // Implementation
  76. public:
  77.     ~CNetscapeCntrItem();
  78. #ifdef _DEBUG
  79.     virtual void AssertValid() const;
  80.     virtual void Dump(CDumpContext& dc) const;
  81. #endif
  82.     virtual void Serialize(CArchive& ar);
  83.     virtual void OnDeactivateUI(BOOL bUndoable);
  84.     virtual BOOL OnShowControlBars(CFrameWnd *pFrame, BOOL bShow);
  85.     
  86. // TODO: We can remove this check once everyone moves to MSVC 4.0
  87. #if defined(MSVC4)
  88.     virtual BOOL OnUpdateFrameTitle();
  89. #else    
  90.     virtual void OnUpdateFrameTitle();
  91. #endif    // MSVC4
  92.  
  93.  
  94.  
  95. protected:
  96.     virtual void OnChange(OLE_NOTIFICATION wNotification, DWORD dwParam);
  97.     virtual BOOL OnChangeItemPosition(const CRect& rectPos);
  98.     virtual void OnGetItemPosition(CRect& rectPos);
  99.     virtual BOOL OnGetWindowContext(CFrameWnd **ppMainFrame, CFrameWnd **ppDocFrame, LPOLEINPLACEFRAMEINFO lpFrameInfo);
  100.     virtual BOOL CanActivate();
  101.     virtual void OnActivate();
  102. };
  103.  
  104. /////////////////////////////////////////////////////////////////////////////
  105. #endif // __CNTRITEM_H
  106.