home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / thrdfrm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  6.4 KB  |  199 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 _THRDFRM_H
  20. #define _THRDFRM_H
  21.  
  22. #include "mailfrm.h"
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25. // C3PaneMailFrame frame
  26.  
  27. class C3PaneMailFrame : public CMsgListFrame
  28. {
  29.     DECLARE_DYNCREATE(C3PaneMailFrame)
  30. protected:
  31.     C3PaneMailFrame();
  32.  
  33.     enum { actionNone, actionSelectFirst, actionNavigation, actionSelectKey };
  34.  
  35.     int m_actionOnLoad;
  36.     MSG_MotionType m_navPending;
  37.     MessageKey m_selPending;
  38.  
  39.     int m_nLoadingFolder;
  40.     BOOL m_bDragCopying;
  41.  
  42.     BOOL m_bNoScrollHack;
  43.  
  44. // Attibutes
  45.     BOOL m_bWantToGetMail;
  46.     
  47.     COutlinerParent *m_pOutlinerParent;
  48.     MSG_Pane *m_pFolderPane;
  49.     CFolderOutliner *m_pFolderOutliner;
  50.     COutlinerParent *m_pFolderOutlinerParent;
  51.     CMailNewsSplitter *m_pFolderSplitter;
  52.     CMailNewsSplitter *m_pThreadSplitter;
  53.     CThreadStatusBar m_barStatus;
  54.  
  55.     void UIForFolder( MSG_FolderInfo *folderInfo );
  56.     void DoOpenMessage(BOOL bReuse);
  57.     void BlankOutThreadPane();
  58.     void BlankOutMessagePane(MSG_FolderInfo *folderInfo = NULL);
  59.  
  60. // IMailFrame override
  61.     virtual void PaneChanged( MSG_Pane *pane, XP_Bool asynchronous, 
  62.                               MSG_PANE_CHANGED_NOTIFY_CODE, int32 value);
  63.  
  64. // Support for IMsgList Interface (Called by CMailMsgList)
  65.     virtual void ListChangeStarting( MSG_Pane* pane, XP_Bool asynchronous,
  66.                                      MSG_NOTIFY_CODE notify, MSG_ViewIndex where,
  67.                                      int32 num);
  68.     virtual void ListChangeFinished( MSG_Pane* pane, XP_Bool asynchronous,
  69.                                      MSG_NOTIFY_CODE notify, MSG_ViewIndex where,
  70.                                      int32 num);
  71.     virtual void GetSelection( MSG_Pane* pane, MSG_ViewIndex **indices, int *count, 
  72.                                int *focus);
  73.     virtual void SelectItem( MSG_Pane* pane, int item );
  74.  
  75. // Overrides
  76.     virtual BOOL PreTranslateMessage( MSG* pMsg );
  77.     virtual BOOL OnCreateClient( LPCREATESTRUCT lpcs, CCreateContext* pContext );
  78.  
  79.     void SwitchUI();
  80.     void SetIsNews( BOOL bNews );
  81.  
  82.     void CreateFolderOutliner();
  83.     void CreateThreadPane();
  84.  
  85.     virtual void SetSort( int idSort );
  86.  
  87.     BOOL IsThreadFocus() const { return m_pOutliner && m_pOutliner == GetFocus(); }
  88.     BOOL IsMessageFocus() const;
  89.  
  90.     virtual void DoUpdateNavigate( CCmdUI* pCmdUI, MSG_MotionType cmd );
  91.     virtual void DoNavigate( MSG_MotionType msgCommand );
  92.     virtual void DoPriority( MSG_PRIORITY priority );
  93.  
  94.     virtual void GetMessageString( UINT nID, CString& rMessage ) const;
  95.  
  96.     // Helper
  97.     void DoUndoNavigate( MSG_MotionType msgCommand );
  98.  
  99.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  100. #ifndef ON_COMMAND_RANGE
  101.     afx_msg BOOL OnCommand( WPARAM wParam, LPARAM lParam );
  102.     afx_msg BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
  103. #endif
  104.     afx_msg void OnClose();
  105.     afx_msg void OnDestroy();
  106.  
  107.     // Edit Menu Items
  108.     afx_msg void OnEditUndo();
  109.     afx_msg void OnEditRedo();
  110.     afx_msg void OnSelectThread ();
  111.     afx_msg void OnUpdateSelectThread ( CCmdUI * pCmdUI );
  112.     afx_msg void OnSelectFlagged();
  113.     afx_msg void OnUpdateSelectFlagged( CCmdUI *pCmdUI );
  114.     afx_msg void OnSelectAll();
  115.     afx_msg void OnUpdateSelectAll( CCmdUI *pCmdUI );
  116.     afx_msg void OnEditProperties();
  117.     afx_msg void OnUpdateProperties( CCmdUI *pCmdUI );
  118.  
  119.     // View Menu Items
  120.     afx_msg void OnViewMessage();
  121.     afx_msg void OnUpdateViewMessage( CCmdUI *pCmdUI );
  122.     afx_msg void OnViewCategories();
  123.     afx_msg void OnUpdateViewCategories( CCmdUI *pCmdUI );
  124.     afx_msg void OnViewFolder();
  125.  
  126.     // Message Menu Items
  127.     afx_msg void OnMove( UINT nID );
  128.     afx_msg void OnCopy( UINT nID );
  129.     afx_msg void OnUpdateFile( CCmdUI *pCmdUI );
  130.     afx_msg void OnIgnore();
  131.     afx_msg void OnUpdateIgnore(CCmdUI *pCmdUI);
  132.  
  133.     // Window menu items
  134.     afx_msg void OnFileBookmark( );
  135.     afx_msg void OnUpdateFileBookmark( CCmdUI *pCmdUI );
  136.  
  137.     // Non-menu Items
  138.     afx_msg void OnSelect();
  139.     afx_msg void OnSelectFolder();
  140.     afx_msg void OnOpen();
  141.     afx_msg void OnOpenNew();
  142.     afx_msg void OnOpenReuse();
  143.     afx_msg void OnUpdateOpen(CCmdUI *pCmdUI);
  144.     afx_msg void OnContinue();
  145.     afx_msg void OnContainer();
  146.     afx_msg void OnOpenNewFrame();
  147.  
  148.     afx_msg void OnPriorityLowest();
  149.     afx_msg void OnPriorityLow();
  150.     afx_msg void OnPriorityNormal();
  151.     afx_msg void OnPriorityHigh();
  152.     afx_msg void OnPriorityHighest();
  153.     afx_msg void OnUpdatePriority( CCmdUI *pCmdUI );
  154.  
  155.     afx_msg void OnDoneGettingMail();
  156.     DECLARE_MESSAGE_MAP()
  157.  
  158.     void SelectMessage( MessageKey key );
  159.  
  160. public:
  161.     ~C3PaneMailFrame();
  162.  
  163.     CMailNewsOutliner* GetFolderOutliner() { return m_pFolderOutliner; }
  164.     void LoadFolder( MSG_FolderInfo *folderInfo, 
  165.                      MessageKey key = MSG_MESSAGEKEYNONE,
  166.                      int action = actionSelectFirst);
  167.     void UpdateFolderPane(MSG_FolderInfo *pFolderInfo);
  168.     BOOL GetSelectedFolder(MSG_FolderLine* pFolderLine);
  169.  
  170.     virtual MessageKey GetCurMessage() const;
  171.     virtual MSG_FolderInfo *GetCurFolder() const;
  172.  
  173.     virtual LPCTSTR GetWindowMenuTitle();
  174.     virtual BOOL FileBookmark();
  175.  
  176.     virtual void CopyMessagesInto( MSG_Pane *pane, MSG_ViewIndex *indices, int count,
  177.                                    MSG_FolderInfo *folderInfo);
  178.     virtual void MoveMessagesInto( MSG_Pane *pane, MSG_ViewIndex *indices, int count,
  179.                                    MSG_FolderInfo *folderInfo);
  180.  
  181.     static C3PaneMailFrame *FindFrame( MSG_FolderInfo *folderInfo );
  182.     static C3PaneMailFrame *Open( );
  183.     static C3PaneMailFrame *Open( MSG_FolderInfo *folderInfo, 
  184.                                MessageKey key = MSG_MESSAGEKEYNONE,
  185.                                BOOL* pContinue = FALSE);
  186.     static C3PaneMailFrame *OpenInbox( BOOL bGetNew = FALSE );
  187.  
  188. #ifdef DEBUG_WHITEBOX
  189.     afx_msg void WhiteBox_OnDeleteMessage() { OnDeleteMessage(); }
  190.      afx_msg void WhiteBox_OnSelect() { OnSelect(); }
  191.      void WhiteBox_GetSelection( MSG_Pane* pane, MSG_ViewIndex **indices, int *count, int *focus){ 
  192.         GetSelection(pane,indices,count,focus);
  193.      }
  194.      BOOL WhiteBox_DoesMessageExist( MessageKey key );
  195. #endif
  196. };
  197.  
  198. #endif
  199.