home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / genview.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  6.3 KB  |  189 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 __GenericView_H
  20. #define __GenericView_H
  21. // genview.h : header file
  22. //
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CGenericView view
  26.  
  27. class CGenericView : public CView
  28. {
  29. protected:
  30.     CGenericView();           // protected constructor used by dynamic creation
  31.     DECLARE_DYNCREATE(CGenericView)
  32.  
  33. //    Which window currently has focus, used to set form element focus.
  34. //    This possibly belongs to the Frame....
  35. public:
  36.     HWND m_hWndFocus;
  37.  
  38. //    Document access, actually routed through the context.
  39. public:
  40.     CGenericDoc *GetDocument();
  41.  
  42. protected:
  43.     //    The context.
  44.     CWinCX *m_pContext;
  45.  
  46.     // used for drawing backgrounds of forms    
  47.     HBRUSH   m_hCtlBrush;
  48.     COLORREF m_rgbBrushColor;
  49.  
  50. public:
  51.     CWinCX *GetContext() const    {
  52.         return(m_pContext);
  53.     }
  54.     virtual void SetContext(CAbstractCX *pContext);
  55.     void ClearContext()    {
  56.         m_pContext = NULL;
  57.     }
  58.  
  59. //    Frame access.
  60. public:
  61.     CFrameGlue *GetFrame() const;
  62.  
  63. //    Frame closing notification.
  64. public:
  65.     virtual void FrameClosing();
  66.  
  67. //    Wether or not we are in print preview
  68. // TODO: Move the print code to CGenericView
  69. protected:
  70.     BOOL m_bInPrintPreview;
  71.  
  72. // To restore Format/Character toolbar in Message Composer after Print Preview
  73.     BOOL m_bRestoreComposerToolbar;
  74.  
  75. public:
  76.     BOOL IsInPrintPreview() const    {
  77.         return(m_bInPrintPreview);
  78.     }
  79.  
  80. //    Need some friends which can call our protected functions.
  81. private:
  82.     friend class CGenericFrame;
  83.     friend class CNetscapePreviewView;
  84.  
  85. // Overrides
  86.     // ClassWizard generated virtual function overrides
  87.     //{{AFX_VIRTUAL(CGenericView)
  88.     public:
  89.     virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
  90.     protected:
  91.     virtual void OnDraw(CDC* pDC);      // overridden to draw this view
  92.     virtual void OnActivateView(BOOL bActivate, CView *pActivateView, CView *pDeactivateView);
  93.     virtual BOOL PreTranslateMessage(MSG * pMsg);
  94.     //}}AFX_VIRTUAL
  95.  
  96. //#ifndef NO_TAB_NAVIGATION
  97. public :
  98.     BOOL CGenericView::procTabNavigation( UINT nChar, UINT forward, UINT controlKey );
  99. //#endif /* NO_TAB_NAVIGATION */
  100.  
  101. // Implementation
  102. protected:
  103.     virtual ~CGenericView();
  104. #ifdef _DEBUG
  105.     virtual void AssertValid() const;
  106.     virtual void Dump(CDumpContext& dc) const;
  107. #endif
  108.  
  109. public:
  110.     // OnFindReplace message goes first to our frame
  111.     LRESULT OnFindReplace(WPARAM wParam, LPARAM lParam);
  112.  
  113. #ifdef LAYERS
  114.     virtual BOOL OnRButtonDownForLayer(UINT nFlags, CPoint& point, 
  115.                        long lX, long lY, CL_Layer *layer) 
  116.       { return FALSE; }
  117. #endif
  118.  
  119.     // Generated message map functions
  120. protected:
  121.     //{{AFX_MSG(CGenericView)
  122.     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  123.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  124.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  125.     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  126.     afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point);
  127.     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  128.     afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
  129.     afx_msg int OnMouseActivate( CWnd *, UINT, UINT );
  130.     afx_msg HBRUSH OnCtlColor( CDC* pDC, CWnd* pWnd, UINT nCtlColor );
  131.     afx_msg void OnFileMailto();
  132.     afx_msg void OnUpdateFileMailto(CCmdUI* pCmdUI);
  133.     afx_msg void OnFileOpen();
  134.     afx_msg void OnUpdateFileOpen(CCmdUI* pCmdUI);
  135.     afx_msg void OnNetscapeSaveAs();
  136.     afx_msg void OnUpdateNetscapeSaveAs(CCmdUI* pCmdUI);
  137.     afx_msg void OnNetscapeSaveFrameAs();
  138.     afx_msg void OnUpdateNetscapeSaveFrameAs(CCmdUI* pCmdUI);
  139.     afx_msg void OnNavigateBack();
  140.     afx_msg void OnUpdateNavigateBack(CCmdUI* pCmdUI);
  141.     afx_msg void OnUpdateNavigateForward(CCmdUI* pCmdUI);
  142.     afx_msg void OnNavigateForward();
  143.     afx_msg void OnNavigateReload();
  144.     afx_msg void OnUpdateNavigateReload(CCmdUI* pCmdUI);
  145.     afx_msg void OnUpdateViewLoadimages(CCmdUI* pCmdUI);
  146.     afx_msg void OnViewLoadimages();
  147.     afx_msg void OnFilePrint();
  148.     afx_msg void OnUpdateFilePrint(CCmdUI* pCmdUI);
  149.     afx_msg void OnUpdateFilePrintPreview(CCmdUI* pCmdUI);
  150.     afx_msg void OnEditFindincurrent();
  151.     afx_msg void OnUpdateEditFindincurrent(CCmdUI* pCmdUI);
  152.     afx_msg void OnUpdateEditWithFrameFindincurrent(CCmdUI* pCmdUI);
  153.     afx_msg void OnEditFindAgain();
  154.     afx_msg void OnUpdateEditFindAgain(CCmdUI* pCmdUI);
  155.     afx_msg void OnNavigateInterrupt();
  156.     afx_msg void OnUpdateNavigateInterrupt(CCmdUI* pCmdUI);
  157.     afx_msg void OnEditCopy();
  158.     afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
  159.     afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
  160.     afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
  161.     afx_msg void OnSelectAll();
  162.     afx_msg void OnFileViewsource();
  163.     afx_msg void OnUpdateFileViewsource(CCmdUI* pCmdUI);
  164.     afx_msg void OnFileDocinfo();
  165.     afx_msg void OnUpdateFileDocinfo(CCmdUI* pCmdUI);
  166.     afx_msg void OnViewPageServices();
  167.     afx_msg void OnUpdateViewPageServices(CCmdUI* pCmdUI);
  168.     afx_msg void OnGoHome();
  169.     afx_msg void OnUpdateGoHome(CCmdUI* pCmdUI);
  170.     afx_msg void OnMove(int x, int y);
  171.     afx_msg void OnFileUploadfile();
  172.     afx_msg void OnUpdateFileUploadfile(CCmdUI* pCmdUI);
  173.     afx_msg void OnNavigateReloadcell();
  174.     afx_msg void OnUpdateNavigateReloadcell(CCmdUI* pCmdUI);
  175.     afx_msg void OnViewFrameInfo();
  176.     afx_msg void OnUpdateViewFrameInfo(CCmdUI* pCmdUI);
  177.     afx_msg void OnViewFrameSource();
  178.     afx_msg void OnUpdateViewFrameSource(CCmdUI* pCmdUI);
  179.     afx_msg void OnSetFocus(CWnd* pOldWnd);
  180.     afx_msg void OnKillFocus(CWnd* pNewWnd);
  181.     afx_msg void OnNcPaint();
  182.     afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp);
  183.     //}}AFX_MSG
  184.     DECLARE_MESSAGE_MAP()
  185. };
  186.  
  187. /////////////////////////////////////////////////////////////////////////////
  188. #endif // __GenericView_H
  189.